mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Handle ambiguity between const unsafe fn and const unsafe impl(path) trait
This commit is contained in:
@@ -2923,8 +2923,8 @@ pub(super) fn check_fn_front_matter(&mut self, check_pub: bool, case: Case) -> b
|
||||
&& !self.is_unsafe_foreign_mod()
|
||||
// Rule out `async gen {` and `async gen move {`
|
||||
&& !self.is_async_gen_block()
|
||||
// Rule out `const unsafe auto` and `const unsafe trait`.
|
||||
&& !self.is_keyword_ahead(2, &[kw::Auto, kw::Trait])
|
||||
// Rule out `const unsafe auto` and `const unsafe trait` and `const unsafe impl`.
|
||||
&& !self.is_keyword_ahead(2, &[kw::Auto, kw::Trait, kw::Impl])
|
||||
)
|
||||
})
|
||||
// `extern ABI fn`
|
||||
|
||||
Reference in New Issue
Block a user