]>
Commit | Line | Data |
---|---|---|
dfeec247 | 1 | note: external requirements |
0731742a | 2 | --> $DIR/ty-param-closure-outlives-from-where-clause.rs:27:26 |
ff7c6d11 | 3 | | |
0531ce1d | 4 | LL | with_signature(a, b, |x, y| { |
ff7c6d11 | 5 | | __________________________^ |
532ac7d7 | 6 | LL | | |
0531ce1d XL |
7 | LL | | // |
8 | LL | | // See `correct_region`, which explains the point of this | |
ff7c6d11 | 9 | ... | |
b7449926 | 10 | LL | | require(&x, &y) |
0531ce1d | 11 | LL | | }) |
ff7c6d11 XL |
12 | | |_____^ |
13 | | | |
1b1a35ee | 14 | = note: defining type: no_region::<T>::{closure#0} with closure substs [ |
ff7c6d11 | 15 | i32, |
532ac7d7 | 16 | extern "rust-call" fn((std::cell::Cell<&'_#1r ()>, T)), |
ba9703b0 | 17 | (), |
ff7c6d11 | 18 | ] |
b7449926 XL |
19 | = note: late-bound region is '_#2r |
20 | = note: number of external vids: 3 | |
ff7c6d11 XL |
21 | = note: where T: '_#1r |
22 | ||
dfeec247 | 23 | note: no external requirements |
0731742a | 24 | --> $DIR/ty-param-closure-outlives-from-where-clause.rs:26:1 |
0531ce1d XL |
25 | | |
26 | LL | / fn no_region<'a, T>(a: Cell<&'a ()>, b: T) { | |
27 | LL | | with_signature(a, b, |x, y| { | |
532ac7d7 | 28 | LL | | |
0531ce1d XL |
29 | LL | | // |
30 | ... | | |
31 | LL | | }) | |
32 | LL | | } | |
33 | | |_^ | |
34 | | | |
60c5eb7d | 35 | = note: defining type: no_region::<T> |
0531ce1d | 36 | |
b7449926 | 37 | error[E0309]: the parameter type `T` may not live long enough |
0731742a | 38 | --> $DIR/ty-param-closure-outlives-from-where-clause.rs:27:26 |
b7449926 XL |
39 | | |
40 | LL | with_signature(a, b, |x, y| { | |
41 | | __________________________^ | |
532ac7d7 | 42 | LL | | |
b7449926 XL |
43 | LL | | // |
44 | LL | | // See `correct_region`, which explains the point of this | |
45 | ... | | |
46 | LL | | require(&x, &y) | |
47 | LL | | }) | |
48 | | |_____^ | |
49 | | | |
dfeec247 | 50 | = help: consider adding an explicit lifetime bound `T: 'a`... |
b7449926 | 51 | |
dfeec247 | 52 | note: external requirements |
0731742a | 53 | --> $DIR/ty-param-closure-outlives-from-where-clause.rs:43:26 |
ff7c6d11 | 54 | | |
0531ce1d | 55 | LL | with_signature(a, b, |x, y| { |
ff7c6d11 | 56 | | __________________________^ |
0531ce1d XL |
57 | LL | | // Key point of this test: |
58 | LL | | // | |
59 | LL | | // The *closure* is being type-checked with all of its free | |
ff7c6d11 | 60 | ... | |
0531ce1d XL |
61 | LL | | require(&x, &y) |
62 | LL | | }) | |
ff7c6d11 XL |
63 | | |_____^ |
64 | | | |
1b1a35ee | 65 | = note: defining type: correct_region::<'_#1r, T>::{closure#0} with closure substs [ |
ff7c6d11 | 66 | i32, |
532ac7d7 | 67 | extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), |
ba9703b0 | 68 | (), |
ff7c6d11 | 69 | ] |
b7449926 | 70 | = note: number of external vids: 3 |
ff7c6d11 XL |
71 | = note: where T: '_#2r |
72 | ||
dfeec247 | 73 | note: no external requirements |
0731742a | 74 | --> $DIR/ty-param-closure-outlives-from-where-clause.rs:39:1 |
ff7c6d11 | 75 | | |
0531ce1d XL |
76 | LL | / fn correct_region<'a, T>(a: Cell<&'a ()>, b: T) |
77 | LL | | where | |
78 | LL | | T: 'a, | |
79 | LL | | { | |
80 | ... | | |
81 | LL | | }) | |
82 | LL | | } | |
83 | | |_^ | |
ff7c6d11 | 84 | | |
60c5eb7d | 85 | = note: defining type: correct_region::<'_#1r, T> |
ff7c6d11 | 86 | |
dfeec247 | 87 | note: external requirements |
0731742a | 88 | --> $DIR/ty-param-closure-outlives-from-where-clause.rs:64:26 |
ff7c6d11 | 89 | | |
0531ce1d | 90 | LL | with_signature(a, b, |x, y| { |
ff7c6d11 | 91 | | __________________________^ |
532ac7d7 | 92 | LL | | |
0531ce1d XL |
93 | LL | | // See `correct_region` |
94 | LL | | require(&x, &y) | |
0531ce1d | 95 | LL | | }) |
ff7c6d11 XL |
96 | | |_____^ |
97 | | | |
1b1a35ee | 98 | = note: defining type: wrong_region::<'_#1r, T>::{closure#0} with closure substs [ |
ff7c6d11 | 99 | i32, |
532ac7d7 | 100 | extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), |
ba9703b0 | 101 | (), |
ff7c6d11 | 102 | ] |
b7449926 XL |
103 | = note: late-bound region is '_#3r |
104 | = note: number of external vids: 4 | |
0531ce1d | 105 | = note: where T: '_#2r |
ff7c6d11 | 106 | |
dfeec247 | 107 | note: no external requirements |
0731742a | 108 | --> $DIR/ty-param-closure-outlives-from-where-clause.rs:60:1 |
ff7c6d11 | 109 | | |
0531ce1d XL |
110 | LL | / fn wrong_region<'a, 'b, T>(a: Cell<&'a ()>, b: T) |
111 | LL | | where | |
112 | LL | | T: 'b, | |
113 | LL | | { | |
ff7c6d11 | 114 | ... | |
0531ce1d XL |
115 | LL | | }) |
116 | LL | | } | |
ff7c6d11 XL |
117 | | |_^ |
118 | | | |
60c5eb7d | 119 | = note: defining type: wrong_region::<'_#1r, T> |
ff7c6d11 | 120 | |
b7449926 | 121 | error[E0309]: the parameter type `T` may not live long enough |
0731742a | 122 | --> $DIR/ty-param-closure-outlives-from-where-clause.rs:64:26 |
b7449926 XL |
123 | | |
124 | LL | with_signature(a, b, |x, y| { | |
125 | | __________________________^ | |
532ac7d7 | 126 | LL | | |
b7449926 XL |
127 | LL | | // See `correct_region` |
128 | LL | | require(&x, &y) | |
129 | LL | | }) | |
130 | | |_____^ | |
131 | | | |
dfeec247 | 132 | = help: consider adding an explicit lifetime bound `T: 'a`... |
b7449926 | 133 | |
dfeec247 | 134 | note: external requirements |
0731742a | 135 | --> $DIR/ty-param-closure-outlives-from-where-clause.rs:77:26 |
ff7c6d11 | 136 | | |
0531ce1d | 137 | LL | with_signature(a, b, |x, y| { |
ff7c6d11 | 138 | | __________________________^ |
0531ce1d XL |
139 | LL | | // See `correct_region` |
140 | LL | | require(&x, &y) | |
141 | LL | | }) | |
ff7c6d11 XL |
142 | | |_____^ |
143 | | | |
1b1a35ee | 144 | = note: defining type: outlives_region::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ |
0531ce1d | 145 | i32, |
532ac7d7 | 146 | extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), |
ba9703b0 | 147 | (), |
ff7c6d11 | 148 | ] |
b7449926 | 149 | = note: number of external vids: 4 |
0531ce1d | 150 | = note: where T: '_#3r |
ff7c6d11 | 151 | |
dfeec247 | 152 | note: no external requirements |
0731742a | 153 | --> $DIR/ty-param-closure-outlives-from-where-clause.rs:72:1 |
ff7c6d11 | 154 | | |
0531ce1d XL |
155 | LL | / fn outlives_region<'a, 'b, T>(a: Cell<&'a ()>, b: T) |
156 | LL | | where | |
157 | LL | | T: 'b, | |
158 | LL | | 'b: 'a, | |
ff7c6d11 | 159 | ... | |
0531ce1d XL |
160 | LL | | }) |
161 | LL | | } | |
ff7c6d11 XL |
162 | | |_^ |
163 | | | |
60c5eb7d | 164 | = note: defining type: outlives_region::<'_#1r, '_#2r, T> |
ff7c6d11 XL |
165 | |
166 | error: aborting due to 2 previous errors | |
167 | ||
0531ce1d | 168 | For more information about this error, try `rustc --explain E0309`. |