Closed
Description
Code
fn enum_upvar() {
type T = impl Copy;
let foo: T = Some((1u32, 2u32));
let x = move || {
match foo {
None => (),
Some(yield) => (),
}
};
}
fn main() {}
Meta
rustc --version --verbose
:
rustc version: 1.81.0-nightly (5affbb171 2024-07-18)
platform: x86_64-unknown-linux-gnu
Error output
error: expected identifier, found reserved keyword `yield`
--> f94.rs:7:18
|
7 | Some(yield) => (),
| ^^^^^ expected identifier, found reserved keyword
|
help: escape `yield` to use it as an identifier
|
7 | Some(r#yield) => (),
| ++
error[E0658]: `impl Trait` in type aliases is unstable
--> f94.rs:2:14
|
2 | type T = impl Copy;
| ^^^^^^^^^
|
= note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
= note: this compiler was built on 2024-07-18; consider upgrading it if it is out of date
warning: unused variable: `x`
--> f94.rs:4:9
|
4 | let x = move || {
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
= note: `#[warn(unused_variables)]` on by default
thread 'rustc' panicked at compiler/rustc_mir_build/src/build/matches/mod.rs:1819:44:
called `Option::unwrap()` on a `None` value
rust/compiler/rustc_mir_build/src/build/matches/mod.rs
Lines 1814 to 1815 in 411fcb6
Backtrace attached
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
estebank commentedon Jul 19, 2024
cc @Nadrieril
matthiaskrgr commentedon Jul 19, 2024
duplicate of #119786