about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorPieter Agten <pieter.agten@fortanix.com>2019-12-05 08:48:15 +0100
committerPieter Agten <pieter.agten@fortanix.com>2019-12-05 08:48:15 +0100
commit9a428e119480e49834a60ea8aaf9c4678c915598 (patch)
treefd537725624c07a32c99a37f3811e9cd30b1556a /src/test/ui
parent3ee0f48429e6571a87320f2f2e56a48e6717cff1 (diff)
parentaeaaf8f640c919074983edd8366ab3d10321f2b5 (diff)
Merge branch 'master' into feature/print-msg-from-elf-entrypoint
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/consts/const-eval/const-eval-intrinsic-promotion.rs6
-rw-r--r--src/test/ui/consts/const-eval/const-eval-intrinsic-promotion.stderr13
-rw-r--r--src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs4
-rw-r--r--src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.stderr4
-rw-r--r--src/test/ui/feature-gates/feature-gate-const_transmute.rs2
-rw-r--r--src/test/ui/feature-gates/feature-gate-const_transmute.stderr4
-rw-r--r--src/test/ui/traits/cycle-cache-err-60010.stderr4
7 files changed, 28 insertions, 9 deletions
diff --git a/src/test/ui/consts/const-eval/const-eval-intrinsic-promotion.rs b/src/test/ui/consts/const-eval/const-eval-intrinsic-promotion.rs
new file mode 100644
index 00000000000..bdcf537859c
--- /dev/null
+++ b/src/test/ui/consts/const-eval/const-eval-intrinsic-promotion.rs
@@ -0,0 +1,6 @@
+#![feature(core_intrinsics)]
+fn main() {
+    // Test that calls to intrinsics are never promoted
+    let x: &'static usize =
+        &std::intrinsics::size_of::<i32>(); //~ ERROR temporary value dropped while borrowed
+}
diff --git a/src/test/ui/consts/const-eval/const-eval-intrinsic-promotion.stderr b/src/test/ui/consts/const-eval/const-eval-intrinsic-promotion.stderr
new file mode 100644
index 00000000000..78143042ece
--- /dev/null
+++ b/src/test/ui/consts/const-eval/const-eval-intrinsic-promotion.stderr
@@ -0,0 +1,13 @@
+error[E0716]: temporary value dropped while borrowed
+  --> $DIR/const-eval-intrinsic-promotion.rs:5:10
+   |
+LL |     let x: &'static usize =
+   |            -------------- type annotation requires that borrow lasts for `'static`
+LL |         &std::intrinsics::size_of::<i32>();
+   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
+LL | }
+   | - temporary value is freed at the end of this statement
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0716`.
diff --git a/src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs b/src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs
index 7c6a574a211..6469a65700d 100644
--- a/src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs
+++ b/src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs
@@ -7,7 +7,7 @@ extern "C" {
 const extern fn bar() {
     unsafe {
         regular_in_block();
-        //~^ ERROR: cannot call functions with `"C"` abi in `min_const_fn`
+        //~^ ERROR: can only call other `const fn` within a `const fn`
     }
 }
 
@@ -16,7 +16,7 @@ extern fn regular() {}
 const extern fn foo() {
     unsafe {
         regular();
-        //~^ ERROR: cannot call functions with `"C"` abi in `min_const_fn`
+        //~^ ERROR: can only call other `const fn` within a `const fn`
     }
 }
 
diff --git a/src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.stderr b/src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.stderr
index d8bdf0a57cf..eed279ecf75 100644
--- a/src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.stderr
+++ b/src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.stderr
@@ -1,4 +1,4 @@
-error[E0723]: cannot call functions with `"C"` abi in `min_const_fn`
+error[E0723]: can only call other `const fn` within a `const fn`, but `const regular_in_block` is not stable as `const fn`
   --> $DIR/const-extern-fn-call-extern-fn.rs:9:9
    |
 LL |         regular_in_block();
@@ -7,7 +7,7 @@ LL |         regular_in_block();
    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
    = help: add `#![feature(const_fn)]` to the crate attributes to enable
 
-error[E0723]: cannot call functions with `"C"` abi in `min_const_fn`
+error[E0723]: can only call other `const fn` within a `const fn`, but `const regular` is not stable as `const fn`
   --> $DIR/const-extern-fn-call-extern-fn.rs:18:9
    |
 LL |         regular();
diff --git a/src/test/ui/feature-gates/feature-gate-const_transmute.rs b/src/test/ui/feature-gates/feature-gate-const_transmute.rs
index 6a5bbec77fd..da532643d94 100644
--- a/src/test/ui/feature-gates/feature-gate-const_transmute.rs
+++ b/src/test/ui/feature-gates/feature-gate-const_transmute.rs
@@ -4,6 +4,6 @@ use std::mem;
 struct Foo(u32);
 
 const TRANSMUTED_U32: u32 = unsafe { mem::transmute(Foo(3)) };
-//~^ ERROR The use of std::mem::transmute() is gated in constants
+//~^ ERROR `std::intrinsics::transmute` is not yet stable as a const fn
 
 fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-const_transmute.stderr b/src/test/ui/feature-gates/feature-gate-const_transmute.stderr
index 41b653d98dc..772e8d29478 100644
--- a/src/test/ui/feature-gates/feature-gate-const_transmute.stderr
+++ b/src/test/ui/feature-gates/feature-gate-const_transmute.stderr
@@ -1,12 +1,10 @@
-error[E0658]: The use of std::mem::transmute() is gated in constants
+error: `std::intrinsics::transmute` is not yet stable as a const fn
   --> $DIR/feature-gate-const_transmute.rs:6:38
    |
 LL | const TRANSMUTED_U32: u32 = unsafe { mem::transmute(Foo(3)) };
    |                                      ^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: for more information, see https://github.com/rust-lang/rust/issues/53605
    = help: add `#![feature(const_transmute)]` to the crate attributes to enable
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/traits/cycle-cache-err-60010.stderr b/src/test/ui/traits/cycle-cache-err-60010.stderr
index f439de88261..295845b1146 100644
--- a/src/test/ui/traits/cycle-cache-err-60010.stderr
+++ b/src/test/ui/traits/cycle-cache-err-60010.stderr
@@ -6,7 +6,7 @@ LL |     _parse: <ParseQuery as Query<RootDatabase>>::Data,
    |
    = note: required because of the requirements on the impl of `Query<RootDatabase>` for `ParseQuery`
 
-error[E0275]: overflow evaluating the requirement `RootDatabase: SourceDatabase`
+error[E0275]: overflow evaluating the requirement `Runtime<RootDatabase>: std::panic::RefUnwindSafe`
   --> $DIR/cycle-cache-err-60010.rs:31:5
    |
 LL |     type Storage;
@@ -17,6 +17,8 @@ LL | impl Database for RootDatabase {
 LL |     type Storage = SalsaStorage;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
+   = note: required because it appears within the type `RootDatabase`
+   = note: required because of the requirements on the impl of `SourceDatabase` for `RootDatabase`
    = note: required because of the requirements on the impl of `Query<RootDatabase>` for `ParseQuery`
    = note: required because it appears within the type `SalsaStorage`