]> git.proxmox.com Git - rustc.git/blob - src/test/ui/self/move-self.rs
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / ui / self / move-self.rs
1 // run-pass
2 struct S {
3 x: String
4 }
5
6 impl S {
7 pub fn foo(self) {
8 self.bar();
9 }
10
11 pub fn bar(self) {
12 println!("{}", self.x);
13 }
14 }
15
16 pub fn main() {
17 let x = S { x: "Hello!".to_string() };
18 x.foo();
19 }