-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Made Path::name
only have item name rather than full name
#134880
Made Path::name
only have item name rather than full name
#134880
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @aDotInTheVoid (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
This comment has been minimized.
This comment has been minimized.
Sorry for the delay in getting around to reviewing this. I think this is the right approach (rather than changing the docs to reflect what we currently do), even though the (then incorrect) were only added recently (#127290). All this information is available in the CC @CraftSpider, @Enselic, @obi1kenobi as this is effectivly a change to rustdoc-types, even though the types themself don't change. How do you feel about this? Also: should we bump I'm planning to merge this in about a week, assuming no-one objects. Also, would you mind squashing your commits, as I don't think there's value in having the test-change be in a separate commit. Thanks again for finding this and working on the fix. |
Thanks for the ping. This seems like a good change. I would prefer FORMAT_VERSION to be bumped since the semantics have changed (to the better). But I'm fine with keeping it unchanged if others have reasons to let it remain unchanged. |
1c4cd28
to
f63ed56
Compare
I'd also prefer to bump the format version, since this behavior change will affect a handful of |
r=me with |
f63ed56
to
2c4aee9
Compare
rustdoc-json-types is a public (although nightly-only) API. If possible, consider changing |
@rustbot ready |
Could not assign reviewer from: |
@bors r+ rollup |
…h-name, r=aDotInTheVoid Made `Path::name` only have item name rather than full name Closes rust-lang#134853 This PR makes `Path::name` to only have item name rather than full name, i.e. with the following code ```rust pub mod foo { pub struct Bar; } pub fn get_bar() -> foo::Bar { foo::Bar } ``` and running `./rustdoc ./demo.rs -wjson -Zunstable-options` gives: ```json { "41": { "id": 41, "name": "get_bar", "inner": { "function": { "sig": { "inputs": [], "output": { "resolved_path": { "name": "Bar", "id": 0, "args": { "angle_bracketed": { "args": [], "constraints": [] } } } } } } } } } ``` _Information which isn't useful here was trimmed_ r? aDotInTheVoid
…llaumeGomez Rollup of 5 pull requests Successful merges: - rust-lang#134216 (Enable "jump to def" feature on patterns) - rust-lang#134353 (Treat safe target_feature functions as unsafe by default [less invasive variant]) - rust-lang#134880 (Made `Path::name` only have item name rather than full name) - rust-lang#135466 (Leak check in `impossible_predicates` to avoid monomorphizing impossible instances) - rust-lang#135476 (Remove remnant of asmjs) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#134216 (Enable "jump to def" feature on patterns) - rust-lang#134880 (Made `Path::name` only have item name rather than full name) - rust-lang#135466 (Leak check in `impossible_predicates` to avoid monomorphizing impossible instances) - rust-lang#135476 (Remove remnant of asmjs) - rust-lang#135479 (mir borrowck: cleanup late-bound region handling) - rust-lang#135493 (Fix legacy symbol mangling of closures) - rust-lang#135495 (Add missing closing backtick in commit hook message 🐸) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#134880 - as1100k-forks:fix-rustdoc-json-path-name, r=aDotInTheVoid Made `Path::name` only have item name rather than full name Closes rust-lang#134853 This PR makes `Path::name` to only have item name rather than full name, i.e. with the following code ```rust pub mod foo { pub struct Bar; } pub fn get_bar() -> foo::Bar { foo::Bar } ``` and running `./rustdoc ./demo.rs -wjson -Zunstable-options` gives: ```json { "41": { "id": 41, "name": "get_bar", "inner": { "function": { "sig": { "inputs": [], "output": { "resolved_path": { "name": "Bar", "id": 0, "args": { "angle_bracketed": { "args": [], "constraints": [] } } } } } } } } } ``` _Information which isn't useful here was trimmed_ r? aDotInTheVoid
@aDotInTheVoid I'm running into a serious issue making
This turns out to not be true in practice. The
This is making In theory, we could run c-s-c's importable paths analysis to derive a valid, publicly-importable path for the item instead of using the
|
Thanks for reporting this. Filed #135600, as it's likely to get lost and forgotten here. |
This is a problem I ran into before, specifically related to |
That sounds reasonable to me too. More than anything else, though, I'd like to have either a fix or a revert for this PR before the next Rust beta cutoff, so that we don't end up with a stable version of Rust that cargo-semver-checks can't support. I'm not sure I can ship a fix, but I'd be happy to submit a revert if that is at all helpful. |
I finally got around to testing this for Pavex. Unfortunately, I was down sick with a fever for a few days last week, so I'm a bit late. |
Closes rust-lang#135600 Effectivly reverts rust-lang#134880
…r=GuillaumeGomez rustdoc-json: Rename `Path::name` to `path`, and give it the path again. Closes: rust-lang#135600. Reverts rust-lang#134880 (Effectively, but not actually, as the `FORMAT_VERSION` needs to be bumped, changed docs/tests). CC `@AS1100K.` Also CC `@obi1kenobi` `@LukeMathWalker` Still needs before being merge-ready: - [x] Tests for cross-crate paths - [x] (Maybe) Document what the field does. - [x] Decide if the field rename is good (rust-lang#135799 (comment)) - [ ] Squash commits. r? `@GuillaumeGomez`
Rollup merge of rust-lang#135799 - aDotInTheVoid:skrrt-skrrt-revrrt, r=GuillaumeGomez rustdoc-json: Rename `Path::name` to `path`, and give it the path again. Closes: rust-lang#135600. Reverts rust-lang#134880 (Effectively, but not actually, as the `FORMAT_VERSION` needs to be bumped, changed docs/tests). CC `@AS1100K.` Also CC `@obi1kenobi` `@LukeMathWalker` Still needs before being merge-ready: - [x] Tests for cross-crate paths - [x] (Maybe) Document what the field does. - [x] Decide if the field rename is good (rust-lang#135799 (comment)) - [ ] Squash commits. r? `@GuillaumeGomez`
Closes #134853
This PR makes
Path::name
to only have item name rather than full name, i.e. with the following codeand running
./rustdoc ./demo.rs -wjson -Zunstable-options
gives:Information which isn't useful here was trimmed
r? aDotInTheVoid