about summary refs log tree commit diff
path: root/tests/ui/consts/const-int-rotate.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/consts/const-int-rotate.rs')
-rw-r--r--tests/ui/consts/const-int-rotate.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/ui/consts/const-int-rotate.rs b/tests/ui/consts/const-int-rotate.rs
new file mode 100644
index 00000000000..3aacf854db1
--- /dev/null
+++ b/tests/ui/consts/const-int-rotate.rs
@@ -0,0 +1,6 @@
+fn main() {
+    let x: &'static i32 = &(5_i32.rotate_left(3));
+    //~^ ERROR temporary value dropped while borrowed
+    let y: &'static i32 = &(5_i32.rotate_right(3));
+    //~^ ERROR temporary value dropped while borrowed
+}