Skip to content

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Jul 3, 2022

No need to pass things through guess_head_span if they already point to the head span.

Only major change is that we point to the head span of enums on some errors now, which I prefer.

r? @cjgillot

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 3, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 3, 2022
@@ -31,8 +31,12 @@ LL | trait Trait: Sized {}
error[E0038]: the trait `Trait` cannot be made into an object
--> $DIR/wf-unsafe-trait-obj-match.rs:25:25
|
LL | let t: &dyn Trait = match opt() {
| ^^^^^^^^^^^ `Trait` cannot be made into an object
LL | let t: &dyn Trait = match opt() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think that this is more accurate than what we were doing before... I could potentially revert this one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this is more accurate. Why do you want to revert it?

@TaKO8Ki
Copy link
Member

TaKO8Ki commented Jul 4, 2022

This is related to my PR #98519.

@compiler-errors
Copy link
Member Author

Oh, sorry @TaKO8Ki, I didn't know you were working on this. I just saw this comment and wanted to remove more usages (mostly from typeck and trait selection).

Copy link
Contributor

@cjgillot cjgillot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @compiler-errors.
Do you mind if we wait for #98519 to land?

@@ -31,8 +31,12 @@ LL | trait Trait: Sized {}
error[E0038]: the trait `Trait` cannot be made into an object
--> $DIR/wf-unsafe-trait-obj-match.rs:25:25
|
LL | let t: &dyn Trait = match opt() {
| ^^^^^^^^^^^ `Trait` cannot be made into an object
LL | let t: &dyn Trait = match opt() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this is more accurate. Why do you want to revert it?

@compiler-errors
Copy link
Member Author

Yeah, I'll wait on that one. My bad for not checking if another guess_head_span-related PR was in flight.

@rustbot author

@rustbot rustbot 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-review Status: Awaiting review from the assignee but also interested parties. labels Jul 4, 2022
@bors
Copy link
Collaborator

bors commented Jul 6, 2022

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

@compiler-errors compiler-errors force-pushed the stop_guessing_head_span branch from cea8332 to 13ea003 Compare July 8, 2022 02:02
@rustbot
Copy link
Collaborator

rustbot commented Jul 8, 2022

Some changes occurred in src/tools/cargo

cc @ehuss

@compiler-errors compiler-errors force-pushed the stop_guessing_head_span branch from 13ea003 to 30191cf Compare July 8, 2022 02:11
@compiler-errors
Copy link
Member Author

I think this is ready.

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 8, 2022
db.span_help(
span.shrink_to_lo().to(def_span),
self.sess().source_map().guess_head_span(span),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we still need this one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise we'll point to a whole mod .. {} block span, e.g. in the src/test/ui/imports/unused-imports-in-test-module.stderr UI test.

@cjgillot cjgillot 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-review Status: Awaiting review from the assignee but also interested parties. labels Jul 11, 2022
@compiler-errors compiler-errors force-pushed the stop_guessing_head_span branch from 7b93b66 to fcfb3e9 Compare July 15, 2022 05:24
@compiler-errors
Copy link
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 15, 2022
@cjgillot
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 15, 2022

📌 Commit fcfb3e9 has been approved by cjgillot

It is now in the queue for this repository.

@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 Jul 15, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 15, 2022
Rollup of 5 pull requests

Successful merges:

 - rust-lang#88991 (Add Nintendo Switch as tier 3 target)
 - rust-lang#98869 (Remove some usages of `guess_head_span`)
 - rust-lang#99119 (Refactor: remove a string matching about methods)
 - rust-lang#99209 (Correctly handle crate level page on docs.rs as well)
 - rust-lang#99246 (Update RLS)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e0e6f1d into rust-lang:master Jul 15, 2022
@rustbot rustbot added this to the 1.64.0 milestone Jul 15, 2022
@compiler-errors compiler-errors deleted the stop_guessing_head_span branch August 11, 2023 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants