]> git.lizzy.rs Git - rust.git/commitdiff
fix for latest rustc
authorRalf Jung <post@ralfj.de>
Mon, 5 Aug 2019 08:45:48 +0000 (10:45 +0200)
committerRalf Jung <post@ralfj.de>
Mon, 5 Aug 2019 08:45:48 +0000 (10:45 +0200)
rust-version
src/shims/foreign_items.rs
src/shims/intrinsics.rs
src/shims/tls.rs
src/stacked_borrows.rs
tests/compile-fail/assume.rs

index 94c6f5e4b8c9790c8135091ff2443a14f884a8bf..0680001291b772727b23919947ce6b72cc2929ab 100644 (file)
@@ -1 +1 @@
-a45743345659c775b01484574af2818c46a2cb03
+11a51488f03405ea539a9fe84973ee972eaa7b96
index 538109eceae7e0f9548e6791e5f4d8d2a0b0c4a7..37e5fe42c3de7829f71c77d48f87700ba12d3972 100644 (file)
@@ -655,9 +655,9 @@ fn emulate_foreign_item(
                 // This is `libc::pthread_key_t`.
                 let key_type = args[0].layout.ty
                     .builtin_deref(true)
-                    .ok_or_else(|| err_ub!(Ub(format!(
+                    .ok_or_else(|| err_ub_format!(
                         "wrong signature used for `pthread_key_create`: first argument must be a raw pointer."
-                    ))))?
+                    ))?
                     .ty;
                 let key_layout = this.layout_of(key_type)?;
 
index 52a17a92c2edabc84bd236edd439e28575342435..c96869c80cee7c1c549a5294272bd435bcd4a793 100644 (file)
@@ -44,7 +44,7 @@ fn call_intrinsic(
             "assume" => {
                 let cond = this.read_scalar(args[0])?.to_bool()?;
                 if !cond {
-                    throw_unsup!(AssumptionNotHeld);
+                    throw_ub_format!("`assume` intrinsic called with `false`");
                 }
             }
 
@@ -316,9 +316,9 @@ fn call_intrinsic(
                     // Check if `b` is -1, which is the "min_value / -1" case.
                     let minus1 = Scalar::from_int(-1, dest.layout.size);
                     return Err(if b.to_scalar().unwrap() == minus1 {
-                        err_ub!(Ub(format!("exact_div: result of dividing MIN by -1 cannot be represented")))
+                        err_ub_format!("exact_div: result of dividing MIN by -1 cannot be represented")
                     } else {
-                        err_ub!(Ub(format!("exact_div: {:?} cannot be divided by {:?} without remainder", *a, *b)))
+                        err_ub_format!("exact_div: {:?} cannot be divided by {:?} without remainder", *a, *b)
                     }.into());
                 }
                 this.binop_ignore_overflow(mir::BinOp::Div, a, b, dest)?;
index 05b8dc15da66be66d9131699e49cdd8ec918aaa1..d2190bd969e3d04575475fd691579123a60cae9e 100644 (file)
@@ -158,7 +158,7 @@ fn run_tls_dtors(&mut self) -> InterpResult<'tcx> {
                 StackPopCleanup::None { cleanup: true },
             )?;
             let arg_local = this.frame().body.args_iter().next().ok_or_else(
-                || err_ub!(Ub(format!("TLS dtor does not take enough arguments."))),
+                || err_ub_format!("TLS dtor does not take enough arguments."),
             )?;
             let dest = this.local_place(arg_local)?;
             this.write_scalar(ptr, dest)?;
index 0fbc3e1ac281df374c300970d6eb34d070d97aa0..01ed6ec225d204c23ad03ab0e3df18d2e0b63813 100644 (file)
@@ -273,14 +273,14 @@ fn check_protector(item: &Item, tag: Option<Tag>, global: &GlobalState) -> Inter
         if let Some(call) = item.protector {
             if global.is_active(call) {
                 if let Some(tag) = tag {
-                    throw_ub_format!(
+                    throw_ub!(UbExperimental(format!(
                         "not granting access to tag {:?} because incompatible item is protected: {:?}",
                         tag, item
-                    );
+                    )));
                 } else {
-                    throw_ub_format!(
+                    throw_ub!(UbExperimental(format!(
                         "deallocating while item is protected: {:?}", item
-                    );
+                    )));
                 }
             }
         }
@@ -299,7 +299,7 @@ fn access(
 
         // Step 1: Find granting item.
         let granting_idx = self.find_granting(access, tag)
-            .ok_or_else(|| err_ub!(Ub(format!(
+            .ok_or_else(|| err_ub!(UbExperimental(format!(
                 "no item granting {} to tag {:?} found in borrow stack",
                 access, tag,
             ))))?;
@@ -346,7 +346,7 @@ fn dealloc(
     ) -> InterpResult<'tcx> {
         // Step 1: Find granting item.
         self.find_granting(AccessKind::Write, tag)
-            .ok_or_else(|| err_ub!(Ub(format!(
+            .ok_or_else(|| err_ub!(UbExperimental(format!(
                 "no item granting write access for deallocation to tag {:?} found in borrow stack",
                 tag,
             ))))?;
@@ -378,7 +378,7 @@ fn grant(
         // Now we figure out which item grants our parent (`derived_from`) this kind of access.
         // We use that to determine where to put the new item.
         let granting_idx = self.find_granting(access, derived_from)
-            .ok_or_else(|| err_ub!(Ub(format!(
+            .ok_or_else(|| err_ub!(UbExperimental(format!(
                 "trying to reborrow for {:?}, but parent tag {:?} does not have an appropriate item in the borrow stack", new.perm, derived_from,
             ))))?;
 
index 3026124e1f9aff69ac8e4b5f5777f7bd019b3bf1..7b18cab7980577d7a286ad3855ea11927417457d 100644 (file)
@@ -5,6 +5,6 @@ fn main() {
     unsafe {
         std::intrinsics::assume(x < 10);
         std::intrinsics::assume(x > 1);
-        std::intrinsics::assume(x > 42); //~ `assume` argument was false
+        std::intrinsics::assume(x > 42); //~ `assume` intrinsic called with `false`
     }
 }