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