Skip to content

Commit 2b39bea

Browse files
Handle ambiguity between const unsafe fn and const unsafe impl(path) trait
1 parent f55f6b4 commit 2b39bea

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
@@ -2923,8 +2923,8 @@ impl<'a> Parser<'a> {
29232923
&& !self.is_unsafe_foreign_mod()
29242924
// Rule out `async gen {` and `async gen move {`
29252925
&& !self.is_async_gen_block()
2926-
// Rule out `const unsafe auto` and `const unsafe trait`.
2927-
&& !self.is_keyword_ahead(2, &[kw::Auto, kw::Trait])
2926+
// Rule out `const unsafe auto` and `const unsafe trait` and `const unsafe impl`.
2927+
&& !self.is_keyword_ahead(2, &[kw::Auto, kw::Trait, kw::Impl])
29282928
)
29292929
})
29302930
// `extern ABI fn`

0 commit comments

Comments
 (0)