4fc0452ace
The `print!` and `println!` macros are now the preferred method of printing, and so there is no reason to export the `stdio` functions in the prelude. The functions have also been replaced by their macro counterparts in the tutorial and other documentation so that newcomers don't get confused about what they should be using.
23 lines
501 B
Rust
23 lines
501 B
Rust
struct S {f:~str}
|
|
impl Drop for S {
|
|
fn drop(&mut self) { println!("{}", self.f); }
|
|
}
|
|
|
|
fn move_in_match() {
|
|
match S {f:~"foo"} {
|
|
S {f:_s} => {}
|
|
//~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
|
|
}
|
|
}
|
|
|
|
fn move_in_let() {
|
|
let S {f:_s} = S {f:~"foo"};
|
|
//~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
|
|
}
|
|
|
|
fn move_in_fn_arg(S {f:_s}: S) {
|
|
//~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
|
|
}
|
|
|
|
fn main() {}
|