]> git.lizzy.rs Git - rust.git/blob - tests/ui/cleanup-rvalue-scopes-cf.stderr
Rollup merge of #107306 - compiler-errors:correct-sugg-for-closure-arg-needs-borrow...
[rust.git] / tests / ui / cleanup-rvalue-scopes-cf.stderr
1 error[E0716]: temporary value dropped while borrowed
2   --> $DIR/cleanup-rvalue-scopes-cf.rs:26:19
3    |
4 LL |     let x1 = arg(&AddFlags(1));
5    |                   ^^^^^^^^^^^ - temporary value is freed at the end of this statement
6    |                   |
7    |                   creates a temporary value which is freed while still in use
8 ...
9 LL |     (x1, x2, x3, x4, x5, x6, x7);
10    |      -- borrow later used here
11    |
12 help: consider using a `let` binding to create a longer lived value
13    |
14 LL ~     let binding = AddFlags(1);
15 LL ~     let x1 = arg(&binding);
16    |
17
18 error[E0716]: temporary value dropped while borrowed
19   --> $DIR/cleanup-rvalue-scopes-cf.rs:27:14
20    |
21 LL |     let x2 = AddFlags(1).get();
22    |              ^^^^^^^^^^^      - temporary value is freed at the end of this statement
23    |              |
24    |              creates a temporary value which is freed while still in use
25 ...
26 LL |     (x1, x2, x3, x4, x5, x6, x7);
27    |          -- borrow later used here
28    |
29 help: consider using a `let` binding to create a longer lived value
30    |
31 LL ~     let binding = AddFlags(1);
32 LL ~     let x2 = binding.get();
33    |
34
35 error[E0716]: temporary value dropped while borrowed
36   --> $DIR/cleanup-rvalue-scopes-cf.rs:28:21
37    |
38 LL |     let x3 = &*arg(&AddFlags(1));
39    |                     ^^^^^^^^^^^ - temporary value is freed at the end of this statement
40    |                     |
41    |                     creates a temporary value which is freed while still in use
42 ...
43 LL |     (x1, x2, x3, x4, x5, x6, x7);
44    |              -- borrow later used here
45    |
46 help: consider using a `let` binding to create a longer lived value
47    |
48 LL ~     let binding = AddFlags(1);
49 LL ~     let x3 = &*arg(&binding);
50    |
51
52 error[E0716]: temporary value dropped while borrowed
53   --> $DIR/cleanup-rvalue-scopes-cf.rs:29:24
54    |
55 LL |     let ref x4 = *arg(&AddFlags(1));
56    |                        ^^^^^^^^^^^ - temporary value is freed at the end of this statement
57    |                        |
58    |                        creates a temporary value which is freed while still in use
59 ...
60 LL |     (x1, x2, x3, x4, x5, x6, x7);
61    |                  -- borrow later used here
62    |
63 help: consider using a `let` binding to create a longer lived value
64    |
65 LL ~     let binding = AddFlags(1);
66 LL ~     let ref x4 = *arg(&binding);
67    |
68
69 error[E0716]: temporary value dropped while borrowed
70   --> $DIR/cleanup-rvalue-scopes-cf.rs:30:24
71    |
72 LL |     let &ref x5 = arg(&AddFlags(1));
73    |                        ^^^^^^^^^^^ - temporary value is freed at the end of this statement
74    |                        |
75    |                        creates a temporary value which is freed while still in use
76 ...
77 LL |     (x1, x2, x3, x4, x5, x6, x7);
78    |                      -- borrow later used here
79    |
80 help: consider using a `let` binding to create a longer lived value
81    |
82 LL ~     let binding = AddFlags(1);
83 LL ~     let &ref x5 = arg(&binding);
84    |
85
86 error[E0716]: temporary value dropped while borrowed
87   --> $DIR/cleanup-rvalue-scopes-cf.rs:31:14
88    |
89 LL |     let x6 = AddFlags(1).get();
90    |              ^^^^^^^^^^^      - temporary value is freed at the end of this statement
91    |              |
92    |              creates a temporary value which is freed while still in use
93 ...
94 LL |     (x1, x2, x3, x4, x5, x6, x7);
95    |                          -- borrow later used here
96    |
97 help: consider using a `let` binding to create a longer lived value
98    |
99 LL ~     let binding = AddFlags(1);
100 LL ~     let x6 = binding.get();
101    |
102
103 error[E0716]: temporary value dropped while borrowed
104   --> $DIR/cleanup-rvalue-scopes-cf.rs:32:44
105    |
106 LL |     let StackBox { f: x7 } = StackBox { f: AddFlags(1).get() };
107    |                                            ^^^^^^^^^^^        - temporary value is freed at the end of this statement
108    |                                            |
109    |                                            creates a temporary value which is freed while still in use
110 LL |
111 LL |     (x1, x2, x3, x4, x5, x6, x7);
112    |                              -- borrow later used here
113    |
114 help: consider using a `let` binding to create a longer lived value
115    |
116 LL ~     let binding = AddFlags(1);
117 LL ~     let StackBox { f: x7 } = StackBox { f: binding.get() };
118    |
119
120 error: aborting due to 7 previous errors
121
122 For more information about this error, try `rustc --explain E0716`.