mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Remove Ty::substs{_mut}
Almost all uses actually only care about ADT substs, so it's better to be explicit. The methods were a bad abstraction anyway since they already didn't include the inner types of e.g. `TyKind::Ref` anymore.
This commit is contained in:
parent
8e900cb4a1
commit
92dcc53f94
6 changed files with 45 additions and 52 deletions
|
@ -412,7 +412,10 @@ impl<'a> InferenceContext<'a> {
|
|||
|
||||
self.unify(&ty, &expected.ty);
|
||||
|
||||
let substs = ty.substs().cloned().unwrap_or_else(|| Substitution::empty(&Interner));
|
||||
let substs = ty
|
||||
.as_adt()
|
||||
.map(|(_, s)| s.clone())
|
||||
.unwrap_or_else(|| Substitution::empty(&Interner));
|
||||
let field_types = def_id.map(|it| self.db.field_types(it)).unwrap_or_default();
|
||||
let variant_data = def_id.map(|it| it.variant_data(self.db.upcast()));
|
||||
for field in fields.iter() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue