]> git.proxmox.com Git - rustc.git/blame - src/test/ui/moves/move-out-of-field.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / moves / move-out-of-field.rs
CommitLineData
b7449926 1// run-pass
c34b1796 2
1a4d82fc 3use std::string::String;
970d7e83
LB
4
5struct StringBuffer {
1a4d82fc 6 s: String,
970d7e83
LB
7}
8
9impl StringBuffer {
10 pub fn append(&mut self, v: &str) {
11 self.s.push_str(v);
12 }
13}
14
1a4d82fc 15fn to_string(sb: StringBuffer) -> String {
970d7e83
LB
16 sb.s
17}
18
1a4d82fc
JJ
19pub fn main() {
20 let mut sb = StringBuffer {
21 s: String::new(),
22 };
970d7e83
LB
23 sb.append("Hello, ");
24 sb.append("World!");
1a4d82fc 25 let str = to_string(sb);
85aaf69f 26 assert_eq!(str, "Hello, World!");
1a4d82fc 27}