Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
14e59bb317c3c901bce83deb16ee9bfa5cc90e28
rust/tests/ui/async-await/issue-93197.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
303 B
Rust
Raw Normal View History

Add regression test for #93197
2022-01-25 15:19:33 -08:00
// Regression test for #93197
Change test to check-pass
2022-01-26 10:47:13 -08:00
// check-pass
Add regression test for #93197
2022-01-25 15:19:33 -08:00
// edition:2021
Drop tracking: improve break and continue handling This commit fixes two issues. One, sometimes break or continue have a block target instead of an expression target. This seems to mainly happen with try blocks. Since the drop tracking analysis only works on expressions, if we see a block target for break or continue, we substitute the last expression of the block as the target instead. Two, break and continue were incorrectly being treated as the same, so continue would also show up as an exit from the loop or block. This patch corrects the way continue is handled by keeping a stack of loop entry points and uses those to find the target of the continue.
2022-01-25 16:13:07 -08:00
// compile-flags: -Zdrop-tracking
Add regression test for #93197
2022-01-25 15:19:33 -08:00
#![feature(try_blocks)]
use std::sync::{mpsc, mpsc::SendError};
pub async fn foo() {
let (tx, _) = mpsc::channel();
let _: Result<(), SendError<&str>> = try { tx.send("hello")?; };
}
fn main() {}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 733ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API