summaryrefslogtreecommitdiffstats
path: root/src/librustc_mir/borrow_check/mod.rs
diff options
context:
space:
mode:
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2018-05-02 15:21:05 +0200
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2018-05-08 16:21:58 +0200
commitc9d9c249ec95afa53a1862fcb99bf04c339b126c (patch)
tree2aec350a3f6269393099b1e8aa457157da1392f1 /src/librustc_mir/borrow_check/mod.rs
parentStore the GeneratorInterior in the new GeneratorSubsts (diff)
downloadgrust-c9d9c249ec95afa53a1862fcb99bf04c339b126c.tar.gz
grust-c9d9c249ec95afa53a1862fcb99bf04c339b126c.tar.bz2
grust-c9d9c249ec95afa53a1862fcb99bf04c339b126c.tar.xz
Insert fields from TypeAndMut into TyRef to allow layout optimization
Diffstat (limited to 'src/librustc_mir/borrow_check/mod.rs')
-rw-r--r--src/librustc_mir/borrow_check/mod.rs12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/librustc_mir/borrow_check/mod.rs b/src/librustc_mir/borrow_check/mod.rs
index 953238a721..1cc69351b4 100644
--- a/src/librustc_mir/borrow_check/mod.rs
+++ b/src/librustc_mir/borrow_check/mod.rs
@@ -1913,8 +1913,8 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
1913 1913
1914 // Check the kind of deref to decide 1914 // Check the kind of deref to decide
1915 match base_ty.sty { 1915 match base_ty.sty {
1916 ty::TyRef(_, tnm) => { 1916 ty::TyRef(_, _, mutbl) => {
1917 match tnm.mutbl { 1917 match mutbl {
1918 // Shared borrowed data is never mutable 1918 // Shared borrowed data is never mutable
1919 hir::MutImmutable => Err(place), 1919 hir::MutImmutable => Err(place),
1920 // Mutably borrowed data is mutable, but only if we have a 1920 // Mutably borrowed data is mutable, but only if we have a
@@ -2348,13 +2348,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
2348 } 2348 }
2349 ( 2349 (
2350 ProjectionElem::Deref, 2350 ProjectionElem::Deref,
2351 ty::TyRef( 2351 ty::TyRef( _, _, hir::MutImmutable),
2352 _,
2353 ty::TypeAndMut {
2354 ty: _,
2355 mutbl: hir::MutImmutable,
2356 },
2357 ),
2358 _, 2352 _,
2359 ) => { 2353 ) => {
2360 // the borrow goes through a dereference of a shared reference. 2354 // the borrow goes through a dereference of a shared reference.