summaryrefslogtreecommitdiffstats
path: root/src/test/ui/error-codes/E0040.fixed
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/error-codes/E0040.fixed')
-rw-r--r--src/test/ui/error-codes/E0040.fixed18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/error-codes/E0040.fixed b/src/test/ui/error-codes/E0040.fixed
new file mode 100644
index 000000000..139dc8f94
--- /dev/null
+++ b/src/test/ui/error-codes/E0040.fixed
@@ -0,0 +1,18 @@
+// run-rustfix
+struct Foo {
+ x: i32,
+}
+
+impl Drop for Foo {
+ fn drop(&mut self) {
+ println!("kaboom");
+ }
+}
+
+fn main() {
+ let mut x = Foo { x: -7 };
+ x.x = 0;
+ println!("{}", x.x);
+ drop(x);
+ //~^ ERROR E0040
+}