diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index 47d1c7ba6f1..7b4c1a3f4bd 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -2215,7 +2215,7 @@ fn structurally_same_type<'tcx>(cx: &LateContext<'tcx>, a: Ty<'tcx>, b: Ty<'tcx> // Disjoint kinds. (_, _) => { - // First, check if the conversion is FFI-safe. This can be so if the type is an + // First, check if the conversion is FFI-safe. This can happen if the type is an // enum with a non-null field (see improper_ctypes). let is_primitive_or_pointer = |ty: Ty<'tcx>| ty.is_primitive() || matches!(ty.kind, RawPtr(..)); diff --git a/src/librustc_lint/types.rs b/src/librustc_lint/types.rs index 3d1080bea4c..a147e05e10d 100644 --- a/src/librustc_lint/types.rs +++ b/src/librustc_lint/types.rs @@ -563,7 +563,7 @@ fn ty_is_known_nonnull(&self, ty: Ty<'tcx>) -> bool { } /// Check if this enum can be safely exported based on the "nullable pointer optimization". If - /// the type is it is, return the known non-null field type, else None. Currently restricted + /// it can, return the known non-null field type, otherwise return `None`. Currently restricted /// to function pointers, boxes, references, `core::num::NonZero*`, `core::ptr::NonNull`, and /// `#[repr(transparent)]` newtypes. crate fn is_repr_nullable_ptr( diff --git a/src/test/ui/lint/clashing-extern-fn.rs b/src/test/ui/lint/clashing-extern-fn.rs index 72c5d3da4b0..44c2067edc0 100644 --- a/src/test/ui/lint/clashing-extern-fn.rs +++ b/src/test/ui/lint/clashing-extern-fn.rs @@ -202,9 +202,9 @@ mod a { mod b { extern "C" { - // This should warn, because we can't assume that the first declaration is the correct - // one -- if this one is the correct one, then calling the usize-returning version - // would allow reads into uninitialised memory. + // This should output a warning because we can't assume that the first declaration is + // the correct one -- if this one is the correct one, then calling the usize-returning + // version would allow reads into uninitialised memory. fn missing_return_type(); //~^ WARN `missing_return_type` redeclared with a different signature } @@ -220,7 +220,7 @@ mod a { } mod b { extern "C" { - // For both of these cases, if there's a clash, you're either gaining an incorrect + // If there's a clash in either of these cases you're either gaining an incorrect // invariant that the value is non-zero, or you're missing out on that invariant. Both // cases are warning for, from both a caller-convenience and optimisation perspective. fn non_zero_usize() -> usize;