summaryrefslogtreecommitdiffstats
path: root/tests/ui/lint/unused/issue-105061-should-lint.rs
blob: 7e4e09473493a2cff2b723c4d43ba54502d6b59a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#![warn(unused)]
#![deny(warnings)]

struct Inv<'a>(&'a mut &'a ());

trait Trait<'a> {}
impl<'b> Trait<'b> for for<'a> fn(Inv<'a>) {}

fn with_bound()
where
    for<'b> (for<'a> fn(Inv<'a>)): Trait<'b>, //~ ERROR unnecessary parentheses around type
{}

trait Hello<T> {}
fn with_dyn_bound<T>()
where
    (dyn Hello<(for<'b> fn(&'b ()))>): Hello<T> //~ ERROR unnecessary parentheses around type
{}

fn main() {
    with_bound();
    with_dyn_bound();
}