aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/hir/src/display.rs4
-rw-r--r--crates/hir_def/src/data.rs4
-rw-r--r--crates/hir_def/src/item_tree.rs1
-rw-r--r--crates/hir_def/src/item_tree/lower.rs2
-rw-r--r--crates/hir_def/src/item_tree/pretty.rs5
-rw-r--r--crates/hir_def/src/item_tree/tests.rs4
6 files changed, 3 insertions, 17 deletions
diff --git a/crates/hir/src/display.rs b/crates/hir/src/display.rs
index c5cf803fd..72f0d9b5f 100644
--- a/crates/hir/src/display.rs
+++ b/crates/hir/src/display.rs
@@ -427,10 +427,6 @@ impl HirDisplay for Trait {
427 write!(f, "trait {}", data.name)?; 427 write!(f, "trait {}", data.name)?;
428 let def_id = GenericDefId::TraitId(self.id); 428 let def_id = GenericDefId::TraitId(self.id);
429 write_generic_params(def_id, f)?; 429 write_generic_params(def_id, f)?;
430 if !data.bounds.is_empty() {
431 write!(f, ": ")?;
432 f.write_joined(&*data.bounds, " + ")?;
433 }
434 write_where_clause(def_id, f)?; 430 write_where_clause(def_id, f)?;
435 Ok(()) 431 Ok(())
436 } 432 }
diff --git a/crates/hir_def/src/data.rs b/crates/hir_def/src/data.rs
index 8bcac60ef..a04f73352 100644
--- a/crates/hir_def/src/data.rs
+++ b/crates/hir_def/src/data.rs
@@ -141,7 +141,6 @@ pub struct TraitData {
141 pub is_auto: bool, 141 pub is_auto: bool,
142 pub is_unsafe: bool, 142 pub is_unsafe: bool,
143 pub visibility: RawVisibility, 143 pub visibility: RawVisibility,
144 pub bounds: Box<[Interned<TypeBound>]>,
145} 144}
146 145
147impl TraitData { 146impl TraitData {
@@ -155,7 +154,6 @@ impl TraitData {
155 let module_id = tr_loc.container; 154 let module_id = tr_loc.container;
156 let container = AssocContainerId::TraitId(tr); 155 let container = AssocContainerId::TraitId(tr);
157 let visibility = item_tree[tr_def.visibility].clone(); 156 let visibility = item_tree[tr_def.visibility].clone();
158 let bounds = tr_def.bounds.clone();
159 let mut expander = Expander::new(db, tr_loc.id.file_id(), module_id); 157 let mut expander = Expander::new(db, tr_loc.id.file_id(), module_id);
160 158
161 let items = collect_items( 159 let items = collect_items(
@@ -168,7 +166,7 @@ impl TraitData {
168 100, 166 100,
169 ); 167 );
170 168
171 Arc::new(TraitData { name, items, is_auto, is_unsafe, visibility, bounds }) 169 Arc::new(TraitData { name, items, is_auto, is_unsafe, visibility })
172 } 170 }
173 171
174 pub fn associated_types(&self) -> impl Iterator<Item = TypeAliasId> + '_ { 172 pub fn associated_types(&self) -> impl Iterator<Item = TypeAliasId> + '_ {
diff --git a/crates/hir_def/src/item_tree.rs b/crates/hir_def/src/item_tree.rs
index f84c4cf2b..c4d20c416 100644
--- a/crates/hir_def/src/item_tree.rs
+++ b/crates/hir_def/src/item_tree.rs
@@ -661,7 +661,6 @@ pub struct Trait {
661 pub generic_params: Interned<GenericParams>, 661 pub generic_params: Interned<GenericParams>,
662 pub is_auto: bool, 662 pub is_auto: bool,
663 pub is_unsafe: bool, 663 pub is_unsafe: bool,
664 pub bounds: Box<[Interned<TypeBound>]>,
665 pub items: Box<[AssocItem]>, 664 pub items: Box<[AssocItem]>,
666 pub ast_id: FileAstId<ast::Trait>, 665 pub ast_id: FileAstId<ast::Trait>,
667} 666}
diff --git a/crates/hir_def/src/item_tree/lower.rs b/crates/hir_def/src/item_tree/lower.rs
index 40f3428b7..b83adec46 100644
--- a/crates/hir_def/src/item_tree/lower.rs
+++ b/crates/hir_def/src/item_tree/lower.rs
@@ -474,7 +474,6 @@ impl<'a> Ctx<'a> {
474 self.lower_generic_params_and_inner_items(GenericsOwner::Trait(trait_def), trait_def); 474 self.lower_generic_params_and_inner_items(GenericsOwner::Trait(trait_def), trait_def);
475 let is_auto = trait_def.auto_token().is_some(); 475 let is_auto = trait_def.auto_token().is_some();
476 let is_unsafe = trait_def.unsafe_token().is_some(); 476 let is_unsafe = trait_def.unsafe_token().is_some();
477 let bounds = self.lower_type_bounds(trait_def);
478 let items = trait_def.assoc_item_list().map(|list| { 477 let items = trait_def.assoc_item_list().map(|list| {
479 let db = self.db; 478 let db = self.db;
480 self.with_inherited_visibility(visibility, |this| { 479 self.with_inherited_visibility(visibility, |this| {
@@ -497,7 +496,6 @@ impl<'a> Ctx<'a> {
497 generic_params, 496 generic_params,
498 is_auto, 497 is_auto,
499 is_unsafe, 498 is_unsafe,
500 bounds: bounds.into(),
501 items: items.unwrap_or_default(), 499 items: items.unwrap_or_default(),
502 ast_id, 500 ast_id,
503 }; 501 };
diff --git a/crates/hir_def/src/item_tree/pretty.rs b/crates/hir_def/src/item_tree/pretty.rs
index 53631ab19..d1ee697cb 100644
--- a/crates/hir_def/src/item_tree/pretty.rs
+++ b/crates/hir_def/src/item_tree/pretty.rs
@@ -345,7 +345,6 @@ impl<'a> Printer<'a> {
345 visibility, 345 visibility,
346 is_auto, 346 is_auto,
347 is_unsafe, 347 is_unsafe,
348 bounds,
349 items, 348 items,
350 generic_params, 349 generic_params,
351 ast_id: _, 350 ast_id: _,
@@ -359,10 +358,6 @@ impl<'a> Printer<'a> {
359 } 358 }
360 w!(self, "trait {}", name); 359 w!(self, "trait {}", name);
361 self.print_generic_params(generic_params); 360 self.print_generic_params(generic_params);
362 if !bounds.is_empty() {
363 w!(self, ": ");
364 self.print_type_bounds(bounds);
365 }
366 self.print_where_clause_and_opening_brace(generic_params); 361 self.print_where_clause_and_opening_brace(generic_params);
367 self.indented(|this| { 362 self.indented(|this| {
368 for item in &**items { 363 for item in &**items {
diff --git a/crates/hir_def/src/item_tree/tests.rs b/crates/hir_def/src/item_tree/tests.rs
index 20773aa69..b362add5c 100644
--- a/crates/hir_def/src/item_tree/tests.rs
+++ b/crates/hir_def/src/item_tree/tests.rs
@@ -180,7 +180,7 @@ trait Tr: SuperTrait + 'lifetime {
180 _: (), 180 _: (),
181 ) -> (); 181 ) -> ();
182 182
183 pub(self) trait Tr<Self>: SuperTrait + 'lifetime 183 pub(self) trait Tr<Self>
184 where 184 where
185 Self: SuperTrait, 185 Self: SuperTrait,
186 Self: 'lifetime 186 Self: 'lifetime
@@ -350,7 +350,7 @@ trait Tr<'a, T: 'a>: Super {}
350 pub(self) union Union<'a, T, const U: u8> { 350 pub(self) union Union<'a, T, const U: u8> {
351 } 351 }
352 352
353 pub(self) trait Tr<'a, Self, T>: Super 353 pub(self) trait Tr<'a, Self, T>
354 where 354 where
355 Self: Super, 355 Self: Super,
356 T: 'a 356 T: 'a