diff options
| author | yanglsh <yanglsh@shanghaitech.edu.cn> | 2025-05-03 20:31:47 +0800 |
|---|---|---|
| committer | yanglsh <yanglsh@shanghaitech.edu.cn> | 2025-05-06 14:25:21 +0800 |
| commit | e7acf5c9b91bf9f2bd79fbb1de77f65cdd73c8e5 (patch) | |
| tree | e3b84edae8bb5fe3bbea38035bf705d4f99ef841 /tests | |
| parent | 50e0bf1b71b802d51b4de8343ed3f4b48d0782b5 (diff) | |
| download | rust-e7acf5c9b91bf9f2bd79fbb1de77f65cdd73c8e5.tar.gz rust-e7acf5c9b91bf9f2bd79fbb1de77f65cdd73c8e5.zip | |
fix: `collapsible_if` FP on block stmt before expr
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/collapsible_if.fixed | 11 | ||||
| -rw-r--r-- | tests/ui/collapsible_if.rs | 11 |
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/collapsible_if.fixed b/tests/ui/collapsible_if.fixed index d62309fe08b..b553182a445 100644 --- a/tests/ui/collapsible_if.fixed +++ b/tests/ui/collapsible_if.fixed @@ -143,3 +143,14 @@ fn layout_check() -> u32 { ; 3 //~^^^^^ collapsible_if } + +fn issue14722() { + let x = if true { + Some(1) + } else { + if true { + println!("Some debug information"); + }; + None + }; +} diff --git a/tests/ui/collapsible_if.rs b/tests/ui/collapsible_if.rs index 0677b98bb5b..f5998457ca6 100644 --- a/tests/ui/collapsible_if.rs +++ b/tests/ui/collapsible_if.rs @@ -153,3 +153,14 @@ fn layout_check() -> u32 { }; 3 //~^^^^^ collapsible_if } + +fn issue14722() { + let x = if true { + Some(1) + } else { + if true { + println!("Some debug information"); + }; + None + }; +} |
