Skip to content
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

Include the span of attributes of the lhs to the span of the assignment expression #58116

Merged
merged 1 commit into from
Feb 5, 2019

Conversation

topecongiro
Copy link
Contributor

This PR adds the span of attributes of the lhs to the span of the assignment expression. Currently with the following code, #[attr] is not included to the span of the assignment (foo = true).

#[attr]
foo = true;

The rational behind this change is that as libsyntax user I expect the span of the parent node includes every span of child nodes.

cc rust-lang/rustfmt#3313, #15701.

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(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 Feb 3, 2019
@petrochenkov
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 3, 2019

📌 Commit 9851a29 has been approved by petrochenkov

@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 Feb 3, 2019
kennytm added a commit to kennytm/rust that referenced this pull request Feb 5, 2019
…r=petrochenkov

Include the span of attributes of the lhs to the span of the assignment expression

This PR adds the span of attributes of the lhs to the span of the assignment expression. Currently with the following code, `#[attr]` is not included to the span of the assignment (`foo = true`).

```rust
#[attr]
foo = true;
```
The rational behind this change is that as libsyntax user I expect the span of the parent node includes every span of child nodes.

cc rust-lang/rustfmt#3313, rust-lang#15701.
bors added a commit that referenced this pull request Feb 5, 2019
Rollup of 23 pull requests

Successful merges:

 - #58001 (proc_macro: make `TokenStream::from_streams` pre-allocate its vector.)
 - #58096 (Transition linkchecker to 2018 edition)
 - #58097 (Transition remote test to Rust 2018)
 - #58106 (libfmt_macros => 2018)
 - #58107 (libgraphviz => 2018)
 - #58108 (Add NVPTX target to a build manifest)
 - #58109 (librustc_privacy => 2018)
 - #58112 (libpanic_abort => 2018)
 - #58113 (Transition build-manifest to 2018 edition)
 - #58114 (Transition tidy and unstable-book-gen to 2018 edition)
 - #58116 (Include the span of attributes of the lhs to the span of the assignment expression)
 - #58117 (Transition rustdoc-theme to 2018 edition)
 - #58128 (libunwind => 2018)
 - #58138 (Fix #58101)
 - #58139 (hir: add more HirId methods)
 - #58141 (Remove weasel word in docs for iter's take_while())
 - #58142 (Remove stray FIXME)
 - #58145 (Add #[must_use] to core::task::Poll)
 - #58162 (Add more debugging code to track down appveyor 259 exit code)
 - #58169 (Update contributor name in .mailmap)
 - #58172 (update split docs)
 - #58182 (SGX target: handle empty user buffers correctly)
 - #58186 (Add Rustlings to the doc index)

Failed merges:

r? @ghost
@bors bors merged commit 9851a29 into rust-lang:master Feb 5, 2019
@topecongiro topecongiro deleted the wrong-span-assignment branch February 6, 2019 00:59
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants