Make unexpected always "return" PResult<()> & add unexpected_any

This prevents breakage when `?` no longer skews inference.
This commit is contained in:
Maybe Waffle 2024-03-15 11:36:21 +00:00
parent ee03c286cf
commit defcc44238
7 changed files with 25 additions and 15 deletions

View file

@ -189,7 +189,7 @@ pub fn parse_asm_args<'a>(
args.templates.push(template);
continue;
} else {
return p.unexpected();
p.unexpected_any()?
};
allow_templates = false;

View file

@ -151,7 +151,7 @@ fn parse_assert<'a>(cx: &mut ExtCtxt<'a>, sp: Span, stream: TokenStream) -> PRes
};
if parser.token != token::Eof {
return parser.unexpected();
parser.unexpected()?;
}
Ok(Assert { cond_expr, custom_message })