]> git.lizzy.rs Git - rust.git/commitdiff
fix reoccuring typo: dereferencable -> dereferenceable
authorRalf Jung <post@ralfj.de>
Fri, 22 Nov 2019 17:11:28 +0000 (18:11 +0100)
committerRalf Jung <post@ralfj.de>
Fri, 22 Nov 2019 17:11:28 +0000 (18:11 +0100)
src/librustc/mir/tcx.rs
src/librustc_mir/interpret/memory.rs
src/librustc_mir/interpret/validity.rs
src/librustc_typeck/check/pat.rs

index ccf7d8fbf8668ed83603befccb698538c4f37630..a66a49f103f68f0d6a4b66747a7b733c1e01f535 100644 (file)
@@ -81,7 +81,7 @@ pub fn projection_ty_core<V, T>(
                 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)
index e929b0855834e98a2e3834ae8f147bf18993eeb6..842ef915ad2267025cfa1a5a6ba945eeadd58f75 100644 (file)
@@ -47,7 +47,7 @@ fn may_leak(self) -> bool {
 #[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 @@ fn check_offset_align(offset: u64, align: Align) -> InterpResult<'static> {
             }
             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 @@ pub fn get_size_and_align(
         // # 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 {
index d698b2e8d8f80d42f1d5fbb468eb824b2cdc7bd0..e358df2f213ba3047a52bc7c5082baf4bd0e623d 100644 (file)
@@ -286,7 +286,7 @@ fn check_wide_ptr_meta(
                     "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 @@ fn visit_primitive(&mut self, value: OpTy<'tcx, M::PointerTag>) -> InterpResult<
                 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,
index bba30ebbbe7bb41eb0e0c65d39e19f213bdc688d..9dd3bc624a51afc14cb320ab95144f4cc1fc26d4 100644 (file)
@@ -538,7 +538,7 @@ fn borrow_pat_suggestion(
         }
     }
 
-    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 @@ fn check_pat_box(
         discrim_span: Option<Span>,
     ) -> 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 @@ fn check_pat_ref(
     ) -> 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.