diff options
| author | Pavel Grigorenko <GrigorenkoPV@ya.ru> | 2025-06-24 00:51:16 +0300 |
|---|---|---|
| committer | Pavel Grigorenko <GrigorenkoPV@ya.ru> | 2025-07-09 01:06:29 +0300 |
| commit | 813ec60744a4cc85740b73fb5bc2aba14bce41da (patch) | |
| tree | 084cc9319a7fa3e96c70b59df3aa4095d72ae6a2 /compiler/rustc_middle/src | |
| parent | 6f8e92d5aaa717773e38c1be547a0c4556ed9145 (diff) | |
| download | rust-813ec60744a4cc85740b73fb5bc2aba14bce41da.tar.gz rust-813ec60744a4cc85740b73fb5bc2aba14bce41da.zip | |
Port `#[type_const]` to the new attribute system
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/ty/assoc.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/ty/assoc.rs b/compiler/rustc_middle/src/ty/assoc.rs index 78b2e265b48..344a81f5e24 100644 --- a/compiler/rustc_middle/src/ty/assoc.rs +++ b/compiler/rustc_middle/src/ty/assoc.rs @@ -1,9 +1,10 @@ +use rustc_attr_data_structures::{AttributeKind, find_attr}; use rustc_data_structures::sorted_map::SortedIndexMultiMap; use rustc_hir as hir; use rustc_hir::def::{DefKind, Namespace}; use rustc_hir::def_id::DefId; use rustc_macros::{Decodable, Encodable, HashStable}; -use rustc_span::{Ident, Symbol, sym}; +use rustc_span::{Ident, Symbol}; use super::{TyCtxt, Visibility}; use crate::ty; @@ -160,7 +161,7 @@ impl AssocItem { // Inherent impl but this attr is only applied to trait assoc items. (AssocItemContainer::Impl, None) => return true, }; - tcx.has_attr(def_id, sym::type_const) + find_attr!(tcx.get_all_attrs(def_id), AttributeKind::TypeConst(_)) } } |
