Add test for issue 84666.
This commit is contained in:
parent
32ee368c86
commit
e3b19e5c25
1 changed files with 13 additions and 0 deletions
|
@ -114,3 +114,16 @@ fn any_unsized() {
|
|||
fn is_any<T: Any + ?Sized>() {}
|
||||
is_any::<[i32]>();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn distinct_type_names() {
|
||||
// https://github.com/rust-lang/rust/issues/84666
|
||||
|
||||
struct Velocity(f32, f32);
|
||||
|
||||
fn type_name_of_val<T>(_: T) -> &'static str {
|
||||
type_name::<T>()
|
||||
}
|
||||
|
||||
assert_ne!(type_name_of_val(Velocity), type_name_of_val(Velocity(0.0, -9.8)),);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue