1
Fork 0

Improve comments

This commit is contained in:
Nilstrieb 2022-12-30 21:11:17 +01:00 committed by nils
parent 645c0fddd2
commit af23ad93cd
2 changed files with 1 additions and 7 deletions

View file

@ -219,7 +219,6 @@ fn adjust_for_rust_scalar<'tcx>(
return;
}
// Scalars which have invalid values cannot be undef.
if !scalar.is_uninit_valid() {
attrs.set(ArgAttribute::NoUndef);
}
@ -246,11 +245,6 @@ fn adjust_for_rust_scalar<'tcx>(
PointerKind::SharedMutable | PointerKind::UniqueOwned => Size::ZERO,
};
// `Box`, `&T`, and `&mut T` cannot be undef.
// Note that this only applies to the value of the pointer itself;
// this attribute doesn't make it UB for the pointed-to data to be undef.
attrs.set(ArgAttribute::NoUndef);
// The aliasing rules for `Box<T>` are still not decided, but currently we emit
// `noalias` for it. This can be turned off using an unstable flag.
// See https://github.com/rust-lang/unsafe-code-guidelines/issues/326