Why does printing a pointer print the same thing as printing the dereferenced pointer?

Rust usually focuses on object value (i.e. the interesting part of the contents) rather than object identity (memory addresses). The implementation of Display for &T where T implements Display defers directly to the contents. Expanding that macro manually for the String implementation of Display: impl<‘a> Display for &’a String { fn fmt(&self, f: &mut Formatter) … Read more