#![allow(dead_code, deprecated, unused_variables, unused_mut)] use std::fmt; struct Bar { bar: i32, hidden: f32, } impl fmt::Debug for Bar { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { fmt.debug_struct("Bar").field("bar", &self.bar).finish_non_exhaustive() } } fn main() { assert_eq!(format!("{:?}", Bar { bar : 10, hidden : 1.0 }), "Bar { bar: 10, .. }",); }