aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_def')
-rw-r--r--crates/hir_def/src/data.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/crates/hir_def/src/data.rs b/crates/hir_def/src/data.rs
index d2bb381be..2f06a6e29 100644
--- a/crates/hir_def/src/data.rs
+++ b/crates/hir_def/src/data.rs
@@ -143,6 +143,7 @@ pub struct TraitData {
143 pub is_auto: bool, 143 pub is_auto: bool,
144 pub is_unsafe: bool, 144 pub is_unsafe: bool,
145 pub visibility: RawVisibility, 145 pub visibility: RawVisibility,
146 pub skip_array_during_method_dispatch: bool,
146} 147}
147 148
148impl TraitData { 149impl TraitData {
@@ -157,6 +158,10 @@ impl TraitData {
157 let container = AssocContainerId::TraitId(tr); 158 let container = AssocContainerId::TraitId(tr);
158 let visibility = item_tree[tr_def.visibility].clone(); 159 let visibility = item_tree[tr_def.visibility].clone();
159 let mut expander = Expander::new(db, tr_loc.id.file_id(), module_id); 160 let mut expander = Expander::new(db, tr_loc.id.file_id(), module_id);
161 let skip_array_during_method_dispatch = item_tree
162 .attrs(db, tr_loc.container.krate(), ModItem::from(tr_loc.id.value).into())
163 .by_key("rustc_skip_array_during_method_dispatch")
164 .exists();
160 165
161 let items = collect_items( 166 let items = collect_items(
162 db, 167 db,
@@ -168,7 +173,14 @@ impl TraitData {
168 100, 173 100,
169 ); 174 );
170 175
171 Arc::new(TraitData { name, items, is_auto, is_unsafe, visibility }) 176 Arc::new(TraitData {
177 name,
178 items,
179 is_auto,
180 is_unsafe,
181 visibility,
182 skip_array_during_method_dispatch,
183 })
172 } 184 }
173 185
174 pub fn associated_types(&self) -> impl Iterator<Item = TypeAliasId> + '_ { 186 pub fn associated_types(&self) -> impl Iterator<Item = TypeAliasId> + '_ {