Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
c3ccaacc6c90fc678cbba9c3c0427f0a7dece75c
rust/src/test/compile-fail/by-move-pattern-binding.rs

23 lines
345 B
Rust
Raw Normal View History

librustc: Ensure that no moves from the inside of @ or & boxes occur. rs=crashing-servo
2012-12-14 17:50:48 -08:00
enum E {
Foo,
Bar(~str)
}
struct S {
x: E
}
fn f(x: ~str) {}
fn main() {
let s = S { x: Bar(~"hello") };
match &s.x {
&Foo => {}
librustc: Remove all uses of "copy".
2013-07-02 12:47:32 -07:00
&Bar(identifier) => f(identifier.clone()) //~ ERROR cannot move
librustc: Ensure that no moves from the inside of @ or & boxes occur. rs=crashing-servo
2012-12-14 17:50:48 -08:00
};
match &s.x {
&Foo => {}
Remove re-exports of std::io::stdio::{print, println} in the prelude. 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.
2014-01-09 21:06:55 +11:00
&Bar(ref identifier) => println!("{}", *identifier)
librustc: Ensure that no moves from the inside of @ or & boxes occur. rs=crashing-servo
2012-12-14 17:50:48 -08:00
};
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 391ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API