Skip to content

Commit b44e5dc

Browse files
Handle the ambiguity between const unsafe fn and const unsafe impl(...) trait
1 parent e9005a8 commit b44e5dc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • compiler/rustc_parse/src/parser

compiler/rustc_parse/src/parser/item.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2911,8 +2911,8 @@ impl<'a> Parser<'a> {
29112911
&& !self.is_unsafe_foreign_mod()
29122912
// Rule out `async gen {` and `async gen move {`
29132913
&& !self.is_async_gen_block()
2914-
// Rule out `const unsafe auto` and `const unsafe trait`.
2915-
&& !self.is_keyword_ahead(2, &[kw::Auto, kw::Trait])
2914+
// Rule out `const unsafe auto` and `const unsafe trait` and `const unsafe impl`.
2915+
&& !self.is_keyword_ahead(2, &[kw::Auto, kw::Trait, kw::Impl])
29162916
)
29172917
})
29182918
// `extern ABI fn`

0 commit comments

Comments
 (0)