]> git.lizzy.rs Git - rust.git/blob - tests/ui/lint/unused/issue-105061-should-lint.rs
Rollup merge of #106779 - RReverser:patch-2, r=Mark-Simulacrum
[rust.git] / tests / ui / lint / unused / issue-105061-should-lint.rs
1 #![warn(unused)]
2 #![deny(warnings)]
3
4 struct Inv<'a>(&'a mut &'a ());
5
6 trait Trait<'a> {}
7 impl<'b> Trait<'b> for for<'a> fn(Inv<'a>) {}
8
9 fn with_bound()
10 where
11     for<'b> (for<'a> fn(Inv<'a>)): Trait<'b>, //~ ERROR unnecessary parentheses around type
12 {}
13
14 trait Hello<T> {}
15 fn with_dyn_bound<T>()
16 where
17     (dyn Hello<(for<'b> fn(&'b ()))>): Hello<T> //~ ERROR unnecessary parentheses around type
18 {}
19
20 fn main() {
21     with_bound();
22     with_dyn_bound();
23 }