Skip to content

Commit 39feaa6

Browse files
Apply suggested wording changes from code review.
Co-authored-by: Teymour Aldridge <[email protected]>
1 parent 0e61890 commit 39feaa6

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/librustc_lint/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2201,7 +2201,7 @@ impl ClashingExternDeclarations {
22012201

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

src/librustc_lint/types.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -559,8 +559,8 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
559559

560560
/// Check if this enum can be safely exported based on the "nullable pointer optimization".
561561
/// Currently restricted to function pointers, references, `core::num::NonZero*`,
562-
/// `core::ptr::NonNull`, and `#[repr(transparent)]` newtypes. If it is, return the known
563-
/// non-null field type, else None.
562+
/// `core::ptr::NonNull`, and `#[repr(transparent)]` newtypes. If it can, return the known
563+
/// non-null field type, otherwise return `None`.
564564
crate fn is_repr_nullable_ptr(
565565
&self,
566566
ty: Ty<'tcx>,

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

+4-4
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)