-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix unwind drop glue for if-then scopes
- Loading branch information
1 parent
837bf37
commit 4a2c1a1
Showing
6 changed files
with
90 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// issue #102317 | ||
// run-pass | ||
// compile-flags: --edition 2021 -C opt-level=3 -Zvalidate-mir | ||
|
||
struct SegmentJob; | ||
|
||
impl Drop for SegmentJob { | ||
fn drop(&mut self) {} | ||
} | ||
|
||
pub async fn run() -> Result<(), ()> { | ||
let jobs = Vec::<SegmentJob>::new(); | ||
let Some(_job) = jobs.into_iter().next() else { | ||
return Ok(()) | ||
}; | ||
|
||
Ok(()) | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// check-pass | ||
// compile-flags: -Z validate-mir | ||
#![feature(let_chains)] | ||
|
||
fn lambda<T, U>() -> U | ||
where | ||
T: Default, | ||
U: Default, | ||
{ | ||
let foo: Result<T, ()> = Ok(T::default()); | ||
let baz: U = U::default(); | ||
|
||
if let Ok(foo) = foo && let Ok(bar) = transform(foo) { | ||
bar | ||
} else { | ||
baz | ||
} | ||
} | ||
|
||
fn transform<T, U>(input: T) -> Result<U, ()> { | ||
todo!() | ||
} | ||
|
||
fn main() {} |