afcf9b262d
When encountering a likely intended turbofish without `::`, bubble up the diagnostic instead of emitting it to allow the parser to recover more gracefully and avoid uneccessary type errors that are likely to be wrong.
15 lines
368 B
Rust
15 lines
368 B
Rust
#![allow(bare_trait_objects)]
|
|
|
|
trait Trait {}
|
|
|
|
fn f<'a, T: Trait + ('a)>() {} //~ ERROR parenthesized lifetime bounds are not supported
|
|
|
|
fn check<'a>() {
|
|
let _: Box<Trait + ('a)>; //~ ERROR parenthesized lifetime bounds are not supported
|
|
let _: Box<('a) + Trait>;
|
|
//~^ ERROR expected type, found `'a`
|
|
//~| ERROR expected `:`, found `)`
|
|
}
|
|
|
|
fn main() {}
|