#![feature(adt_const_params, generic_const_exprs)] #![allow(incomplete_features)] use const_unit_poc::values::{cm, kg, m, s, N}; fn main() { let distance = 1.0 * m; let mass = 18.0 * kg; let force = distance * mass / (1.8 * s * 2.0 * s); assert_eq!(force, 5.0 * N); let mut mutable_distance = 3.2 * m; mutable_distance -= 20.0 * cm; mutable_distance += 2.0 * m; assert_eq!(mutable_distance, 5.0 * m); }