diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-12-16 17:28:40 +0100 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-12-20 22:22:44 +0100 |
| commit | a7aec3f207fb40f0c4c857fb91a03372ac8bcd69 (patch) | |
| tree | e38449760063595a6d65b15f5beadbf8d76094d4 /src/librustc | |
| parent | 01a46509a4c2dc430ebebf940a26232fdaeeba81 (diff) | |
| download | rust-a7aec3f207fb40f0c4c857fb91a03372ac8bcd69.tar.gz rust-a7aec3f207fb40f0c4c857fb91a03372ac8bcd69.zip | |
1. ast::Mutability::{Mutable -> Mut, Immutable -> Not}.
2. mir::Mutability -> ast::Mutability.
Diffstat (limited to 'src/librustc')
| -rw-r--r-- | src/librustc/hir/lowering.rs | 12 | ||||
| -rw-r--r-- | src/librustc/hir/lowering/expr.rs | 2 | ||||
| -rw-r--r-- | src/librustc/hir/pat_util.rs | 5 | ||||
| -rw-r--r-- | src/librustc/hir/print.rs | 12 | ||||
| -rw-r--r-- | src/librustc/lint/internal.rs | 2 | ||||
| -rw-r--r-- | src/librustc/mir/interpret/allocation.rs | 4 | ||||
| -rw-r--r-- | src/librustc/mir/mod.rs | 19 | ||||
| -rw-r--r-- | src/librustc/mir/tcx.rs | 8 | ||||
| -rw-r--r-- | src/librustc/traits/error_reporting.rs | 6 | ||||
| -rw-r--r-- | src/librustc/traits/select.rs | 4 | ||||
| -rw-r--r-- | src/librustc/ty/adjustment.rs | 12 | ||||
| -rw-r--r-- | src/librustc/ty/binding.rs | 8 | ||||
| -rw-r--r-- | src/librustc/ty/context.rs | 8 | ||||
| -rw-r--r-- | src/librustc/ty/error.rs | 4 | ||||
| -rw-r--r-- | src/librustc/ty/layout.rs | 4 | ||||
| -rw-r--r-- | src/librustc/ty/mod.rs | 10 | ||||
| -rw-r--r-- | src/librustc/ty/print/obsolete.rs | 4 | ||||
| -rw-r--r-- | src/librustc/ty/print/pretty.rs | 4 | ||||
| -rw-r--r-- | src/librustc/ty/relate.rs | 4 | ||||
| -rw-r--r-- | src/librustc/ty/sty.rs | 6 | ||||
| -rw-r--r-- | src/librustc/ty/util.rs | 4 |
21 files changed, 63 insertions, 79 deletions
diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index 3f8085f2344..669714c37dd 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -2254,7 +2254,7 @@ impl<'a> LoweringContext<'a> { let is_mutable_pat = match arg.pat.kind { PatKind::Ident(BindingMode::ByValue(mt), _, _) | PatKind::Ident(BindingMode::ByRef(mt), _, _) => - mt == Mutability::Mutable, + mt == Mutability::Mut, _ => false, }; @@ -2265,7 +2265,7 @@ impl<'a> LoweringContext<'a> { // the case where we have a mutable pattern to a reference as that would // no longer be an `ImplicitSelf`. TyKind::Rptr(_, ref mt) if mt.ty.kind.is_implicit_self() && - mt.mutbl == ast::Mutability::Mutable => + mt.mutbl == ast::Mutability::Mut => hir::ImplicitSelfKind::MutRef, TyKind::Rptr(_, ref mt) if mt.ty.kind.is_implicit_self() => hir::ImplicitSelfKind::ImmRef, @@ -3069,10 +3069,10 @@ impl<'a> LoweringContext<'a> { fn lower_binding_mode(&mut self, b: &BindingMode) -> hir::BindingAnnotation { match *b { - BindingMode::ByValue(Mutability::Immutable) => hir::BindingAnnotation::Unannotated, - BindingMode::ByRef(Mutability::Immutable) => hir::BindingAnnotation::Ref, - BindingMode::ByValue(Mutability::Mutable) => hir::BindingAnnotation::Mutable, - BindingMode::ByRef(Mutability::Mutable) => hir::BindingAnnotation::RefMut, + BindingMode::ByValue(Mutability::Not) => hir::BindingAnnotation::Unannotated, + BindingMode::ByRef(Mutability::Not) => hir::BindingAnnotation::Ref, + BindingMode::ByValue(Mutability::Mut) => hir::BindingAnnotation::Mutable, + BindingMode::ByRef(Mutability::Mut) => hir::BindingAnnotation::RefMut, } } diff --git a/src/librustc/hir/lowering/expr.rs b/src/librustc/hir/lowering/expr.rs index f8465baeb13..446fa6ffdd6 100644 --- a/src/librustc/hir/lowering/expr.rs +++ b/src/librustc/hir/lowering/expr.rs @@ -1341,7 +1341,7 @@ impl LoweringContext<'_> { fn expr_mut_addr_of(&mut self, span: Span, e: P<hir::Expr>) -> hir::Expr { self.expr( span, - hir::ExprKind::AddrOf(hir::BorrowKind::Ref, hir::Mutability::Mutable, e), + hir::ExprKind::AddrOf(hir::BorrowKind::Ref, hir::Mutability::Mut, e), ThinVec::new(), ) } diff --git a/src/librustc/hir/pat_util.rs b/src/librustc/hir/pat_util.rs index 97228c8f240..b59c7438005 100644 --- a/src/librustc/hir/pat_util.rs +++ b/src/librustc/hir/pat_util.rs @@ -169,11 +169,10 @@ impl hir::Pat { self.each_binding(|annotation, _, _, _| { match annotation { hir::BindingAnnotation::Ref => match result { - None | Some(hir::Mutability::Immutable) => - result = Some(hir::Mutability::Immutable), + None | Some(hir::Mutability::Not) => result = Some(hir::Mutability::Not), _ => {} } - hir::BindingAnnotation::RefMut => result = Some(hir::Mutability::Mutable), + hir::BindingAnnotation::RefMut => result = Some(hir::Mutability::Mut), _ => {} } }); diff --git a/src/librustc/hir/print.rs b/src/librustc/hir/print.rs index a069331582e..92ad1c38fa0 100644 --- a/src/librustc/hir/print.rs +++ b/src/librustc/hir/print.rs @@ -386,7 +386,7 @@ impl<'a> State<'a> { } hir::ForeignItemKind::Static(ref t, m) => { self.head(visibility_qualified(&item.vis, "static")); - if m == hir::Mutability::Mutable { + if m == hir::Mutability::Mut { self.word_space("mut"); } self.print_ident(item.ident); @@ -502,7 +502,7 @@ impl<'a> State<'a> { } hir::ItemKind::Static(ref ty, m, expr) => { self.head(visibility_qualified(&item.vis, "static")); - if m == hir::Mutability::Mutable { + if m == hir::Mutability::Mut { self.word_space("mut"); } self.print_ident(item.ident); @@ -1632,11 +1632,11 @@ impl<'a> State<'a> { match binding_mode { hir::BindingAnnotation::Ref => { self.word_nbsp("ref"); - self.print_mutability(hir::Mutability::Immutable, false); + self.print_mutability(hir::Mutability::Not, false); } hir::BindingAnnotation::RefMut => { self.word_nbsp("ref"); - self.print_mutability(hir::Mutability::Mutable, false); + self.print_mutability(hir::Mutability::Mut, false); } hir::BindingAnnotation::Unannotated => {} hir::BindingAnnotation::Mutable => { @@ -2065,8 +2065,8 @@ impl<'a> State<'a> { pub fn print_mutability(&mut self, mutbl: hir::Mutability, print_const: bool) { match mutbl { - hir::Mutability::Mutable => self.word_nbsp("mut"), - hir::Mutability::Immutable => if print_const { self.word_nbsp("const") }, + hir::Mutability::Mut => self.word_nbsp("mut"), + hir::Mutability::Not => if print_const { self.word_nbsp("const") }, } } diff --git a/src/librustc/lint/internal.rs b/src/librustc/lint/internal.rs index 10c0c63995c..f80a72365e3 100644 --- a/src/librustc/lint/internal.rs +++ b/src/librustc/lint/internal.rs @@ -132,7 +132,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TyTyKind { } } } - TyKind::Rptr(_, MutTy { ty: inner_ty, mutbl: Mutability::Immutable }) => { + TyKind::Rptr(_, MutTy { ty: inner_ty, mutbl: Mutability::Not }) => { if let Some(impl_did) = cx.tcx.impl_of_method(ty.hir_id.owner_def_id()) { if cx.tcx.impl_trait_ref(impl_did).is_some() { return; diff --git a/src/librustc/mir/interpret/allocation.rs b/src/librustc/mir/interpret/allocation.rs index f849361e08b..a1bb80f6179 100644 --- a/src/librustc/mir/interpret/allocation.rs +++ b/src/librustc/mir/interpret/allocation.rs @@ -106,7 +106,7 @@ impl<Tag> Allocation<Tag> { undef_mask: UndefMask::new(size, true), size, align, - mutability: Mutability::Immutable, + mutability: Mutability::Not, extra: (), } } @@ -123,7 +123,7 @@ impl<Tag> Allocation<Tag> { undef_mask: UndefMask::new(size, false), size, align, - mutability: Mutability::Mutable, + mutability: Mutability::Mut, extra: (), } } diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs index 3b4adbaf78c..0757e02da97 100644 --- a/src/librustc/mir/mod.rs +++ b/src/librustc/mir/mod.rs @@ -34,6 +34,7 @@ use std::ops::Index; use std::slice; use std::{iter, mem, option, u32}; use syntax::ast::Name; +pub use syntax::ast::Mutability; use syntax::symbol::Symbol; use syntax_pos::{Span, DUMMY_SP}; @@ -396,22 +397,7 @@ pub struct SourceInfo { } /////////////////////////////////////////////////////////////////////////// -// Mutability and borrow kinds - -#[derive(Copy, Clone, Debug, PartialEq, Eq, RustcEncodable, RustcDecodable, HashStable)] -pub enum Mutability { - Mut, - Not, -} - -impl From<Mutability> for hir::Mutability { - fn from(m: Mutability) -> Self { - match m { - Mutability::Mut => hir::Mutability::Mutable, - Mutability::Not => hir::Mutability::Immutable, - } - } -} +// Borrow kinds #[derive( Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, RustcEncodable, RustcDecodable, HashStable, @@ -2886,7 +2872,6 @@ pub enum ClosureOutlivesSubject<'tcx> { CloneTypeFoldableAndLiftImpls! { BlockTailInfo, MirPhase, - Mutability, SourceInfo, FakeReadCause, RetagKind, diff --git a/src/librustc/mir/tcx.rs b/src/librustc/mir/tcx.rs index a24b1d863d6..841c0b458d1 100644 --- a/src/librustc/mir/tcx.rs +++ b/src/librustc/mir/tcx.rs @@ -279,17 +279,17 @@ impl<'tcx> BinOp { impl BorrowKind { pub fn to_mutbl_lossy(self) -> hir::Mutability { match self { - BorrowKind::Mut { .. } => hir::Mutability::Mutable, - BorrowKind::Shared => hir::Mutability::Immutable, + BorrowKind::Mut { .. } => hir::Mutability::Mut, + BorrowKind::Shared => hir::Mutability::Not, // We have no type corresponding to a unique imm borrow, so // use `&mut`. It gives all the capabilities of an `&uniq` // and hence is a safe "over approximation". - BorrowKind::Unique => hir::Mutability::Mutable, + BorrowKind::Unique => hir::Mutability::Mut, // We have no type corresponding to a shallow borrow, so use // `&` as an approximation. - BorrowKind::Shallow => hir::Mutability::Immutable, + BorrowKind::Shallow => hir::Mutability::Not, } } } diff --git a/src/librustc/traits/error_reporting.rs b/src/librustc/traits/error_reporting.rs index 4839974d625..735627578a6 100644 --- a/src/librustc/traits/error_reporting.rs +++ b/src/librustc/traits/error_reporting.rs @@ -1548,8 +1548,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { if let ty::Ref(region, t_type, mutability) = trait_ref.skip_binder().self_ty().kind { let trait_type = match mutability { - hir::Mutability::Mutable => self.tcx.mk_imm_ref(region, t_type), - hir::Mutability::Immutable => self.tcx.mk_mut_ref(region, t_type), + hir::Mutability::Mut => self.tcx.mk_imm_ref(region, t_type), + hir::Mutability::Not => self.tcx.mk_mut_ref(region, t_type), }; let new_obligation = self.mk_obligation_for_def_id( @@ -1565,7 +1565,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { let sp = self.tcx.sess.source_map() .span_take_while(span, |c| c.is_whitespace() || *c == '&'); if points_at_arg && - mutability == hir::Mutability::Immutable && + mutability == hir::Mutability::Not && refs_number > 0 { err.span_suggestion( diff --git a/src/librustc/traits/select.rs b/src/librustc/traits/select.rs index 94a77c553e5..f1cd002d19b 100644 --- a/src/librustc/traits/select.rs +++ b/src/librustc/traits/select.rs @@ -2622,7 +2622,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { | ty::Char | ty::RawPtr(..) | ty::Never - | ty::Ref(_, _, hir::Mutability::Immutable) => { + | ty::Ref(_, _, hir::Mutability::Not) => { // Implementations provided in libcore None } @@ -2633,7 +2633,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { | ty::Generator(..) | ty::GeneratorWitness(..) | ty::Foreign(..) - | ty::Ref(_, _, hir::Mutability::Mutable) => None, + | ty::Ref(_, _, hir::Mutability::Mut) => None, ty::Array(element_ty, _) => { // (*) binder moved here diff --git a/src/librustc/ty/adjustment.rs b/src/librustc/ty/adjustment.rs index 342644752b6..0c04ba96365 100644 --- a/src/librustc/ty/adjustment.rs +++ b/src/librustc/ty/adjustment.rs @@ -109,8 +109,8 @@ pub struct OverloadedDeref<'tcx> { impl<'tcx> OverloadedDeref<'tcx> { pub fn method_call(&self, tcx: TyCtxt<'tcx>, source: Ty<'tcx>) -> (DefId, SubstsRef<'tcx>) { let trait_def_id = match self.mutbl { - hir::Mutability::Immutable => tcx.lang_items().deref_trait(), - hir::Mutability::Mutable => tcx.lang_items().deref_mut_trait() + hir::Mutability::Not => tcx.lang_items().deref_trait(), + hir::Mutability::Mut => tcx.lang_items().deref_mut_trait() }; let method_def_id = tcx.associated_items(trait_def_id.unwrap()) .find(|m| m.kind == ty::AssocKind::Method).unwrap().def_id; @@ -138,15 +138,15 @@ pub enum AllowTwoPhase { #[derive(Copy, Clone, PartialEq, Debug, RustcEncodable, RustcDecodable, HashStable)] pub enum AutoBorrowMutability { - Mutable { allow_two_phase_borrow: AllowTwoPhase }, - Immutable, + Mut { allow_two_phase_borrow: AllowTwoPhase }, + Not, } impl From<AutoBorrowMutability> for hir::Mutability { fn from(m: AutoBorrowMutability) -> Self { match m { - AutoBorrowMutability::Mutable { .. } => hir::Mutability::Mutable, - AutoBorrowMutability::Immutable => hir::Mutability::Immutable, + AutoBorrowMutability::Mut { .. } => hir::Mutability::Mut, + AutoBorrowMutability::Not => hir::Mutability::Not, } } } diff --git a/src/librustc/ty/binding.rs b/src/librustc/ty/binding.rs index 491e09dff09..00cff1f1be1 100644 --- a/src/librustc/ty/binding.rs +++ b/src/librustc/ty/binding.rs @@ -13,10 +13,10 @@ CloneTypeFoldableAndLiftImpls! { BindingMode, } impl BindingMode { pub fn convert(ba: BindingAnnotation) -> BindingMode { match ba { - Unannotated => BindingMode::BindByValue(Mutability::Immutable), - Mutable => BindingMode::BindByValue(Mutability::Mutable), - Ref => BindingMode::BindByReference(Mutability::Immutable), - RefMut => BindingMode::BindByReference(Mutability::Mutable), + Unannotated => BindingMode::BindByValue(Mutability::Not), + Mutable => BindingMode::BindByValue(Mutability::Mut), + Ref => BindingMode::BindByReference(Mutability::Not), + RefMut => BindingMode::BindByReference(Mutability::Mut), } } } diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs index 595ea40b2ff..0806e2d7765 100644 --- a/src/librustc/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -2406,22 +2406,22 @@ impl<'tcx> TyCtxt<'tcx> { #[inline] pub fn mk_mut_ref(self, r: Region<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx> { - self.mk_ref(r, TypeAndMut {ty: ty, mutbl: hir::Mutability::Mutable}) + self.mk_ref(r, TypeAndMut {ty: ty, mutbl: hir::Mutability::Mut }) } #[inline] pub fn mk_imm_ref(self, r: Region<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx> { - self.mk_ref(r, TypeAndMut {ty: ty, mutbl: hir::Mutability::Immutable}) + self.mk_ref(r, TypeAndMut {ty: ty, mutbl: hir::Mutability::Not }) } #[inline] pub fn mk_mut_ptr(self, ty: Ty<'tcx>) -> Ty<'tcx> { - self.mk_ptr(TypeAndMut {ty: ty, mutbl: hir::Mutability::Mutable}) + self.mk_ptr(TypeAndMut {ty: ty, mutbl: hir::Mutability::Mut }) } #[inline] pub fn mk_imm_ptr(self, ty: Ty<'tcx>) -> Ty<'tcx> { - self.mk_ptr(TypeAndMut {ty: ty, mutbl: hir::Mutability::Immutable}) + self.mk_ptr(TypeAndMut {ty: ty, mutbl: hir::Mutability::Not }) } #[inline] diff --git a/src/librustc/ty/error.rs b/src/librustc/ty/error.rs index be6d21564a0..0218cb1d6fd 100644 --- a/src/librustc/ty/error.rs +++ b/src/librustc/ty/error.rs @@ -248,7 +248,7 @@ impl<'tcx> ty::TyS<'tcx> { format!("`&{}`", tymut_string).into() } else { // Unknown type name, it's long or has type arguments match mutbl { - hir::Mutability::Mutable => "mutable reference", + hir::Mutability::Mut => "mutable reference", _ => "reference", }.into() } @@ -293,7 +293,7 @@ impl<'tcx> ty::TyS<'tcx> { ty::Slice(_) => "slice".into(), ty::RawPtr(_) => "raw pointer".into(), ty::Ref(.., mutbl) => match mutbl { - hir::Mutability::Mutable => "mutable reference", + hir::Mutability::Mut => "mutable reference", _ => "reference" }.into(), ty::FnDef(..) => "fn item".into(), diff --git a/src/librustc/ty/layout.rs b/src/librustc/ty/layout.rs index c7278dc4fac..a8c44aa507c 100644 --- a/src/librustc/ty/layout.rs +++ b/src/librustc/ty/layout.rs @@ -2221,12 +2221,12 @@ where let tcx = cx.tcx(); let is_freeze = ty.is_freeze(tcx, cx.param_env(), DUMMY_SP); let kind = match mt { - hir::Mutability::Immutable => if is_freeze { + hir::Mutability::Not => if is_freeze { PointerKind::Frozen } else { PointerKind::Shared }, - hir::Mutability::Mutable => { + hir::Mutability::Mut => { // Previously we would only emit noalias annotations for LLVM >= 6 or in // panic=abort mode. That was deemed right, as prior versions had many bugs // in conjunction with unwinding, but later versions didn’t seem to have diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index 15bbfa7860f..62fea7c31a9 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -2657,8 +2657,8 @@ impl<'tcx> TyS<'tcx> { impl BorrowKind { pub fn from_mutbl(m: hir::Mutability) -> BorrowKind { match m { - hir::Mutability::Mutable => MutBorrow, - hir::Mutability::Immutable => ImmBorrow, + hir::Mutability::Mut => MutBorrow, + hir::Mutability::Not => ImmBorrow, } } @@ -2668,13 +2668,13 @@ impl BorrowKind { /// question. pub fn to_mutbl_lossy(self) -> hir::Mutability { match self { - MutBorrow => hir::Mutability::Mutable, - ImmBorrow => hir::Mutability::Immutable, + MutBorrow => hir::Mutability::Mut, + ImmBorrow => hir::Mutability::Not, // We have no type corresponding to a unique imm borrow, so // use `&mut`. It gives all the capabilities of an `&uniq` // and hence is a safe "over approximation". - UniqueImmBorrow => hir::Mutability::Mutable, + UniqueImmBorrow => hir::Mutability::Mut, } } diff --git a/src/librustc/ty/print/obsolete.rs b/src/librustc/ty/print/obsolete.rs index 7eb774849b1..5e146119b51 100644 --- a/src/librustc/ty/print/obsolete.rs +++ b/src/librustc/ty/print/obsolete.rs @@ -59,8 +59,8 @@ impl DefPathBasedNames<'tcx> { ty::RawPtr(ty::TypeAndMut { ty: inner_type, mutbl }) => { output.push('*'); match mutbl { - hir::Mutability::Immutable => output.push_str("const "), - hir::Mutability::Mutable => output.push_str("mut "), + hir::Mutability::Not => output.push_str("const "), + hir::Mutability::Mut => output.push_str("mut "), } self.push_type_name(inner_type, output, debug); diff --git a/src/librustc/ty/print/pretty.rs b/src/librustc/ty/print/pretty.rs index 745f7d0276d..b4f1f9d779a 100644 --- a/src/librustc/ty/print/pretty.rs +++ b/src/librustc/ty/print/pretty.rs @@ -490,8 +490,8 @@ pub trait PrettyPrinter<'tcx>: ty::Float(t) => p!(write("{}", t.name_str())), ty::RawPtr(ref tm) => { p!(write("*{} ", match tm.mutbl { - hir::Mutability::Mutable => "mut", - hir::Mutability::Immutable => "const", + hir::Mutability::Mut => "mut", + hir::Mutability::Not => "const", })); p!(print(tm.ty)) } diff --git a/src/librustc/ty/relate.rs b/src/librustc/ty/relate.rs index efdf40fd6b8..15b14c51c78 100644 --- a/src/librustc/ty/relate.rs +++ b/src/librustc/ty/relate.rs @@ -121,8 +121,8 @@ impl<'tcx> Relate<'tcx> for ty::TypeAndMut<'tcx> { } else { let mutbl = a.mutbl; let variance = match mutbl { - ast::Mutability::Immutable => ty::Covariant, - ast::Mutability::Mutable => ty::Invariant, + ast::Mutability::Not => ty::Covariant, + ast::Mutability::Mut => ty::Invariant, }; let ty = relation.relate_with_variance(variance, &a.ty, &b.ty)?; Ok(ty::TypeAndMut { ty, mutbl }) diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs index 6cb0d1e9946..ea4369c0180 100644 --- a/src/librustc/ty/sty.rs +++ b/src/librustc/ty/sty.rs @@ -1853,8 +1853,8 @@ impl<'tcx> TyS<'tcx> { #[inline] pub fn is_mutable_ptr(&self) -> bool { match self.kind { - RawPtr(TypeAndMut { mutbl: hir::Mutability::Mutable, .. }) | - Ref(_, _, hir::Mutability::Mutable) => true, + RawPtr(TypeAndMut { mutbl: hir::Mutability::Mut, .. }) | + Ref(_, _, hir::Mutability::Mut) => true, _ => false } } @@ -2044,7 +2044,7 @@ impl<'tcx> TyS<'tcx> { Adt(def, _) if def.is_box() => { Some(TypeAndMut { ty: self.boxed_ty(), - mutbl: hir::Mutability::Immutable, + mutbl: hir::Mutability::Not, }) }, Ref(_, ty, mutbl) => Some(TypeAndMut { ty, mutbl }), diff --git a/src/librustc/ty/util.rs b/src/librustc/ty/util.rs index 0b11a9efd81..f054a630e4b 100644 --- a/src/librustc/ty/util.rs +++ b/src/librustc/ty/util.rs @@ -183,7 +183,7 @@ impl<'tcx> ty::ParamEnv<'tcx> { // Now libcore provides that impl. ty::Uint(_) | ty::Int(_) | ty::Bool | ty::Float(_) | ty::Char | ty::RawPtr(..) | ty::Never | - ty::Ref(_, _, hir::Mutability::Immutable) => return Ok(()), + ty::Ref(_, _, hir::Mutability::Not) => return Ok(()), ty::Adt(adt, substs) => (adt, substs), @@ -679,7 +679,7 @@ impl<'tcx> TyCtxt<'tcx> { /// Returns `true` if the node pointed to by `def_id` is a mutable `static` item. pub fn is_mutable_static(&self, def_id: DefId) -> bool { - self.static_mutability(def_id) == Some(hir::Mutability::Mutable) + self.static_mutability(def_id) == Some(hir::Mutability::Mut) } /// Get the type of the pointer to the static that we use in MIR. |
