You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like #14503. has been happening since then and i was waiting for the fix to be published, but it looks like rust-analyzer was released with the fix and my issue persists.
in this function, which notably has a try-block, containing a closure that returns a Result, and within the closure uses the ? syntax:
fn_do_thing(){let r: anyhow::Result<()> = try {let v = vec![1,2,3];
v.iter().map(|i| {let result = Some("hi").ok_or(anyhow::anyhow!("bad"));
result?;// this line has error
anyhow::Ok(i)}).collect::<anyhow::Result<Vec<_>>>()?;};
r.unwrap();}
We get a "break outside of loop" error, which is interesting because the code contains no break statements.
Note in contrast to #14503, there is nothing async here -- instead we have a try block enabled by #![feature(try_blocks)]
rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)
happens in pre-release and release which are both rust-analyzer version: 0.3.1498-standalone (3a27518fe 2023-04-30)
Looks like #14503. has been happening since then and i was waiting for the fix to be published, but it looks like rust-analyzer was released with the fix and my issue persists.
in this function, which notably has a try-block, containing a closure that returns a Result, and within the closure uses the
?
syntax:We get a "break outside of loop" error, which is interesting because the code contains no break statements.
Note in contrast to #14503, there is nothing async here -- instead we have a try block enabled by
#![feature(try_blocks)]
rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)
happens in pre-release and release which are both
rust-analyzer version: 0.3.1498-standalone (3a27518fe 2023-04-30)
rustc version: (eg. output of
rustc -V
)rustc 1.69.0-nightly (31f858d9a 2023-02-28)
relevant settings: (eg. client settings, or environment variables like
CARGO
,RUSTC
,RUSTUP_HOME
orCARGO_HOME
)The text was updated successfully, but these errors were encountered: