summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-eval/transmute-const-promotion.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/consts/const-eval/transmute-const-promotion.rs')
-rw-r--r--tests/ui/consts/const-eval/transmute-const-promotion.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/ui/consts/const-eval/transmute-const-promotion.rs b/tests/ui/consts/const-eval/transmute-const-promotion.rs
new file mode 100644
index 000000000..1f0240d4b
--- /dev/null
+++ b/tests/ui/consts/const-eval/transmute-const-promotion.rs
@@ -0,0 +1,6 @@
+use std::mem;
+
+fn main() {
+ let x: &'static u32 = unsafe { &mem::transmute(3.0f32) };
+ //~^ ERROR temporary value dropped while borrowed
+}