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
E0023 should have smaller, more targeted spans #86307
Currently, when a tuple pattern has a different number of fields than a tuple variant, the output is like the following:
error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 1 field
--> compiler/rustc_middle/src/ty/print/pretty.rs:634:27
|
634 | | ty::PredicateKind::ImplicitSizedTrait(pred, _) =
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 1 field, found 2
|
::: compiler/rustc_middle/src/ty/mod.rs:440:5
|
440 | ImplicitSizedTrait(TraitPredicate<'tcx>),
| ---------------------------------------- tuple variant defined here
Ideally, the primary span would be for the individual fields, with a secondary span pointing at the pattern path. As a stretch goal, when pointing at the definition we'd point at the fields in the same way, instead of the whole variant (but this isn't absolutely necessary).
Activity
Rollup merge of rust-lang#88123 - camelid:tup-pat-precise-spans, r=es…
Rollup merge of rust-lang#88123 - camelid:tup-pat-precise-spans, r=es…
Rollup merge of rust-lang#88123 - camelid:tup-pat-precise-spans, r=es…
Rollup merge of rust-lang#88123 - camelid:tup-pat-precise-spans, r=es…