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

error[E0716]: temporary value dropped while borrowed
  --> $DIR/cleanup-rvalue-scopes-cf.rs:27:14
   |
LL |     let x2 = AddFlags(1).get();
   |              ^^^^^^^^^^^      - temporary value is freed at the end of this statement
   |              |
   |              creates a temporary which is freed while still in use
...
LL |     (x1, x2, x3, x4, x5, x6, x7);
   |          -- borrow later used here
   |
help: consider using a `let` binding to create a longer lived value
   |
LL ~     let binding = AddFlags(1);
LL ~     let x2 = binding.get();
   |

error[E0716]: temporary value dropped while borrowed
  --> $DIR/cleanup-rvalue-scopes-cf.rs:28:21
   |
LL |     let x3 = &*arg(&AddFlags(1));
   |                     ^^^^^^^^^^^ - temporary value is freed at the end of this statement
   |                     |
   |                     creates a temporary which is freed while still in use
...
LL |     (x1, x2, x3, x4, x5, x6, x7);
   |              -- borrow later used here
   |
help: consider using a `let` binding to create a longer lived value
   |
LL ~     let binding = AddFlags(1);
LL ~     let x3 = &*arg(&binding);
   |

error[E0716]: temporary value dropped while borrowed
  --> $DIR/cleanup-rvalue-scopes-cf.rs:29:24
   |
LL |     let ref x4 = *arg(&AddFlags(1));
   |                        ^^^^^^^^^^^ - temporary value is freed at the end of this statement
   |                        |
   |                        creates a temporary which is freed while still in use
...
LL |     (x1, x2, x3, x4, x5, x6, x7);
   |                  -- borrow later used here
   |
help: consider using a `let` binding to create a longer lived value
   |
LL ~     let binding = AddFlags(1);
LL ~     let ref x4 = *arg(&binding);
   |

error[E0716]: temporary value dropped while borrowed
  --> $DIR/cleanup-rvalue-scopes-cf.rs:30:24
   |
LL |     let &ref x5 = arg(&AddFlags(1));
   |                        ^^^^^^^^^^^ - temporary value is freed at the end of this statement
   |                        |
   |                        creates a temporary which is freed while still in use
...
LL |     (x1, x2, x3, x4, x5, x6, x7);
   |                      -- borrow later used here
   |
help: consider using a `let` binding to create a longer lived value
   |
LL ~     let binding = AddFlags(1);
LL ~     let &ref x5 = arg(&binding);
   |

error[E0716]: temporary value dropped while borrowed
  --> $DIR/cleanup-rvalue-scopes-cf.rs:31:14
   |
LL |     let x6 = AddFlags(1).get();
   |              ^^^^^^^^^^^      - temporary value is freed at the end of this statement
   |              |
   |              creates a temporary which is freed while still in use
...
LL |     (x1, x2, x3, x4, x5, x6, x7);
   |                          -- borrow later used here
   |
help: consider using a `let` binding to create a longer lived value
   |
LL ~     let binding = AddFlags(1);
LL ~     let x6 = binding.get();
   |

error[E0716]: temporary value dropped while borrowed
  --> $DIR/cleanup-rvalue-scopes-cf.rs:32:44
   |
LL |     let StackBox { f: x7 } = StackBox { f: AddFlags(1).get() };
   |                                            ^^^^^^^^^^^        - temporary value is freed at the end of this statement
   |                                            |
   |                                            creates a temporary which is freed while still in use
LL |
LL |     (x1, x2, x3, x4, x5, x6, x7);
   |                              -- borrow later used here
   |
help: consider using a `let` binding to create a longer lived value
   |
LL ~     let binding = AddFlags(1);
LL ~     let StackBox { f: x7 } = StackBox { f: binding.get() };
   |

error: aborting due to 7 previous errors

For more information about this error, try `rustc --explain E0716`.