summaryrefslogtreecommitdiffstats
path: root/src/test/ui/dropck/drop-on-non-struct.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/dropck/drop-on-non-struct.rs')
-rw-r--r--src/test/ui/dropck/drop-on-non-struct.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/dropck/drop-on-non-struct.rs b/src/test/ui/dropck/drop-on-non-struct.rs
new file mode 100644
index 000000000..ef5e18126
--- /dev/null
+++ b/src/test/ui/dropck/drop-on-non-struct.rs
@@ -0,0 +1,15 @@
+impl<'a> Drop for &'a mut isize {
+ //~^ ERROR the `Drop` trait may only be implemented for 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() {
+}