diff options
| author | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2022-12-30 21:11:17 +0100 |
|---|---|---|
| committer | nils <48135649+Nilstrieb@users.noreply.github.com> | 2023-01-17 08:14:35 +0100 |
| commit | af23ad93cd3309e90ccb2c49b7a7b2ac913e0d06 (patch) | |
| tree | 4061af827e64c9f2369b594f6cadb9691f9f0db5 /compiler/rustc_ty_utils/src/abi.rs | |
| parent | 645c0fddd2e0446cc0e6eecd8a78de4b5ab5a967 (diff) | |
| download | rust-af23ad93cd3309e90ccb2c49b7a7b2ac913e0d06.tar.gz rust-af23ad93cd3309e90ccb2c49b7a7b2ac913e0d06.zip | |
Improve comments
Diffstat (limited to 'compiler/rustc_ty_utils/src/abi.rs')
| -rw-r--r-- | compiler/rustc_ty_utils/src/abi.rs | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/compiler/rustc_ty_utils/src/abi.rs b/compiler/rustc_ty_utils/src/abi.rs index ce50b6fb43f..669f84ae1b4 100644 --- a/compiler/rustc_ty_utils/src/abi.rs +++ b/compiler/rustc_ty_utils/src/abi.rs @@ -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 |
