diff options
Diffstat (limited to 'src/test/ui/issues/issue-61894.rs')
-rw-r--r-- | src/test/ui/issues/issue-61894.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-61894.rs b/src/test/ui/issues/issue-61894.rs new file mode 100644 index 000000000..776fdbb74 --- /dev/null +++ b/src/test/ui/issues/issue-61894.rs @@ -0,0 +1,21 @@ +// run-pass + +#![feature(core_intrinsics)] + +use std::any::type_name; + +struct Bar<M>(#[allow(unused_tuple_struct_fields)] M); + +impl<M> Bar<M> { + fn foo(&self) -> &'static str { + fn f() {} + fn type_name_of<T>(_: T) -> &'static str { + type_name::<T>() + } + type_name_of(f) + } +} + +fn main() { + assert_eq!(Bar(()).foo(), "issue_61894::Bar<_>::foo::f"); +} |