]> git.lizzy.rs Git - rust.git/commitdiff
Miri error messages: avoid try terminology
authorRalf Jung <post@ralfj.de>
Thu, 16 Apr 2020 15:41:28 +0000 (17:41 +0200)
committerRalf Jung <post@ralfj.de>
Thu, 16 Apr 2020 15:41:28 +0000 (17:41 +0200)
src/librustc_middle/mir/interpret/error.rs
src/test/ui/consts/transmute-size-mismatch-before-typeck.stderr

index 7844fb108406dface6a85058ae2249a500a9329c..ddff9a57818c762bee65021aa41a975a588bdc73 100644 (file)
@@ -305,7 +305,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
             Layout(ref err) => write!(f, "{}", err),
             TransmuteSizeDiff(from_ty, to_ty) => write!(
                 f,
-                "tried to transmute from {:?} to {:?}, but their sizes differed",
+                "transmuting from {:?} to {:?}, which do not have the same size",
                 from_ty, to_ty
             ),
         }
@@ -431,7 +431,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
                 "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"),
         }
     }
 }
@@ -462,9 +462,9 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         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, "cannot load MIR for {:?}", did),
             ReadPointerAsBytes => write!(f, "unable to turn pointer into raw bytes",),
             ReadBytesAsPointer => write!(f, "unable to turn bytes into a pointer"),
         }
index 5a4777145962584d625b2f0067e8511e92630b9a..0e55d299c40ed18580cadd935ed4bfb4b4ccca44 100644 (file)
@@ -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 from usize to &[u8], which do not have the same size
    |
    = note: `#[deny(const_err)]` on by default