diff options
| author | Ralf Jung <post@ralfj.de> | 2025-02-25 07:43:16 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-25 07:43:16 +0000 |
| commit | cfb827804fb9ee5bd93f8373ef4b9afbc5b0a38b (patch) | |
| tree | 379f598e24bdd72753363bd43e7af456ed20c186 /compiler/rustc_const_eval/src | |
| parent | 913612c59e35e6c85182c55a5f7bface4a828a32 (diff) | |
| parent | 40ba5d25465dc63bff3e3b13b6e592dad8be8435 (diff) | |
| download | rust-cfb827804fb9ee5bd93f8373ef4b9afbc5b0a38b.tar.gz rust-cfb827804fb9ee5bd93f8373ef4b9afbc5b0a38b.zip | |
Merge pull request #4206 from RalfJung/rustup
Rustup
Diffstat (limited to 'compiler/rustc_const_eval/src')
| -rw-r--r-- | compiler/rustc_const_eval/src/check_consts/mod.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/check_consts/mod.rs b/compiler/rustc_const_eval/src/check_consts/mod.rs index 52e000858b4..659d4a30456 100644 --- a/compiler/rustc_const_eval/src/check_consts/mod.rs +++ b/compiler/rustc_const_eval/src/check_consts/mod.rs @@ -4,12 +4,13 @@ //! has interior mutability or needs to be dropped, as well as the visitor that emits errors when //! it finds operations that are invalid in a certain context. +use rustc_attr_parsing::{AttributeKind, find_attr}; use rustc_errors::DiagCtxtHandle; +use rustc_hir as hir; use rustc_hir::def_id::{DefId, LocalDefId}; use rustc_middle::ty::{self, PolyFnSig, TyCtxt}; use rustc_middle::{bug, mir}; use rustc_span::Symbol; -use {rustc_attr_parsing as attr, rustc_hir as hir}; pub use self::qualifs::Qualif; @@ -81,7 +82,8 @@ pub fn rustc_allow_const_fn_unstable( feature_gate: Symbol, ) -> bool { let attrs = tcx.hir().attrs(tcx.local_def_id_to_hir_id(def_id)); - attr::rustc_allow_const_fn_unstable(tcx.sess, attrs).any(|name| name == feature_gate) + + find_attr!(attrs, AttributeKind::AllowConstFnUnstable(syms) if syms.contains(&feature_gate)) } /// Returns `true` if the given `def_id` (trait or function) is "safe to expose on stable". |
