about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-02-09 04:03:20 +0000
committerbors <bors@rust-lang.org>2023-02-09 04:03:20 +0000
commite7acd078f443156b95cee11759a735db1cfc796e (patch)
treedd40e9d754e085d07687fcfaf62a031dac9177c1 /compiler/rustc_parse/src/parser
parent575d424c94e0d4feea8cf4fcf04d47b83f28eaef (diff)
parent3e07554fd73079a38a7d659676c2ada99db47d93 (diff)
downloadrust-e7acd078f443156b95cee11759a735db1cfc796e.tar.gz
rust-e7acd078f443156b95cee11759a735db1cfc796e.zip
Auto merge of #107828 - compiler-errors:rollup-gyj6dgj, r=compiler-errors
Rollup of 9 pull requests

Successful merges:

 - #107317 (Implement `AsFd` and `AsRawFd` for `Rc`)
 - #107429 (Stabilize feature `cstr_from_bytes_until_nul`)
 - #107713 (Extend `BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE`.)
 - #107761 (Replace a command line flag with an env var to allow tools to initialize the tracing loggers at their own discretion)
 - #107790 ( x.py fails all downloads that use a tempdir with snap curl #107722)
 - #107799 (correctly update goals in the cache)
 - #107813 (Do not eagerly recover for bad `impl Trait` types in macros)
 - #107817 (rustdoc: use svgo to shrink `wheel.svg`)
 - #107819 (Set `rust-analyzer.check.invocationLocation` to `root`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/ty.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/ty.rs b/compiler/rustc_parse/src/parser/ty.rs
index a19ea04fa5e..5b92563fc35 100644
--- a/compiler/rustc_parse/src/parser/ty.rs
+++ b/compiler/rustc_parse/src/parser/ty.rs
@@ -694,8 +694,9 @@ impl<'a> Parser<'a> {
         // `where`, so stop if it's it.
         // We also continue if we find types (not traits), again for error recovery.
         while self.can_begin_bound()
-            || self.token.can_begin_type()
-            || (self.token.is_reserved_ident() && !self.token.is_keyword(kw::Where))
+            || (self.may_recover()
+                && (self.token.can_begin_type()
+                    || (self.token.is_reserved_ident() && !self.token.is_keyword(kw::Where))))
         {
             if self.token.is_keyword(kw::Dyn) {
                 // Account for `&dyn Trait + dyn Other`.