summaryrefslogtreecommitdiffstats
path: root/tests/ui/lifetimes/borrowck-let-suggestion.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/lifetimes/borrowck-let-suggestion.rs')
-rw-r--r--tests/ui/lifetimes/borrowck-let-suggestion.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/lifetimes/borrowck-let-suggestion.rs b/tests/ui/lifetimes/borrowck-let-suggestion.rs
new file mode 100644
index 000000000..3d591a506
--- /dev/null
+++ b/tests/ui/lifetimes/borrowck-let-suggestion.rs
@@ -0,0 +1,12 @@
+fn f() {
+ let mut x = vec![1].iter();
+ //~^ ERROR temporary value dropped while borrowed
+ x.use_mut();
+}
+
+fn main() {
+ f();
+}
+
+trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { } }
+impl<T> Fake for T { }