Closed
Description
#![feature(let_chains)]
trait FnCtxt {}
impl dyn FnCtxt {
pub fn report(&self) -> u32 {
let sum = |a: u32,
b: u32,
c: u32| {
a + b + c
};
sum(1, 2, 3)
}
fn check(&self, val: Option<u32>, num: Option<u32>) {
if let Some(b) = val
&& let Some(c) = num {
&& b == c {
}
}
}
fn main() { }
Current output is:
error: this file contains an unclosed delimiter
--> src/main.rs:22:15
|
4 | impl dyn FnCtxt {
| - unclosed delimiter
...
8 | c: u32| {
| - this delimiter might not be properly closed...
9 | a + b + c
10 | };
| - ...as it matches this but it has different indentation
...
22 | fn main() { }
| ^
It's error because indentation mismatch at line 8 and 10, ideally, we should report there is an extra {
at line 16.
Or we only show line 4~22 has unclosed delimiter
, wrong help message may mislead user.
The root cause is we use indentation width for checking possible position: