Rollup merge of #127103 - compiler-errors:tighten-trait-bound-parsing, r=fmease
Move binder and polarity parsing into `parse_generic_ty_bound` Let's pull out the parts of #127054 which just: 1. Make the parsing code less confusing 2. Fix `?use<>` (to correctly be denied) 3. Improve `T: for<'a> 'a` diagnostics This should have no user-facing effects on stable parsing. r? fmease
This commit is contained in:
commit
a4e92bfef0
7 changed files with 204 additions and 40 deletions
|
@ -2327,7 +2327,7 @@ impl<'a> Parser<'a> {
|
|||
let before = self.prev_token.clone();
|
||||
let binder = if self.check_keyword(kw::For) {
|
||||
let lo = self.token.span;
|
||||
let lifetime_defs = self.parse_late_bound_lifetime_defs()?;
|
||||
let (lifetime_defs, _) = self.parse_late_bound_lifetime_defs()?;
|
||||
let span = lo.to(self.prev_token.span);
|
||||
|
||||
self.psess.gated_spans.gate(sym::closure_lifetime_binder, span);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue