Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use note for pointing at bound introducing requirement #87668

Merged
merged 1 commit into from
Aug 17, 2021

Conversation

estebank
Copy link
Contributor

@estebank estebank commented Jul 31, 2021

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`

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 31, 2021
@rust-log-analyzer

This comment has been minimized.

@bors

This comment has been minimized.

@estebank estebank force-pushed the tweak-bound-output branch 2 times, most recently from 3dc31ba to 4f6aedd Compare August 12, 2021 10:38
@bors

This comment has been minimized.

@oli-obk
Copy link
Contributor

oli-obk commented Aug 13, 2021

@bors r+

@bors
Copy link
Contributor

bors commented Aug 13, 2021

📌 Commit 6ba8f4014ee54853ef1feef137b791f45434db6b has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 13, 2021
@bors
Copy link
Contributor

bors commented Aug 13, 2021

⌛ Testing commit 6ba8f4014ee54853ef1feef137b791f45434db6b with merge 8fede0d5477807ad58586f7ac253262b3a2b8e4c...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Aug 13, 2021

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 13, 2021
@estebank
Copy link
Contributor Author

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Aug 14, 2021

📌 Commit 86abc02437695649886c85a6e2b73d20a20989a7 has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 14, 2021
@bors
Copy link
Contributor

bors commented Aug 14, 2021

🔒 Merge conflict

This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again.

How do I rebase?

Assuming self is your fork and upstream is this repository, you can resolve the conflict following these steps:

  1. git checkout tweak-bound-output (switch to your branch)
  2. git fetch upstream master (retrieve the latest master)
  3. git rebase upstream/master -p (rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self tweak-bound-output --force-with-lease (update this PR)

You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial.

Please avoid the "Resolve conflicts" button on GitHub. It uses git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

Error message
Auto-merging src/test/ui/generic-associated-types/projection-bound-cycle.stderr
CONFLICT (content): Merge conflict in src/test/ui/generic-associated-types/projection-bound-cycle.stderr
Auto-merging src/test/ui/generic-associated-types/projection-bound-cycle-generic.stderr
CONFLICT (content): Merge conflict in src/test/ui/generic-associated-types/projection-bound-cycle-generic.stderr
Auto-merging compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
Automatic merge failed; fix conflicts and then commit the result.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 14, 2021
@bors
Copy link
Contributor

bors commented Aug 14, 2021

☔ The latest upstream changes (presumably #87375) made this pull request unmergeable. Please resolve the merge conflicts.

@estebank
Copy link
Contributor Author

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Aug 16, 2021

📌 Commit 39f220c has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 16, 2021
@bors
Copy link
Contributor

bors commented Aug 17, 2021

⌛ Testing commit 39f220c with merge aa8f27b...

@bors
Copy link
Contributor

bors commented Aug 17, 2021

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing aa8f27b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 17, 2021
@bors bors merged commit aa8f27b into rust-lang:master Aug 17, 2021
@rustbot rustbot added this to the 1.56.0 milestone Aug 17, 2021
@bors bors mentioned this pull request Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants