about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/transform/coverage/mod.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-08-17 06:59:49 +0000
committerbors <bors@rust-lang.org>2021-08-17 06:59:49 +0000
commitaa8f27bf4d980023a8b245ceb25a490a18041eb2 (patch)
tree5d880bb63b71a336b5e023371d723eb3ed1e5951 /compiler/rustc_mir/src/transform/coverage/mod.rs
parent3b5df014390dcef66cc35f968fe51e9558e6ca13 (diff)
parent39f220ce1295c894fdf9dce5fd1e20bda282e6cb (diff)
downloadrust-aa8f27bf4d980023a8b245ceb25a490a18041eb2.tar.gz
rust-aa8f27bf4d980023a8b245ceb25a490a18041eb2.zip
Auto merge of #87668 - estebank:tweak-bound-output, r=oli-obk
Use note for pointing at bound introducing requirement

Modify output for pointing where a trait bound obligation is introduced in an E0277 from using a span label to using a note in order to always preserve order of the output:

Before:
```
error[E0277]: `<<Self as Case1>::A as Iterator>::Item` doesn't implement `Debug`
  --> $DIR/bounds-on-assoc-in-trait.rs:18:28
   |
LL |     type A: Iterator<Item: Debug>;
   |                            ^^^^^ `<<Self as Case1>::A as Iterator>::Item` cannot be formatted using `{:?}` because it doesn't implement `Debug`
   |
  ::: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
   |
LL | pub trait Debug {
   | --------------- required by this bound in `Debug`
   |
   = help: the trait `Debug` is not implemented for `<<Self as Case1>::A as Iterator>::Item`
```
After:
```
error[E0277]: `<<Self as Case1>::A as Iterator>::Item` doesn't implement `Debug`
  --> $DIR/bounds-on-assoc-in-trait.rs:18:28
   |
LL |     type A: Iterator<Item: Debug>;
   |                            ^^^^^ `<<Self as Case1>::A as Iterator>::Item` cannot be formatted using `{:?}` because it doesn't implement `Debug`
   |
   = help: the trait `Debug` is not implemented for `<<Self as Case1>::A as Iterator>::Item`
note: required by a bound in `Debug`
  --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
   |
LL | pub trait Debug {
   | ^^^^^^^^^^^^^^^ required by this bound in `Debug`
```
Diffstat (limited to 'compiler/rustc_mir/src/transform/coverage/mod.rs')
0 files changed, 0 insertions, 0 deletions