File: without-precise-captures-we-are-powerless.stderr

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (143 lines) | stat: -rw-r--r-- 5,769 bytes parent folder | download | duplicates (3)
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
error[E0597]: `x` does not live long enough
  --> $DIR/without-precise-captures-we-are-powerless.rs:14:13
   |
LL | fn simple<'a>(x: &'a i32) {
   |           -- lifetime `'a` defined here
LL |     let c = async || { println!("{}", *x); };
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
LL |     outlives::<'a>(c());
LL |     outlives::<'a>(call_once(c));
   |                    ------------ argument requires that `x` is borrowed for `'a`
...
LL | }
   |  - `x` dropped here while still borrowed

error[E0597]: `c` does not live long enough
  --> $DIR/without-precise-captures-we-are-powerless.rs:19:20
   |
LL | fn simple<'a>(x: &'a i32) {
   |           -- lifetime `'a` defined here
...
LL |     let c = async move || { println!("{}", *x); };
   |         - binding `c` declared here
LL |     outlives::<'a>(c());
   |                    ^--
   |                    |
   |                    borrowed value does not live long enough
   |                    argument requires that `c` is borrowed for `'a`
LL |     outlives::<'a>(call_once(c));
LL | }
   | - `c` dropped here while still borrowed

error[E0597]: `x` does not live long enough
  --> $DIR/without-precise-captures-we-are-powerless.rs:26:13
   |
LL | fn through_field<'a>(x: S<'a>) {
   |                  -- lifetime `'a` defined here
LL |     let c = async || { println!("{}", *x.0); };
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
LL |     outlives::<'a>(c());
LL |     outlives::<'a>(call_once(c));
   |                    ------------ argument requires that `x` is borrowed for `'a`
...
LL | }
   |  - `x` dropped here while still borrowed

error[E0505]: cannot move out of `x` because it is borrowed
  --> $DIR/without-precise-captures-we-are-powerless.rs:30:13
   |
LL | fn through_field<'a>(x: S<'a>) {
   |                  -- lifetime `'a` defined here
LL |     let c = async || { println!("{}", *x.0); };
   |             ---------------------------------- borrow of `x` occurs here
LL |     outlives::<'a>(c());
LL |     outlives::<'a>(call_once(c));
   |                    ------------ argument requires that `x` is borrowed for `'a`
LL |
LL |     let c = async move || { println!("{}", *x.0); };
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move out of `x` occurs here

error[E0597]: `c` does not live long enough
  --> $DIR/without-precise-captures-we-are-powerless.rs:31:20
   |
LL | fn through_field<'a>(x: S<'a>) {
   |                  -- lifetime `'a` defined here
...
LL |     let c = async move || { println!("{}", *x.0); };
   |         - binding `c` declared here
LL |     outlives::<'a>(c());
   |                    ^--
   |                    |
   |                    borrowed value does not live long enough
   |                    argument requires that `c` is borrowed for `'a`
LL |     outlives::<'a>(call_once(c));
LL | }
   | - `c` dropped here while still borrowed

error[E0505]: cannot move out of `c` because it is borrowed
  --> $DIR/without-precise-captures-we-are-powerless.rs:32:30
   |
LL | fn through_field<'a>(x: S<'a>) {
   |                  -- lifetime `'a` defined here
...
LL |     let c = async move || { println!("{}", *x.0); };
   |         - binding `c` declared here
LL |     outlives::<'a>(c());
   |                    ---
   |                    |
   |                    borrow of `c` occurs here
   |                    argument requires that `c` is borrowed for `'a`
LL |     outlives::<'a>(call_once(c));
   |                              ^ move out of `c` occurs here

error[E0597]: `x` does not live long enough
  --> $DIR/without-precise-captures-we-are-powerless.rs:36:13
   |
LL | fn through_field_and_ref<'a>(x: &S<'a>) {
   |                          -- lifetime `'a` defined here
LL |     let c = async || { println!("{}", *x.0); };
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
LL |     outlives::<'a>(c());
LL |     outlives::<'a>(call_once(c));
   |                    ------------ argument requires that `x` is borrowed for `'a`
LL | }
   |  - `x` dropped here while still borrowed

error[E0621]: explicit lifetime required in the type of `x`
  --> $DIR/without-precise-captures-we-are-powerless.rs:38:20
   |
LL | fn through_field_and_ref<'a>(x: &S<'a>) {
   |                                 ------ help: add explicit lifetime `'a` to the type of `x`: `&'a S<'a>`
...
LL |     outlives::<'a>(call_once(c));
   |                    ^^^^^^^^^^^^ lifetime `'a` required

error[E0597]: `c` does not live long enough
  --> $DIR/without-precise-captures-we-are-powerless.rs:43:20
   |
LL | fn through_field_and_ref_move<'a>(x: &S<'a>) {
   |                               -- lifetime `'a` defined here
LL |     let c = async move || { println!("{}", *x.0); };
   |         - binding `c` declared here
LL |     outlives::<'a>(c());
   |                    ^--
   |                    |
   |                    borrowed value does not live long enough
   |                    argument requires that `c` is borrowed for `'a`
LL |     outlives::<'a>(call_once(c));
LL | }
   | - `c` dropped here while still borrowed

error[E0621]: explicit lifetime required in the type of `x`
  --> $DIR/without-precise-captures-we-are-powerless.rs:44:20
   |
LL | fn through_field_and_ref_move<'a>(x: &S<'a>) {
   |                                      ------ help: add explicit lifetime `'a` to the type of `x`: `&'a S<'a>`
...
LL |     outlives::<'a>(call_once(c));
   |                    ^^^^^^^^^^^^ lifetime `'a` required

error: aborting due to 10 previous errors

Some errors have detailed explanations: E0505, E0597, E0621.
For more information about an error, try `rustc --explain E0505`.