diff --git a/src/librustc/mir/tcx.rs b/src/librustc/mir/tcx.rs index ccf7d8fbf8668..a66a49f103f68 100644 --- a/src/librustc/mir/tcx.rs +++ b/src/librustc/mir/tcx.rs @@ -81,7 +81,7 @@ impl<'tcx> PlaceTy<'tcx> { let ty = self.ty .builtin_deref(true) .unwrap_or_else(|| { - bug!("deref projection of non-dereferencable ty {:?}", self) + bug!("deref projection of non-dereferenceable ty {:?}", self) }) .ty; PlaceTy::from_ty(ty) diff --git a/src/librustc_mir/interpret/memory.rs b/src/librustc_mir/interpret/memory.rs index e929b0855834e..842ef915ad226 100644 --- a/src/librustc_mir/interpret/memory.rs +++ b/src/librustc_mir/interpret/memory.rs @@ -47,7 +47,7 @@ impl MayLeak for MemoryKind { #[derive(Debug, Copy, Clone)] pub enum AllocCheck { /// Allocation must be live and not a function pointer. - Dereferencable, + Dereferenceable, /// Allocations needs to be live, but may be a function pointer. Live, /// Allocation may be dead. @@ -365,7 +365,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> { } Err(ptr) => { let (allocation_size, alloc_align) = - self.get_size_and_align(ptr.alloc_id, AllocCheck::Dereferencable)?; + self.get_size_and_align(ptr.alloc_id, AllocCheck::Dereferenceable)?; // Test bounds. This also ensures non-NULL. // It is sufficient to check this for the end pointer. The addition // checks for overflow. @@ -569,7 +569,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> { // # Function pointers // (both global from `alloc_map` and local from `extra_fn_ptr_map`) if let Ok(_) = self.get_fn_alloc(id) { - return if let AllocCheck::Dereferencable = liveness { + return if let AllocCheck::Dereferenceable = liveness { // The caller requested no function pointers. throw_unsup!(DerefFunctionPointer) } else { diff --git a/src/librustc_mir/interpret/validity.rs b/src/librustc_mir/interpret/validity.rs index d698b2e8d8f80..e358df2f213ba 100644 --- a/src/librustc_mir/interpret/validity.rs +++ b/src/librustc_mir/interpret/validity.rs @@ -286,7 +286,7 @@ impl<'rt, 'mir, 'tcx, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, 'tcx, M "non-integer slice length in wide pointer", self.path); // We do not check that `len * elem_size <= isize::MAX`: // that is only required for references, and there it falls out of the - // "dereferencable" check performed by Stacked Borrows. + // "dereferenceable" check performed by Stacked Borrows. } ty::Foreign(..) => { // Unsized, but not wide. @@ -404,7 +404,7 @@ impl<'rt, 'mir, 'tcx, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M> if place.layout.is_unsized() { self.check_wide_ptr_meta(place.meta, place.layout)?; } - // Make sure this is dereferencable and all. + // Make sure this is dereferenceable and all. let (size, align) = self.ecx.size_and_align_of(place.meta, place.layout)? // for the purpose of validity, consider foreign types to have // alignment and size determined by the layout (size will be 0, diff --git a/src/librustc_typeck/check/pat.rs b/src/librustc_typeck/check/pat.rs index bba30ebbbe7bb..9dd3bc624a51a 100644 --- a/src/librustc_typeck/check/pat.rs +++ b/src/librustc_typeck/check/pat.rs @@ -538,7 +538,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } } - pub fn check_dereferencable(&self, span: Span, expected: Ty<'tcx>, inner: &Pat) -> bool { + pub fn check_dereferenceable(&self, span: Span, expected: Ty<'tcx>, inner: &Pat) -> bool { if let PatKind::Binding(..) = inner.kind { if let Some(mt) = self.shallow_resolve(expected).builtin_deref(true) { if let ty::Dynamic(..) = mt.ty.kind { @@ -1075,7 +1075,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { discrim_span: Option, ) -> Ty<'tcx> { let tcx = self.tcx; - let (box_ty, inner_ty) = if self.check_dereferencable(span, expected, &inner) { + let (box_ty, inner_ty) = if self.check_dereferenceable(span, expected, &inner) { // Here, `demand::subtype` is good enough, but I don't // think any errors can be introduced by using `demand::eqtype`. let inner_ty = self.next_ty_var(TypeVariableOrigin { @@ -1103,7 +1103,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { ) -> Ty<'tcx> { let tcx = self.tcx; let expected = self.shallow_resolve(expected); - let (rptr_ty, inner_ty) = if self.check_dereferencable(pat.span, expected, &inner) { + let (rptr_ty, inner_ty) = if self.check_dereferenceable(pat.span, expected, &inner) { // `demand::subtype` would be good enough, but using `eqtype` turns // out to be equally general. See (note_1) for details.