-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Remove some usages of guess_head_span
#98869
Remove some usages of guess_head_span
#98869
Conversation
@@ -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() { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
This is related to my PR #98519. |
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). |
There was a problem hiding this 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() { |
There was a problem hiding this comment.
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?
Yeah, I'll wait on that one. My bad for not checking if another @rustbot author |
☔ The latest upstream changes (presumably #98987) made this pull request unmergeable. Please resolve the merge conflicts. |
cea8332
to
13ea003
Compare
Some changes occurred in src/tools/cargo cc @ehuss |
13ea003
to
30191cf
Compare
I think this is ready. @rustbot ready |
db.span_help( | ||
span.shrink_to_lo().to(def_span), | ||
self.sess().source_map().guess_head_span(span), |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
7b93b66
to
fcfb3e9
Compare
@rustbot ready |
@bors r+ |
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
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
enum
s on some errors now, which I prefer.r? @cjgillot