diff --git a/c2rust-analyze/src/borrowck/type_check.rs b/c2rust-analyze/src/borrowck/type_check.rs index 37425bf68..ce3086a37 100644 --- a/c2rust-analyze/src/borrowck/type_check.rs +++ b/c2rust-analyze/src/borrowck/type_check.rs @@ -603,7 +603,9 @@ impl<'tcx> TypeChecker<'tcx, '_> { }); } Callee::Null { .. } => { - // TODO: do we need to do anything here? + // Just visit the place. The null pointer returned here has no origin, so + // there's no need to call `do_assign` to set up subset relations. + let _pl_lty = self.visit_place(destination); } } } diff --git a/c2rust-analyze/src/util.rs b/c2rust-analyze/src/util.rs index 71b39887c..7f34dcf5e 100644 --- a/c2rust-analyze/src/util.rs +++ b/c2rust-analyze/src/util.rs @@ -346,7 +346,7 @@ fn builtin_callee<'tcx>(tcx: TyCtxt<'tcx>, did: DefId, substs: SubstsRef<'tcx>) } "null" | "null_mut" => { - // The `core::mem::size_of` function. + // The `core::ptr::null/null_mut` function. let parent_did = tcx.parent(did); if tcx.def_kind(parent_did) != DefKind::Mod { return None;