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
{{ message }}
Repository navigation
Spans for errors in try operator expressions are not great #42234
error: the type of this value must be known in this context
--> src/librustc_save_analysis/sig.rs:281:39
|
281 | let generics: Signature = generics.make(offset + text.len(), id, scx)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
the expression with unknown type is the variable use generics, but the error highlight covers the entire sub-expression of expr?. I assume this is due to us doing something sub-optimal with the spans here in the HIR lowering.
fnfoo() -> Result<(),()>{let x = None;Ok(x.unwrap().make()?)}fnmain(){}
gives
rustc 1.17.0 (56124baa9 2017-04-24)
error: the type of this value must be known in this context
--> <anon>:3:8
|
3 | Ok(x.unwrap().make()?)
| ^^^^^^^^^^^^^^^^^
error: aborting due to previous error
Doesn't seem like a "stop everything" sort of problem, but would be good to figure it out. However, it does not appear to be a regression: e.g., the above test case behaves the same in 1.16.0 as well.
Activity
aturon commentedon Jun 7, 2017
@nrc is worried that similar issues are arising with other desugarings, i.e. that this might be an across-the-board regression. Worth investigating.
nikomatsakis commentedon Jun 8, 2017
Standalone example:
gives
nikomatsakis commentedon Jun 8, 2017
triage: P-medium
Doesn't seem like a "stop everything" sort of problem, but would be good to figure it out. However, it does not appear to be a regression: e.g., the above test case behaves the same in 1.16.0 as well.
correct E0619 span re method call receivers whose type must be known
Rollup merge of rust-lang#48028 - zackmdavis:and_the_span_of_the_unkn…