rust/tests/ui/lint/unused/issue-105061-should-lint.rs

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

24 lines
473 B
Rust
Raw Normal View History

2023-01-14 09:03:25 +00:00
#![warn(unused)]
#![deny(warnings)]
struct Inv<'a>(#[allow(dead_code)] &'a mut &'a ());
2023-01-14 09:03:25 +00:00
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
{}
2023-01-16 12:44:14 +00:00
trait Hello<T> {}
fn with_dyn_bound<T>()
where
(dyn Hello<(for<'b> fn(&'b ()))>): Hello<T> //~ ERROR unnecessary parentheses around type
{}
2023-01-14 09:03:25 +00:00
fn main() {
with_bound();
2023-01-16 12:44:14 +00:00
with_dyn_bound();
2023-01-14 09:03:25 +00:00
}