mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
24 lines
453 B
Rust
24 lines
453 B
Rust
#![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();
|
|
}
|