diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-04 19:29:53 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-04 19:29:53 +0100 |
commit | 35614c762378f472ebefa12434b7e54a38a94eb9 (patch) | |
tree | 7230e16cd37c447be8576876789f7049d2b70495 /crates/hir_ty/src/infer/expr.rs | |
parent | 0924888cce5f48e0ea0dc7fd8641db92850ef660 (diff) | |
parent | 645a9c3a274109512839b79d8e86a805a39cd6e1 (diff) |
Merge #8328
8328: Move things in hir_ty into submodules r=flodiebold a=flodiebold
- all the types that will be replaced by Chalk go to `types`
- `TypeWalk` impls go to `walk`
- also fix signature of `Substitution::interned`
Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/infer/expr.rs')
-rw-r--r-- | crates/hir_ty/src/infer/expr.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/crates/hir_ty/src/infer/expr.rs b/crates/hir_ty/src/infer/expr.rs index c584a2c08..ccaae53e9 100644 --- a/crates/hir_ty/src/infer/expr.rs +++ b/crates/hir_ty/src/infer/expr.rs | |||
@@ -20,10 +20,10 @@ use crate::{ | |||
20 | method_resolution, op, | 20 | method_resolution, op, |
21 | primitive::{self, UintTy}, | 21 | primitive::{self, UintTy}, |
22 | to_chalk_trait_id, | 22 | to_chalk_trait_id, |
23 | traits::{chalk::from_chalk, FnTrait, InEnvironment}, | 23 | traits::{chalk::from_chalk, FnTrait}, |
24 | utils::{generics, variant_data, Generics}, | 24 | utils::{generics, variant_data, Generics}, |
25 | AdtId, Binders, CallableDefId, FnPointer, FnSig, Interner, Rawness, Scalar, Substitution, | 25 | AdtId, Binders, CallableDefId, FnPointer, FnSig, InEnvironment, Interner, Rawness, Scalar, |
26 | TraitRef, Ty, TyBuilder, TyKind, | 26 | Substitution, TraitRef, Ty, TyBuilder, TyKind, |
27 | }; | 27 | }; |
28 | 28 | ||
29 | use super::{ | 29 | use super::{ |
@@ -452,11 +452,7 @@ impl<'a> InferenceContext<'a> { | |||
452 | }; | 452 | }; |
453 | match canonicalized.decanonicalize_ty(derefed_ty.value).kind(&Interner) { | 453 | match canonicalized.decanonicalize_ty(derefed_ty.value).kind(&Interner) { |
454 | TyKind::Tuple(_, substs) => name.as_tuple_index().and_then(|idx| { | 454 | TyKind::Tuple(_, substs) => name.as_tuple_index().and_then(|idx| { |
455 | substs | 455 | substs.interned().get(idx).map(|a| a.assert_ty_ref(&Interner)).cloned() |
456 | .interned(&Interner) | ||
457 | .get(idx) | ||
458 | .map(|a| a.assert_ty_ref(&Interner)) | ||
459 | .cloned() | ||
460 | }), | 456 | }), |
461 | TyKind::Adt(AdtId(hir_def::AdtId::StructId(s)), parameters) => { | 457 | TyKind::Adt(AdtId(hir_def::AdtId::StructId(s)), parameters) => { |
462 | let local_id = self.db.struct_data(*s).variant_data.field(name)?; | 458 | let local_id = self.db.struct_data(*s).variant_data.field(name)?; |