Skip to content

Remove some uses of guess_head_span #99911

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

Merged
merged 3 commits into from
Aug 1, 2022
Merged

Conversation

cjgillot
Copy link
Contributor

That function cuts a span at the first occurrence of {. Using def_span is almost always more precise.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 29, 2022
@rust-highfive
Copy link
Contributor

r? @davidtwco

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 29, 2022
@@ -8,8 +8,13 @@ LL | trait Foo<X = Box<dyn Foo>> {
note: cycle used when collecting item types in top-level module
--> $DIR/cycle-trait-default-type-trait.rs:4:1
|
LL | trait Foo<X = Box<dyn Foo>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | / trait Foo<X = Box<dyn Foo>> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This span was wrong, as it's supposed to point to the module.

Copy link
Member

@davidtwco davidtwco left a comment

Choose a reason for hiding this comment

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

One nit, otherwise LGTM, r=me when CI passes

let fix_span = |span: Span, query: &QueryStackFrame| {
sess.source_map().guess_head_span(query.default_span(span))
};
let fix_span = |span: Span, query: &QueryStackFrame| query.default_span(span);
Copy link
Member

Choose a reason for hiding this comment

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

nit: does it still make sense to have a closure for this?

@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 1, 2022

📌 Commit 2134dd3 has been approved by davidtwco

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 Aug 1, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 1, 2022
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#99340 (Fix ICE in Definitions::create_def)
 - rust-lang#99629 (Improve `cannot move out of` error message)
 - rust-lang#99864 (bootstrap: don't emit warn about duplicated deps with same/different features if some of sets actually empty)
 - rust-lang#99911 (Remove some uses of `guess_head_span`)
 - rust-lang#99976 (Make Rustdoc exit with correct error code when scraping examples from invalid files)
 - rust-lang#100003 (Improve size assertions.)
 - rust-lang#100012 (Avoid `Ty` to `String` conversions)
 - rust-lang#100020 (better error when python is not found in x - issue rust-lang#99648)

Failed merges:

 - rust-lang#99994 (Replace `guess_head_span` with `opt_span`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 8db3d7c into rust-lang:master Aug 1, 2022
@rustbot rustbot added this to the 1.64.0 milestone Aug 1, 2022
@cjgillot cjgillot deleted the no-guess branch August 1, 2022 19:04
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.

5 participants