rust/tests/ui/issues/issue-61894.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
395 B
Rust
Raw Normal View History

// run-pass
#![feature(core_intrinsics)]
use std::any::type_name;
2022-07-25 20:36:03 +00:00
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");
}