1
Fork 0

ensure that all publicly reachable const fn have const stability info

This commit is contained in:
Ralf Jung 2024-11-02 21:19:21 +01:00
parent 686eeb83e9
commit e96808162a
12 changed files with 177 additions and 204 deletions

View file

@ -866,9 +866,7 @@ impl SyntaxExtension {
})
.unwrap_or_else(|| (None, helper_attrs));
let stability = attr::find_stability(sess, attrs, span);
// We set `is_const_fn` false to avoid getting any implicit const stability.
let const_stability =
attr::find_const_stability(sess, attrs, span, /* is_const_fn */ false);
let const_stability = attr::find_const_stability(sess, attrs, span);
let body_stability = attr::find_body_stability(sess, attrs);
if let Some((_, sp)) = const_stability {
sess.dcx().emit_err(errors::MacroConstStability {