diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2018-05-02 15:21:05 +0200 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2018-05-08 16:21:58 +0200 |
| commit | c9d9c249ec95afa53a1862fcb99bf04c339b126c (patch) | |
| tree | 2aec350a3f6269393099b1e8aa457157da1392f1 /src/librustc/traits | |
| parent | 710b4ad2a5cc8e70b42d6d85ebe4eacc5b65548b (diff) | |
| download | rust-c9d9c249ec95afa53a1862fcb99bf04c339b126c.tar.gz rust-c9d9c249ec95afa53a1862fcb99bf04c339b126c.zip | |
Insert fields from TypeAndMut into TyRef to allow layout optimization
Diffstat (limited to 'src/librustc/traits')
| -rw-r--r-- | src/librustc/traits/error_reporting.rs | 4 | ||||
| -rw-r--r-- | src/librustc/traits/select.rs | 6 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/librustc/traits/error_reporting.rs b/src/librustc/traits/error_reporting.rs index 047d4bb8930..25be4a2ff5c 100644 --- a/src/librustc/traits/error_reporting.rs +++ b/src/librustc/traits/error_reporting.rs @@ -878,9 +878,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { let mut trait_type = trait_ref.self_ty(); for refs_remaining in 0..refs_number { - if let ty::TypeVariants::TyRef(_, ty::TypeAndMut{ ty: t_type, mutbl: _ }) = - trait_type.sty { - + if let ty::TypeVariants::TyRef(_, t_type, _) = trait_type.sty { trait_type = t_type; let substs = self.tcx.mk_substs_trait(trait_type, &[]); diff --git a/src/librustc/traits/select.rs b/src/librustc/traits/select.rs index e73e11075d4..614cb912fb2 100644 --- a/src/librustc/traits/select.rs +++ b/src/librustc/traits/select.rs @@ -2167,14 +2167,14 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> { ty::TyUint(_) | ty::TyInt(_) | ty::TyBool | ty::TyFloat(_) | ty::TyChar | ty::TyRawPtr(..) | ty::TyNever | - ty::TyRef(_, ty::TypeAndMut { ty: _, mutbl: hir::MutImmutable }) => { + ty::TyRef(_, _, hir::MutImmutable) => { // Implementations provided in libcore None } ty::TyDynamic(..) | ty::TyStr | ty::TySlice(..) | ty::TyGenerator(..) | ty::TyGeneratorWitness(..) | ty::TyForeign(..) | - ty::TyRef(_, ty::TypeAndMut { ty: _, mutbl: hir::MutMutable }) => { + ty::TyRef(_, _, hir::MutMutable) => { Never } @@ -2263,7 +2263,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> { } ty::TyRawPtr(ty::TypeAndMut { ty: element_ty, ..}) | - ty::TyRef(_, ty::TypeAndMut { ty: element_ty, ..}) => { + ty::TyRef(_, element_ty, _) => { vec![element_ty] }, |
