11error[E0382]: use of moved value: `a`
2- --> $DIR/dbg-issue-120327.rs:8 :12
2+ --> $DIR/dbg-issue-120327.rs:4 :12
33 |
44LL | let a = String::new();
55 | - move occurs because `a` has type `String`, which does not implement the `Copy` trait
@@ -12,13 +12,9 @@ help: consider cloning the value if the performance cost is acceptable
1212 |
1313LL | dbg!(a.clone());
1414 | ++++++++
15- help: consider borrowing instead of transferring ownership
16- |
17- LL | dbg!(&a);
18- | +
1915
2016error[E0382]: use of moved value: `a`
21- --> $DIR/dbg-issue-120327.rs:14 :12
17+ --> $DIR/dbg-issue-120327.rs:10 :12
2218 |
2319LL | let a = String::new();
2420 | - move occurs because `a` has type `String`, which does not implement the `Copy` trait
@@ -31,13 +27,9 @@ help: consider cloning the value if the performance cost is acceptable
3127 |
3228LL | dbg!(1, 2, a.clone(), 1, 2);
3329 | ++++++++
34- help: consider borrowing instead of transferring ownership
35- |
36- LL | dbg!(1, 2, &a, 1, 2);
37- | +
3830
3931error[E0382]: use of moved value: `b`
40- --> $DIR/dbg-issue-120327.rs:20 :12
32+ --> $DIR/dbg-issue-120327.rs:16 :12
4133 |
4234LL | let b: String = "".to_string();
4335 | - move occurs because `b` has type `String`, which does not implement the `Copy` trait
@@ -50,13 +42,9 @@ help: consider cloning the value if the performance cost is acceptable
5042 |
5143LL | dbg!(a, b.clone());
5244 | ++++++++
53- help: consider borrowing instead of transferring ownership
54- |
55- LL | dbg!(a, &b);
56- | +
5745
5846error[E0382]: use of moved value: `a`
59- --> $DIR/dbg-issue-120327.rs:26 :12
47+ --> $DIR/dbg-issue-120327.rs:22 :12
6048 |
6149LL | fn x(a: String) -> String {
6250 | - move occurs because `a` has type `String`, which does not implement the `Copy` trait
@@ -70,52 +58,47 @@ help: consider cloning the value if the performance cost is acceptable
7058 |
7159LL | dbg!(a.clone(), b);
7260 | ++++++++
73- help: consider borrowing instead of transferring ownership
74- |
75- LL | dbg!(&a, b);
76- | +
7761
78- error[E0382]: use of moved value: `a`
79- --> $DIR/dbg-issue-120327.rs:30:13
80- |
81- LL | fn two_of_them(a: String) -> String {
82- | - move occurs because `a` has type `String`, which does not implement the `Copy` trait
83- LL | dbg!(a, a);
84- | - ^ value used here after move
85- | |
86- | value moved here
62+ error[E0382]: use of moved value: `b`
63+ --> $DIR/dbg-issue-120327.rs:46:12
8764 |
88- help: consider cloning the value if the performance cost is acceptable
65+ LL | tmp => {
66+ | --- value moved here
67+ ...
68+ LL | let b: String = "".to_string();
69+ | - move occurs because `b` has type `String`, which does not implement the `Copy` trait
70+ LL | my_dbg!(b, 1);
71+ LL | return b;
72+ | ^ value used here after move
8973 |
90- LL | dbg!(a.clone(), a);
91- | ++++++++
9274help: consider borrowing instead of transferring ownership
9375 |
94- LL | dbg!(&a, a);
95- | +
76+ LL | my_dbg!(&b, 1);
77+ | +
78+ help: borrow this binding in the pattern to avoid moving the value
79+ |
80+ LL | ref tmp => {
81+ | +++
9682
9783error[E0382]: use of moved value: `a`
98- --> $DIR/dbg-issue-120327.rs:33 :12
84+ --> $DIR/dbg-issue-120327.rs:57 :12
9985 |
100- LL | fn two_of_them(a: String) -> String {
101- | - move occurs because `a` has type `String`, which does not implement the `Copy` trait
102- LL | dbg!(a, a);
103- | - value moved here
86+ LL | let a = String::new();
87+ | - move occurs because `a` has type `String`, which does not implement the `Copy` trait
88+ LL | let _b = match a {
89+ LL | tmp => {
90+ | --- value moved here
10491...
10592LL | return a;
10693 | ^ value used here after move
10794 |
108- help: consider cloning the value if the performance cost is acceptable
109- |
110- LL | dbg!(a, a.clone());
111- | ++++++++
112- help: consider borrowing instead of transferring ownership
95+ help: borrow this binding in the pattern to avoid moving the value
11396 |
114- LL | dbg!(a, &a);
115- | +
97+ LL | ref tmp => {
98+ | ++ +
11699
117100error[E0382]: borrow of moved value: `a`
118- --> $DIR/dbg-issue-120327.rs:42 :14
101+ --> $DIR/dbg-issue-120327.rs:65 :14
119102 |
120103LL | let a: String = "".to_string();
121104 | - move occurs because `a` has type `String`, which does not implement the `Copy` trait
@@ -128,10 +111,6 @@ help: consider cloning the value if the performance cost is acceptable
128111 |
129112LL | let _res = get_expr(dbg!(a.clone()));
130113 | ++++++++
131- help: consider borrowing instead of transferring ownership
132- |
133- LL | let _res = get_expr(dbg!(&a));
134- | +
135114
136115error: aborting due to 7 previous errors
137116
0 commit comments