mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-03 12:13:43 +00:00
bbd3a10663
Format `dyn Trait` better in `type_name` intrinsic Noticed this in #103764 (though not related to that PR at all!) ```rust trait Foo { type Bar; } fn main() { println!( "`dyn Fn(i32, i32) -> i32` => `{}`", std::any::type_name::<dyn Fn(i32, i32) -> i32>() ); println!( "`dyn Foo<Bar = i32> + Send + Sync` => `{}`", std::any::type_name::<dyn Foo<Bar = i32> + Send + Sync>() ); } ``` ``` `dyn Fn(i32, i32) -> i32` => `dyn core::ops::function::Fn<(i32, i32)>+Output = i32` `dyn Foo<Bar = i32> + Send + Sync` => `dyn playground::Foo+Bar = i32+core::marker::Sync+core::marker::Send` ``` Just reuse `pretty_print_dyn_existential` which already makes an attempt to make its output stable. |
||
---|---|---|
.. | ||
benches | ||
primitive_docs | ||
src | ||
tests | ||
Cargo.toml |