1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
14 fn borrowed_mut(&mut self);
16 fn owned(self: Box<Self>);
19 fn borrowed_receiver(x: &Foo) {
21 x.borrowed_mut(); // See [1]
22 x.owned(); //~ ERROR no method named `owned` found
25 fn borrowed_mut_receiver(x: &mut Foo) {
28 x.owned(); //~ ERROR no method named `owned` found
31 fn owned_receiver(x: Box<Foo>) {
33 x.borrowed_mut(); // See [1]
34 x.managed(); //~ ERROR no method named `managed` found
40 // [1]: These cases are illegal, but the error is not detected
41 // until borrowck, so see the test borrowck-object-mutability.rs