Add regression test for #127424
This commit is contained in:
parent
8fb32ab8e5
commit
11256a0fb0
2 changed files with 39 additions and 0 deletions
|
|
@ -0,0 +1,13 @@
|
|||
// Regression test for issue #127424
|
||||
|
||||
fn bar() -> impl Into<
|
||||
[u8; {
|
||||
//~^ ERROR mismatched types [E0308]
|
||||
let _ = for<'a, 'b> |x: &'a &'a Vec<&'b u32>, b: bool| -> &'a Vec<&'b u32> { *x };
|
||||
//~^ ERROR `for<...>` binders for closures are experimental [E0658]
|
||||
}],
|
||||
> {
|
||||
[89]
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
error[E0658]: `for<...>` binders for closures are experimental
|
||||
--> $DIR/const-generics-closure.rs:6:17
|
||||
|
|
||||
LL | let _ = for<'a, 'b> |x: &'a &'a Vec<&'b u32>, b: bool| -> &'a Vec<&'b u32> { *x };
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #97362 <https://github.com/rust-lang/rust/issues/97362> for more information
|
||||
= help: add `#![feature(closure_lifetime_binder)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: consider removing `for<...>`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/const-generics-closure.rs:4:10
|
||||
|
|
||||
LL | [u8; {
|
||||
| __________^
|
||||
LL | |
|
||||
LL | | let _ = for<'a, 'b> |x: &'a &'a Vec<&'b u32>, b: bool| -> &'a Vec<&'b u32> { *x };
|
||||
LL | |
|
||||
LL | | }],
|
||||
| |_____^ expected `usize`, found `()`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0308, E0658.
|
||||
For more information about an error, try `rustc --explain E0308`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue