-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-async-closures`async || {}``async || {}`A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
Description
Code
#![feature(async_closure)]
fn main() {
let _ = || break;
let _ = async || break;
}
Current output
error[E0267]: `break` inside of a closure
--> src/main.rs:4:16
|
4 | let _ = || break;
| -- ^^^^^ cannot `break` inside of a closure
| |
| enclosing closure
error[E0267]: `break` inside of a closure
--> src/main.rs:5:22
|
5 | let _ = async || break;
| ^^^^^
| |
| cannot `break` inside of a closure
| enclosing closure
Desired output
...
error[E0267]: `break` inside of a closure
--> src/main.rs:5:13
|
5 | let _ = async || break;
| -------- ^^^^^
| | cannot `break` inside of a closure
| |
| enclosing closure
Rust Version
rustc 1.79.0-nightly (aed2187d5 2024-04-27)
binary: rustc
commit-hash: aed2187d53b8789e3a37f50ae36f894a2a679077
commit-date: 2024-04-27
host: x86_64-unknown-linux-gnu
release: 1.79.0-nightly
LLVM version: 18.1.4
compiler-errors
Metadata
Metadata
Assignees
Labels
A-async-closures`async || {}``async || {}`A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.