mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
21 lines
378 B
Rust
21 lines
378 B
Rust
// run-pass
|
|
|
|
#![feature(core_intrinsics)]
|
|
|
|
use std::any::type_name;
|
|
|
|
struct Bar<M>(#[allow(dead_code)] 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");
|
|
}
|