diff options
| author | Michael Goulet <michael@errs.io> | 2024-06-27 12:58:35 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-07-10 17:15:02 -0400 |
| commit | e8445818d49fe968b35a130c66071c1b56498f93 (patch) | |
| tree | a53949940a7f245d0ea93a2a19ab8afbe4203bc7 /compiler/rustc_parse/src | |
| parent | 0c81f94b9a6207fb1fc080caa83584dea2d71fc6 (diff) | |
| download | rust-e8445818d49fe968b35a130c66071c1b56498f93.tar.gz rust-e8445818d49fe968b35a130c66071c1b56498f93.zip | |
Reorder modifiers and polarity to be *after* binder in trait bounds
Diffstat (limited to 'compiler/rustc_parse/src')
| -rw-r--r-- | compiler/rustc_parse/src/parser/ty.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/ty.rs b/compiler/rustc_parse/src/parser/ty.rs index 1e5b227aaa9..24183ac1218 100644 --- a/compiler/rustc_parse/src/parser/ty.rs +++ b/compiler/rustc_parse/src/parser/ty.rs @@ -978,7 +978,7 @@ impl<'a> Parser<'a> { /// Parses a type bound according to: /// ```ebnf /// TY_BOUND = TY_BOUND_NOPAREN | (TY_BOUND_NOPAREN) - /// TY_BOUND_NOPAREN = [TRAIT_BOUND_MODIFIERS] [for<LT_PARAM_DEFS>] SIMPLE_PATH + /// TY_BOUND_NOPAREN = [for<LT_PARAM_DEFS>] [TRAIT_BOUND_MODIFIERS] SIMPLE_PATH /// ``` /// /// For example, this grammar accepts `for<'a: 'b> ~const ?m::Trait<'a>`. @@ -988,8 +988,8 @@ impl<'a> Parser<'a> { has_parens: bool, leading_token: &Token, ) -> PResult<'a, GenericBound> { - let modifiers = self.parse_trait_bound_modifiers()?; let (mut lifetime_defs, binder_span) = self.parse_late_bound_lifetime_defs()?; + let modifiers = self.parse_trait_bound_modifiers()?; // Recover erroneous lifetime bound with modifiers or binder. // e.g. `T: for<'a> 'a` or `T: ~const 'a`. |
