summaryrefslogtreecommitdiffstats
path: root/tests/ui/span/issue-15480.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/span/issue-15480.rs')
-rw-r--r--tests/ui/span/issue-15480.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/span/issue-15480.rs b/tests/ui/span/issue-15480.rs
new file mode 100644
index 000000000..916ce4b1e
--- /dev/null
+++ b/tests/ui/span/issue-15480.rs
@@ -0,0 +1,13 @@
+// run-rustfix
+fn id<T>(x: T) -> T { x }
+
+fn main() {
+ let v = vec![
+ &id(3)
+ ];
+ //~^^ ERROR temporary value dropped while borrowed
+
+ for &&x in &v {
+ println!("{}", x + 3);
+ }
+}