22//!
33//! Generally, we use `Pointer` to denote memory addresses. However, some operations
44//! have a "size"-like parameter, and they take `Scalar` for the address because
5- //! if the size is 0, then the pointer can also be a (properly aligned, non-NULL )
5+ //! if the size is 0, then the pointer can also be a (properly aligned, non-null )
66//! integer. It is crucial that these operations call `check_align` *before*
77//! short-circuiting the empty case!
88
@@ -105,7 +105,7 @@ pub struct Memory<'mir, 'tcx, M: Machine<'mir, 'tcx>> {
105105 /// Map for "extra" function pointers.
106106 extra_fn_ptr_map : FxHashMap < AllocId , M :: ExtraFnVal > ,
107107
108- /// To be able to compare pointers with NULL , and to check alignment for accesses
108+ /// To be able to compare pointers with null , and to check alignment for accesses
109109 /// to ZSTs (where pointers may dangle), we keep track of the size even for allocations
110110 /// that do not exist any more.
111111 // FIXME: this should not be public, but interning currently needs access to it
@@ -391,7 +391,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
391391 Ok ( bits) => {
392392 let bits = u64:: try_from ( bits) . unwrap ( ) ; // it's ptr-sized
393393 assert ! ( size. bytes( ) == 0 ) ;
394- // Must be non-NULL .
394+ // Must be non-null .
395395 if bits == 0 {
396396 throw_ub ! ( DanglingIntPointer ( 0 , msg) )
397397 }
@@ -404,7 +404,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
404404 Err ( ptr) => {
405405 let ( allocation_size, alloc_align) =
406406 self . get_size_and_align ( ptr. alloc_id , AllocCheck :: Dereferenceable ) ?;
407- // Test bounds. This also ensures non-NULL .
407+ // Test bounds. This also ensures non-null .
408408 // It is sufficient to check this for the end pointer. The addition
409409 // checks for overflow.
410410 let end_ptr = ptr. offset ( size, self ) ?;
@@ -436,7 +436,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
436436 } )
437437 }
438438
439- /// Test if the pointer might be NULL .
439+ /// Test if the pointer might be null .
440440 pub fn ptr_may_be_null ( & self , ptr : Pointer < M :: PointerTag > ) -> bool {
441441 let ( size, _align) = self
442442 . get_size_and_align ( ptr. alloc_id , AllocCheck :: MaybeDead )
0 commit comments