summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn_cross_crate.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/consts/const-eval/dont_promote_unstable_const_fn_cross_crate.rs')
-rw-r--r--src/test/ui/consts/const-eval/dont_promote_unstable_const_fn_cross_crate.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn_cross_crate.rs b/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn_cross_crate.rs
new file mode 100644
index 000000000..ea35f4680
--- /dev/null
+++ b/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn_cross_crate.rs
@@ -0,0 +1,10 @@
+// aux-build:stability.rs
+
+extern crate stability;
+
+use stability::foo;
+
+fn main() {
+ let _: &'static u32 = &foo(); //~ ERROR temporary value dropped while borrowed
+ let _x: &'static u32 = &foo(); //~ ERROR temporary value dropped while borrowed
+}