Parse const unsafe trait properly
Previously, this was greedily stolen by the `fn` parsing logic.
This commit is contained in:
@@ -2664,7 +2664,10 @@ impl<'a> Parser<'a> {
|
||||
// Rule out `unsafe extern {`.
|
||||
&& !self.is_unsafe_foreign_mod()
|
||||
// Rule out `async gen {` and `async gen move {`
|
||||
&& !self.is_async_gen_block())
|
||||
&& !self.is_async_gen_block()
|
||||
// Rule out `const unsafe auto` and `const unsafe trait`.
|
||||
&& !self.is_keyword_ahead(2, &[kw::Auto, kw::Trait])
|
||||
)
|
||||
})
|
||||
// `extern ABI fn`
|
||||
|| self.check_keyword_case(exp!(Extern), case)
|
||||
|
||||
Reference in New Issue
Block a user