Rollup merge of #122540 - WaffleLapkin:ununexpected, r=estebank

Do not use `?`-induced skewing of type inference in the compiler

This prevents breakage from #122412 and is generally a good idea.

r? `@estebank`
This commit is contained in:
Matthias Krüger 2024-03-20 05:51:22 +01:00 committed by GitHub
commit 9fb40efa6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 30 additions and 18 deletions

View file

@ -660,7 +660,7 @@ impl<'a> Parser<'a> {
// Add `>` to the list of expected tokens.
self.check(&token::Gt);
// Handle `,` to `;` substitution
let mut err = self.unexpected::<()>().unwrap_err();
let mut err = self.unexpected().unwrap_err();
self.bump();
err.span_suggestion_verbose(
self.prev_token.span.until(self.token.span),