summaryrefslogtreecommitdiffstats
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 000000000..145eab126
--- /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() {}