-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Conversation
r? @davidtwco (rust-highfive has picked a reviewer for you, use r? to override) |
@@ -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>> { |
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.
This span was wrong, as it's supposed to point to the module.
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.
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); |
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.
nit: does it still make sense to have a closure for this?
@bors r+ |
…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
That function cuts a span at the first occurrence of
{
. Usingdef_span
is almost always more precise.