Skip to content

Commit

Permalink
Rollup merge of #71206 - RalfJung:dont-try, r=oli-obk
Browse files Browse the repository at this point in the history
Miri error messages: avoid try terminology

r? @oli-obk
  • Loading branch information
Dylan-DPC authored Apr 17, 2020
2 parents b347097 + 250b27d commit b2e4d48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/librustc_middle/mir/interpret/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ impl fmt::Debug for InvalidProgramInfo<'_> {
Layout(ref err) => write!(f, "{}", err),
TransmuteSizeDiff(from_ty, to_ty) => write!(
f,
"tried to transmute from {:?} to {:?}, but their sizes differed",
"transmuting `{}` to `{}` is not possible, because these types do not have the same size",
from_ty, to_ty
),
}
Expand Down Expand Up @@ -431,7 +431,7 @@ impl fmt::Debug for UndefinedBehaviorInfo {
"using uninitialized data, but this operation requires initialized memory"
),
DeadLocal => write!(f, "accessing a dead local variable"),
ReadFromReturnPlace => write!(f, "tried to read from the return place"),
ReadFromReturnPlace => write!(f, "reading from return place"),
}
}
}
Expand Down Expand Up @@ -462,9 +462,9 @@ impl fmt::Debug for UnsupportedOpInfo {
match self {
Unsupported(ref msg) => write!(f, "{}", msg),
ReadForeignStatic(did) => {
write!(f, "tried to read from foreign (extern) static {:?}", did)
write!(f, "cannot read from foreign (extern) static {:?}", did)
}
NoMirFor(did) => write!(f, "could not load MIR for {:?}", did),
NoMirFor(did) => write!(f, "no MIR body is available for {:?}", did),
ReadPointerAsBytes => write!(f, "unable to turn pointer into raw bytes",),
ReadBytesAsPointer => write!(f, "unable to turn bytes into a pointer"),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: any use of this value will cause an error
LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
| ----------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| tried to transmute from usize to &[u8], but their sizes differed
| transmuting `usize` to `&[u8]` is not possible, because these types do not have the same size
|
= note: `#[deny(const_err)]` on by default

Expand Down

0 comments on commit b2e4d48

Please sign in to comment.