Tweak output of resolve errors by estebank · Pull Request #126810 · rust-lang/rust (original) (raw)

error[E0576]: cannot find method or associated constant `BAR`
  --> $DIR/issue-87638.rs:20:27
   |
LL |     let _ = <S as Trait>::BAR;
   |                           ^^^ not found in trait `Trait`

instead of

error[E0576]: cannot find method or associated constant `BAR` in trait `Trait`
  --> $DIR/issue-87638.rs:20:27
   |
LL |     let _ = <S as Trait>::BAR;
   |                           ^^^ not found in `Trait`

The general rule is that the primary span label should work well on its own (suitable to be shown in editors), while the main message provides additional context of the general case. When using --error-format=short, we will concatenate the main message and the primary labels, so they should be complementary.