Skip to content
/ rust Public
forked from rust-lang/rust

Commit 11256a0

Browse files
committed
Add regression test for rust-lang#127424
1 parent 8fb32ab commit 11256a0

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Regression test for issue #127424
2+
3+
fn bar() -> impl Into<
4+
[u8; {
5+
//~^ ERROR mismatched types [E0308]
6+
let _ = for<'a, 'b> |x: &'a &'a Vec<&'b u32>, b: bool| -> &'a Vec<&'b u32> { *x };
7+
//~^ ERROR `for<...>` binders for closures are experimental [E0658]
8+
}],
9+
> {
10+
[89]
11+
}
12+
13+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
error[E0658]: `for<...>` binders for closures are experimental
2+
--> $DIR/const-generics-closure.rs:6:17
3+
|
4+
LL | let _ = for<'a, 'b> |x: &'a &'a Vec<&'b u32>, b: bool| -> &'a Vec<&'b u32> { *x };
5+
| ^^^^^^^^^^^
6+
|
7+
= note: see issue #97362 <https://github.com/rust-lang/rust/issues/97362> for more information
8+
= help: add `#![feature(closure_lifetime_binder)]` to the crate attributes to enable
9+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
10+
= help: consider removing `for<...>`
11+
12+
error[E0308]: mismatched types
13+
--> $DIR/const-generics-closure.rs:4:10
14+
|
15+
LL | [u8; {
16+
| __________^
17+
LL | |
18+
LL | | let _ = for<'a, 'b> |x: &'a &'a Vec<&'b u32>, b: bool| -> &'a Vec<&'b u32> { *x };
19+
LL | |
20+
LL | | }],
21+
| |_____^ expected `usize`, found `()`
22+
23+
error: aborting due to 2 previous errors
24+
25+
Some errors have detailed explanations: E0308, E0658.
26+
For more information about an error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)