Uh oh!
There was an error while loading. Please reload this page.
Emit data::Impl in save-analysis - #47657
Conversation
rust-highfive
commented
Jan 22, 2018
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
algesten
commented
Jan 22, 2018
It's specifically @nrc that needs to look at this PR to guide me in completing the work. |
jonhoo
commented
Jan 22, 2018
algesten
commented
Jan 22, 2018
r? @nrc |
algesten
commented
Jan 22, 2018
Thanks @jonhoo I was aware of the feature but unsure whether it applied to wip stuff. |
shepmaster
commented
Jan 26, 2018
Ping from triage, @nrc! |
There was a problem hiding this comment.
Using the cast macro rather than if let here is preferred.
There was a problem hiding this comment.
@nrc but the cast macro is written for super::Data enclosing one value. Since this is the only data emitting two values, I though it cleaner make this an exeption rather than changing the macro to handle a tuple as well.
There was a problem hiding this comment.
Yes, this should be the enclosing module
There was a problem hiding this comment.
@nrc sorry I feel stupid here. can I actually get the parent module? All other match arms of ast::ImplKind set parent: None. Is this case different?
There was a problem hiding this comment.
This is fine (I don't think we'll ever use it)
There was a problem hiding this comment.
There might be attributes on the impl that should be recorded here (I think). We don't need anything else. For docs and sig, we can leave them as they are (though I would prefer to use only one way to make an empty string).
There was a problem hiding this comment.
@nrc Unless I'm looking in the wrong place, there doesn't seem to be any attrs on the Impl level (there are on the ImplItem level).
https://manishearth.github.io/rust-internals-docs/syntax/ast/enum.ItemKind.html
There was a problem hiding this comment.
You can just use the 64 bit hash - iirc, we use 32 bits for a local id (NodeId) and 64 for a global id (DefId)
nrc
commented
Jan 29, 2018
So, having thought this through a little bit, I think the hashing scheme might be overkill (sorry). We could just use the count of impls as the id, as long as clients ensure that impl ids are in a separate namespace from other ids, then I think everything will be OK (and that should be OK, since impl ids and def ids are not interchangeable). |
algesten
commented
Jan 29, 2018
Ok. I remove the hashing. |
nrc
commented
Feb 1, 2018
OK, this all looks. I've merged your changes to rls-data and released that as version 0.15. Could you also squash your commits please? |
algesten
commented
Feb 1, 2018
Here's the new output. It looks ok. {
"impls": [
{
"id": 0,
"kind": "Direct",
"span": {
"file_name": [
115,
114,
99,
47,
109,
97,
105,
110,
46,
114,
115
],
"byte_start": 234,
"byte_end": 242,
"line_start": 15,
"line_end": 15,
"column_start": 22,
"column_end": 30
},
"value": "",
"parent": null,
"children": [
{
"krate": 0,
"index": 22
},
{
"krate": 0,
"index": 24
}
],
"docs": "",
"sig": null,
"attributes": []
}
]
} |
8f033f1 to
c7709fdComparealgesten
commented
Feb 1, 2018
@nrc I've updated to rls-data 0.15 and squashed the commits. |
algesten
commented
Feb 1, 2018
Hm. maybe i rebase.. |
c7709fd to
93d3ebcComparenrc
commented
Feb 2, 2018
I think you don't want to change the submodules which are included in this PR? But you probably do need to build (and maybe update) in order to get rls-data 0.15 into the Cargo.lock |
algesten
commented
Feb 2, 2018
Oh. I check. |
93d3ebc to
38c517cComparealgesten
commented
Feb 2, 2018
@nrc sorted. submodule free and one Cargo.lock. |
algesten
commented
Feb 2, 2018
and rebased off master again. |
nrc
commented
Feb 5, 2018
Thanks! @bors: r+ |
bors
commented
Feb 5, 2018
📌 Commit 38c517c has been approved by |
bors
commented
Feb 5, 2018
🔒 Merge conflict |
algesten
commented
Feb 5, 2018
@nrc do i rebase off master again? |
kennytm
commented
Feb 5, 2018
@algesten Yes please rebase. Also, remove the |
Why this PR is always merge-conflicting 😂 (Please rebase again) |
f70dddd to
9a6afa8Comparealgesten
commented
Feb 10, 2018
Done |
shepmaster
commented
Feb 10, 2018
@bors r=nrc |
bors
commented
Feb 10, 2018
📌 Commit 9a6afa8 has been approved by |
bors
commented
Feb 10, 2018
Emit data::Impl in save-analysis As discussed on [internals.rust-lang](https://internals.rust-lang.org/t/rustdoc2-rls-analysis-and-the-compiler-help-wanted/6592/5), this PR emits `rls-data::Impl` in the save-analysis. A number of questions are outstanding: - [x] A few `???` around row 356. We need to discuss what goes here, if anything. - [ ] ~~Deriving `id` for impl using hashing. Is this going to clash with rustc defids?~~ - [ ] ~~Deriving `id` for impl using hashing. Is the conversion from 64 bit -> 32 bit problematic?~~ - [x] Need a new rls-data with an `id` field in `Impl` struct. - [ ] ~~Need a new rls-data which `derive` `Hash` for `ImplKind` enum.~~
bors
commented
Feb 10, 2018
💔 Test failed - status-appveyor |
kennytm
commented
Feb 10, 2018
bors
commented
Feb 11, 2018
Emit data::Impl in save-analysis As discussed on [internals.rust-lang](https://internals.rust-lang.org/t/rustdoc2-rls-analysis-and-the-compiler-help-wanted/6592/5), this PR emits `rls-data::Impl` in the save-analysis. A number of questions are outstanding: - [x] A few `???` around row 356. We need to discuss what goes here, if anything. - [ ] ~~Deriving `id` for impl using hashing. Is this going to clash with rustc defids?~~ - [ ] ~~Deriving `id` for impl using hashing. Is the conversion from 64 bit -> 32 bit problematic?~~ - [x] Need a new rls-data with an `id` field in `Impl` struct. - [ ] ~~Need a new rls-data which `derive` `Hash` for `ImplKind` enum.~~
bors
commented
Feb 11, 2018
☀️ Test successful - status-appveyor, status-travis |
Tested on commit rust-lang/rust@0bb8935. 💔 rls on windows: test-pass → test-fail (cc @nrc). 💔 rls on linux: test-pass → test-fail (cc @nrc).
kennytm
commented
Feb 11, 2018
@nrc@algesten FYI the Details |
nrc
commented
Feb 11, 2018
@kennytm this is expected (I think) and should be solved by updating the RLS and then updating the version in the Repo |
As discussed on internals.rust-lang, this PR emits
rls-data::Implin the save-analysis.A number of questions are outstanding:
???around row 356. We need to discuss what goes here, if anything.Derivingidfor impl using hashing. Is this going to clash with rustc defids?Derivingidfor impl using hashing. Is the conversion from 64 bit -> 32 bit problematic?idfield inImplstruct.Need a new rls-data whichderiveHashforImplKindenum.