Skip to content

Give def_span the same SyntaxContext as span_with_body. #102538

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 1 commit into from
Oct 2, 2022

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Oct 1, 2022

#102217

I'm not sure how to add a test, since the erroneous span was crafted using a proc macro.
The debug assertion in def_span will ensure we have the correct behaviour.

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

r? @fee1-dead

(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 Oct 1, 2022
Copy link
Member

@fee1-dead fee1-dead left a comment

Choose a reason for hiding this comment

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

Could you try adding an ui test by following how auxiliary files such as https://github.com/rust-lang/rust/blob/master/src/test/ui/proc-macro/auxiliary/span-from-proc-macro.rs work?

@fee1-dead fee1-dead 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 Oct 2, 2022
@fee1-dead
Copy link
Member

@bors r+

Marked the issue as needs-test, we could land this first

@bors
Copy link
Collaborator

bors commented Oct 2, 2022

📌 Commit c321933 has been approved by fee1-dead

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 2, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Oct 2, 2022
Give `def_span` the same SyntaxContext as `span_with_body`.

rust-lang#102217

I'm not sure how to add a test, since the erroneous span was crafted using a proc macro.
The debug assertion in `def_span` will ensure we have the correct behaviour.
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Oct 2, 2022
Give `def_span` the same SyntaxContext as `span_with_body`.

rust-lang#102217

I'm not sure how to add a test, since the erroneous span was crafted using a proc macro.
The debug assertion in `def_span` will ensure we have the correct behaviour.
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 2, 2022
Rollup of 5 pull requests

Successful merges:

 - rust-lang#100451 (Do not panic when a test function returns Result::Err.)
 - rust-lang#102098 (Use fetch_update in sync::Weak::upgrade)
 - rust-lang#102538 (Give `def_span` the same SyntaxContext as `span_with_body`.)
 - rust-lang#102556 (Make `feature(const_btree_len)` implied by `feature(const_btree_new)`)
 - rust-lang#102566 (Add a known-bug test for rust-lang#102498)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f3ab5a6 into rust-lang:master Oct 2, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 2, 2022
@cjgillot cjgillot deleted the def-span-ctxt branch October 8, 2022 09:51
Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
Give `def_span` the same SyntaxContext as `span_with_body`.

rust-lang#102217

I'm not sure how to add a test, since the erroneous span was crafted using a proc macro.
The debug assertion in `def_span` will ensure we have the correct behaviour.
Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
Rollup of 5 pull requests

Successful merges:

 - rust-lang#100451 (Do not panic when a test function returns Result::Err.)
 - rust-lang#102098 (Use fetch_update in sync::Weak::upgrade)
 - rust-lang#102538 (Give `def_span` the same SyntaxContext as `span_with_body`.)
 - rust-lang#102556 (Make `feature(const_btree_len)` implied by `feature(const_btree_new)`)
 - rust-lang#102566 (Add a known-bug test for rust-lang#102498)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
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