mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-27 23:22:58 +00:00
Change byte align message wording #58617
This commit is contained in:
parent
5f27a25cf4
commit
8ee1c0708a
@ -359,7 +359,7 @@ impl<'rt, 'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>>
|
||||
return validation_failure!("NULL reference", self.path),
|
||||
EvalErrorKind::AlignmentCheckFailed { required, has } =>
|
||||
return validation_failure!(format!("unaligned reference \
|
||||
(required {} alignment but found {})",
|
||||
(required {} byte alignment but found {})",
|
||||
required.bytes(), has.bytes()), self.path),
|
||||
_ =>
|
||||
return validation_failure!(
|
||||
|
@ -5,7 +5,7 @@ use std::mem;
|
||||
|
||||
const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) };
|
||||
//~^ ERROR it is undefined behavior to use this value
|
||||
//~^^ type validation failed: encountered unaligned reference (required 2 alignment but found 1)
|
||||
//~^^ type validation failed: encountered unaligned reference (required 2 byte alignment but found 1)
|
||||
|
||||
const NULL: &u16 = unsafe { mem::transmute(0usize) };
|
||||
//~^ ERROR it is undefined behavior to use this value
|
||||
|
@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value
|
||||
--> $DIR/ub-ref.rs:6:1
|
||||
|
|
||||
LL | const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered unaligned reference (required 2 alignment but found 1)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered unaligned reference (required 2 byte alignment but found 1)
|
||||
|
|
||||
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user