diff options
Diffstat (limited to 'src/test/ui/dyn-drop/dyn-drop.rs')
-rw-r--r-- | src/test/ui/dyn-drop/dyn-drop.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/dyn-drop/dyn-drop.rs b/src/test/ui/dyn-drop/dyn-drop.rs new file mode 100644 index 000000000..e1668a3f1 --- /dev/null +++ b/src/test/ui/dyn-drop/dyn-drop.rs @@ -0,0 +1,16 @@ +#![deny(dyn_drop)] +#![allow(bare_trait_objects)] +fn foo(_: Box<dyn Drop>) {} //~ ERROR +fn bar(_: &dyn Drop) {} //~ERROR +fn baz(_: *mut Drop) {} //~ ERROR +struct Foo { + _x: Box<dyn Drop> //~ ERROR +} +trait Bar { + type T: ?Sized; +} +struct Baz {} +impl Bar for Baz { + type T = dyn Drop; //~ ERROR +} +fn main() {} |