Stablize const_extern_fn for "Rust" and "C"

All other ABIs are left unstable for now.

cc #64926
This commit is contained in:
Aaron Hill 2022-03-26 18:23:32 -04:00
parent 1fca19c8ca
commit 8035796b9a
No known key found for this signature in database
GPG key ID: B4087E510E98B164
4 changed files with 42 additions and 69 deletions

View file

@ -523,6 +523,9 @@ impl<'a> Parser<'a> {
let decl = self.parse_fn_decl(|_| false, AllowPlus::No, recover_return_sign)?;
let whole_span = lo.to(self.prev_token.span);
if let ast::Const::Yes(span) = constness {
// If we ever start to allow `const fn()`, then update
// feature gating for `#![feature(const_extern_fn)]` to
// cover it.
self.error_fn_ptr_bad_qualifier(whole_span, span, "const");
}
if let ast::Async::Yes { span, .. } = asyncness {