Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 5e52edc

Browse files
Apply suggested wording changes from code review.
Co-authored-by: Teymour Aldridge <[email protected]>
1 parent 3eaead7 commit 5e52edc

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/librustc_lint/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2215,7 +2215,7 @@ impl ClashingExternDeclarations {
22152215

22162216
// Disjoint kinds.
22172217
(_, _) => {
2218-
// First, check if the conversion is FFI-safe. This can be so if the type is an
2218+
// First, check if the conversion is FFI-safe. This can happen if the type is an
22192219
// enum with a non-null field (see improper_ctypes).
22202220
let is_primitive_or_pointer =
22212221
|ty: Ty<'tcx>| ty.is_primitive() || matches!(ty.kind, RawPtr(..));

src/librustc_lint/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
563563
}
564564

565565
/// Check if this enum can be safely exported based on the "nullable pointer optimization". If
566-
/// the type is it is, return the known non-null field type, else None. Currently restricted
566+
/// it can, return the known non-null field type, otherwise return `None`. Currently restricted
567567
/// to function pointers, boxes, references, `core::num::NonZero*`, `core::ptr::NonNull`, and
568568
/// `#[repr(transparent)]` newtypes.
569569
crate fn is_repr_nullable_ptr(

src/test/ui/lint/clashing-extern-fn.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ mod missing_return_type {
202202

203203
mod b {
204204
extern "C" {
205-
// This should warn, because we can't assume that the first declaration is the correct
206-
// one -- if this one is the correct one, then calling the usize-returning version
207-
// would allow reads into uninitialised memory.
205+
// This should output a warning because we can't assume that the first declaration is
206+
// the correct one -- if this one is the correct one, then calling the usize-returning
207+
// version would allow reads into uninitialised memory.
208208
fn missing_return_type();
209209
//~^ WARN `missing_return_type` redeclared with a different signature
210210
}
@@ -220,7 +220,7 @@ mod non_zero_and_non_null {
220220
}
221221
mod b {
222222
extern "C" {
223-
// For both of these cases, if there's a clash, you're either gaining an incorrect
223+
// If there's a clash in either of these cases you're either gaining an incorrect
224224
// invariant that the value is non-zero, or you're missing out on that invariant. Both
225225
// cases are warning for, from both a caller-convenience and optimisation perspective.
226226
fn non_zero_usize() -> usize;

0 commit comments

Comments
 (0)