1
Fork 0

Rollup merge of #129659 - RalfJung:const-fn-lang-feat, r=fee1-dead

const fn stability checking: also check declared language features

Fixes https://github.com/rust-lang/rust/issues/129656

`@oli-obk` I assume it is just an oversight that this didn't use `features().declared()`? Or is there a deep reason that this must only check `declared_lib_features`?
This commit is contained in:
Matthias Krüger 2024-08-31 14:46:06 +02:00 committed by GitHub
commit ea5bb99c0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 22 additions and 7 deletions

View file

@ -3093,10 +3093,7 @@ impl<'tcx> TyCtxt<'tcx> {
Some(stability) if stability.is_const_unstable() => {
// has a `rustc_const_unstable` attribute, check whether the user enabled the
// corresponding feature gate.
self.features()
.declared_lib_features
.iter()
.any(|&(sym, _)| sym == stability.feature)
self.features().declared(stability.feature)
}
// functions without const stability are either stable user written
// const fn or the user is using feature gates and we thus don't