<!-- Troubleshooting guide: https://rust-analyzer.github.io/book/troubleshooting.html Forum for questions: https://users.rust-lang.org/c/ide/14 Before submitting, please make sure that you're not running into one of these known issues: 1. on-the-fly diagnostics are mostly unimplemented (`cargo check` diagnostics will be shown when saving a file): #3107 Otherwise please try to provide information which will help us to fix the issue faster. Minimal reproducible examples with few dependencies are especially lovely <3. --> **rust-analyzer version**: rust-analyzer 0.3.2870-standalone **rustc version**: rustc 1.97.0-nightly (913e4bea8 2026-04-22) **editor or extension**: Vim **code snippet to reproduce**: ```rust fn main() { if true { "".to_owned() } else { "" }; if true { "".to_owned() } else { "" }.to_owned(); // fixed if false { "" } else { "".to_owned() }; if false { "" } else &{ "".to_owned() }; // fixed if false { Some(2) } else { 2 }; if false { Some(2) } else Some({ 2 }); // fixed } ``` Similar to #19428, but not a macro, which may be easier to fix
Activity