about summary refs log tree commit diff
path: root/tests/ui/dropck/drop-on-non-struct.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/dropck/drop-on-non-struct.rs')
-rw-r--r--tests/ui/dropck/drop-on-non-struct.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/dropck/drop-on-non-struct.rs b/tests/ui/dropck/drop-on-non-struct.rs
new file mode 100644
index 00000000000..145eab126c2
--- /dev/null
+++ b/tests/ui/dropck/drop-on-non-struct.rs
@@ -0,0 +1,14 @@
+impl<'a> Drop for &'a mut isize {
+    //~^ ERROR the `Drop` trait may only be implemented for local structs, enums, and unions
+    //~^^ ERROR E0117
+    fn drop(&mut self) {
+        println!("kaboom");
+    }
+}
+
+impl Drop for Nonexistent {
+    //~^ ERROR cannot find type `Nonexistent`
+    fn drop(&mut self) {}
+}
+
+fn main() {}