Skip to content

Commit fd3bd29

Browse files
authored
Rollup merge of #66637 - RalfJung:typo, r=Centril
fix reoccuring typo: dereferencable -> dereferenceable
2 parents 8be9e90 + 9ff91ab commit fd3bd29

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/librustc/mir/tcx.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl<'tcx> PlaceTy<'tcx> {
8181
let ty = self.ty
8282
.builtin_deref(true)
8383
.unwrap_or_else(|| {
84-
bug!("deref projection of non-dereferencable ty {:?}", self)
84+
bug!("deref projection of non-dereferenceable ty {:?}", self)
8585
})
8686
.ty;
8787
PlaceTy::from_ty(ty)

src/librustc_mir/interpret/memory.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl<T: MayLeak> MayLeak for MemoryKind<T> {
4747
#[derive(Debug, Copy, Clone)]
4848
pub enum AllocCheck {
4949
/// Allocation must be live and not a function pointer.
50-
Dereferencable,
50+
Dereferenceable,
5151
/// Allocations needs to be live, but may be a function pointer.
5252
Live,
5353
/// Allocation may be dead.
@@ -365,7 +365,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
365365
}
366366
Err(ptr) => {
367367
let (allocation_size, alloc_align) =
368-
self.get_size_and_align(ptr.alloc_id, AllocCheck::Dereferencable)?;
368+
self.get_size_and_align(ptr.alloc_id, AllocCheck::Dereferenceable)?;
369369
// Test bounds. This also ensures non-NULL.
370370
// It is sufficient to check this for the end pointer. The addition
371371
// checks for overflow.
@@ -569,7 +569,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
569569
// # Function pointers
570570
// (both global from `alloc_map` and local from `extra_fn_ptr_map`)
571571
if let Ok(_) = self.get_fn_alloc(id) {
572-
return if let AllocCheck::Dereferencable = liveness {
572+
return if let AllocCheck::Dereferenceable = liveness {
573573
// The caller requested no function pointers.
574574
throw_unsup!(DerefFunctionPointer)
575575
} else {

src/librustc_mir/interpret/validity.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ impl<'rt, 'mir, 'tcx, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, 'tcx, M
286286
"non-integer slice length in wide pointer", self.path);
287287
// We do not check that `len * elem_size <= isize::MAX`:
288288
// that is only required for references, and there it falls out of the
289-
// "dereferencable" check performed by Stacked Borrows.
289+
// "dereferenceable" check performed by Stacked Borrows.
290290
}
291291
ty::Foreign(..) => {
292292
// Unsized, but not wide.
@@ -404,7 +404,7 @@ impl<'rt, 'mir, 'tcx, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M>
404404
if place.layout.is_unsized() {
405405
self.check_wide_ptr_meta(place.meta, place.layout)?;
406406
}
407-
// Make sure this is dereferencable and all.
407+
// Make sure this is dereferenceable and all.
408408
let (size, align) = self.ecx.size_and_align_of(place.meta, place.layout)?
409409
// for the purpose of validity, consider foreign types to have
410410
// alignment and size determined by the layout (size will be 0,

src/librustc_typeck/check/pat.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
538538
}
539539
}
540540

541-
pub fn check_dereferencable(&self, span: Span, expected: Ty<'tcx>, inner: &Pat) -> bool {
541+
pub fn check_dereferenceable(&self, span: Span, expected: Ty<'tcx>, inner: &Pat) -> bool {
542542
if let PatKind::Binding(..) = inner.kind {
543543
if let Some(mt) = self.shallow_resolve(expected).builtin_deref(true) {
544544
if let ty::Dynamic(..) = mt.ty.kind {
@@ -1075,7 +1075,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10751075
discrim_span: Option<Span>,
10761076
) -> Ty<'tcx> {
10771077
let tcx = self.tcx;
1078-
let (box_ty, inner_ty) = if self.check_dereferencable(span, expected, &inner) {
1078+
let (box_ty, inner_ty) = if self.check_dereferenceable(span, expected, &inner) {
10791079
// Here, `demand::subtype` is good enough, but I don't
10801080
// think any errors can be introduced by using `demand::eqtype`.
10811081
let inner_ty = self.next_ty_var(TypeVariableOrigin {
@@ -1103,7 +1103,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
11031103
) -> Ty<'tcx> {
11041104
let tcx = self.tcx;
11051105
let expected = self.shallow_resolve(expected);
1106-
let (rptr_ty, inner_ty) = if self.check_dereferencable(pat.span, expected, &inner) {
1106+
let (rptr_ty, inner_ty) = if self.check_dereferenceable(pat.span, expected, &inner) {
11071107
// `demand::subtype` would be good enough, but using `eqtype` turns
11081108
// out to be equally general. See (note_1) for details.
11091109

0 commit comments

Comments
 (0)