diff options
Diffstat (limited to 'src/test/ui/object-pointer-types.rs')
-rw-r--r-- | src/test/ui/object-pointer-types.rs | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/test/ui/object-pointer-types.rs b/src/test/ui/object-pointer-types.rs deleted file mode 100644 index 760a50e5b..000000000 --- a/src/test/ui/object-pointer-types.rs +++ /dev/null @@ -1,30 +0,0 @@ -trait Foo { - fn borrowed(&self); - fn borrowed_mut(&mut self); - - fn owned(self: Box<Self>); -} - -fn borrowed_receiver(x: &dyn Foo) { - x.borrowed(); - x.borrowed_mut(); // See [1] - x.owned(); //~ ERROR no method named `owned` found -} - -fn borrowed_mut_receiver(x: &mut dyn Foo) { - x.borrowed(); - x.borrowed_mut(); - x.owned(); //~ ERROR no method named `owned` found -} - -fn owned_receiver(x: Box<dyn Foo>) { - x.borrowed(); - x.borrowed_mut(); // See [1] - x.managed(); //~ ERROR no method named `managed` found - x.owned(); -} - -fn main() {} - -// [1]: These cases are illegal, but the error is not detected -// until borrowck, so see the test borrowck-object-mutability.rs |