Apply suggested wording changes from code review.
Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com>
This commit is contained in:
parent
3eaead7d51
commit
5e52edca52
@ -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(..));
|
||||
|
@ -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(
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user