rust/tests/ui/parser/missing-closing-generics-bracket.rs
Esteban Küber d194795f14 Do not recover from Trait() if generic list is unterminated
If we encounter `fn foo<T: Trait()`, the recovery logic would it as if `Trait` was intended to use the Fn-like trait syntax, but if we don't know for certain that we've parsed a full trait bound (`fn foo<T: Trait()>`), we bail from the recovery as more likely there could have been a missing closing `>` and the `(` corresponds to the start of the fn parameter list.
2026-01-15 19:32:39 +00:00

10 lines
146 B
Rust

// Issue #141436
//@ run-rustfix
#![allow(dead_code)]
trait Trait<'a> {}
fn foo<T: Trait<'static>() {}
//~^ ERROR expected one of
fn main() {}