diff options
| author | Michael Goulet <michael@errs.io> | 2024-12-10 19:42:09 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-12-12 16:29:40 +0000 |
| commit | c5d02237d3cf76b0d40724ba6714afaad1947d13 (patch) | |
| tree | 67b1a5aeb68c49c29aae02823d46e99c4eb38dd3 /compiler/rustc_parse/src | |
| parent | 3f97c6be8d4b78c9df55804171c588ebfadcb63e (diff) | |
| download | rust-c5d02237d3cf76b0d40724ba6714afaad1947d13.tar.gz rust-c5d02237d3cf76b0d40724ba6714afaad1947d13.zip | |
Add tests
Diffstat (limited to 'compiler/rustc_parse/src')
| -rw-r--r-- | compiler/rustc_parse/src/parser/ty.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/ty.rs b/compiler/rustc_parse/src/parser/ty.rs index 92ce57bbc92..f696074e66a 100644 --- a/compiler/rustc_parse/src/parser/ty.rs +++ b/compiler/rustc_parse/src/parser/ty.rs @@ -348,7 +348,9 @@ impl<'a> Parser<'a> { TyKind::Err(guar) } } - } else if self.check_keyword(kw::Unsafe) { + } else if self.check_keyword(kw::Unsafe) + && self.look_ahead(1, |tok| matches!(tok.kind, token::Lt)) + { self.parse_unsafe_binder_ty()? } else { let msg = format!("expected type, found {}", super::token_descr(&self.token)); |
