Skip to content

Commit b9f614a

Browse files
committed
Add regression test for #127424
1 parent 8fb32ab commit b9f614a

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
//~^ ERROR `main` function not found in crate `const_generics_closure` [E0601]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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[E0601]: `main` function not found in crate `const_generics_closure`
13+
--> $DIR/const-generics-closure.rs:11:2
14+
|
15+
LL | }
16+
| ^ consider adding a `main` function to `$DIR/const-generics-closure.rs`
17+
18+
error[E0308]: mismatched types
19+
--> $DIR/const-generics-closure.rs:4:10
20+
|
21+
LL | [u8; {
22+
| __________^
23+
LL | |
24+
LL | | let _ = for<'a, 'b> |x: &'a &'a Vec<&'b u32>, b: bool| -> &'a Vec<&'b u32> { *x };
25+
LL | |
26+
LL | | }],
27+
| |_____^ expected `usize`, found `()`
28+
29+
error: aborting due to 3 previous errors
30+
31+
Some errors have detailed explanations: E0308, E0601, E0658.
32+
For more information about an error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)