]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-36116.rs
f4fe96cf75b558a68356be3bc6ae89f4a29c1b86
[rust.git] / src / test / ui / issues / issue-36116.rs
1 // Unnecessary path disambiguator is ok
2
3 // compile-pass
4 // skip-codegen
5 #![allow(unused)]
6 macro_rules! m {
7     ($p: path) => {
8         let _ = $p(0);
9         let _: $p;
10     }
11 }
12
13 struct Foo<T> {
14     _a: T,
15 }
16
17 struct S<T>(T);
18
19 fn f() {
20     let f = Some(Foo { _a: 42 }).map(|a| a as Foo::<i32>); //~ WARN unnecessary path disambiguator
21     let g: Foo::<i32> = Foo { _a: 42 }; //~ WARN unnecessary path disambiguator
22
23     m!(S::<u8>); // OK, no warning
24 }
25
26
27 fn main() {}