From 5e52edca529ba5051d0bb752c751159d3057ab15 Mon Sep 17 00:00:00 2001 From: jumbatm Date: Sat, 4 Jul 2020 12:07:43 +1000 Subject: [PATCH] Apply suggested wording changes from code review. Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com> --- src/librustc_lint/builtin.rs | 2 +- src/librustc_lint/types.rs | 2 +- src/test/ui/lint/clashing-extern-fn.rs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index 47d1c7ba6f1f..7b4c1a3f4bdc 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -2215,7 +2215,7 @@ impl ClashingExternDeclarations { // 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 3d1080bea4c9..a147e05e10da 100644 --- a/src/librustc_lint/types.rs +++ b/src/librustc_lint/types.rs @@ -563,7 +563,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> { } /// 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 72c5d3da4b00..44c2067edc03 100644 --- a/src/test/ui/lint/clashing-extern-fn.rs +++ b/src/test/ui/lint/clashing-extern-fn.rs @@ -202,9 +202,9 @@ mod missing_return_type { 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 non_zero_and_non_null { } 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;