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

Rename source to span and span to source #82994

Merged
merged 8 commits into from
Mar 23, 2021

Conversation

camelid
Copy link
Member

@camelid camelid commented Mar 10, 2021

  • Rename clean::Item.source to span
  • Rename clean::Span::span() to clean::Span::inner()
  • Rename rustdoc_json_types::Item.source to span
  • rustdoc-json: Rename Import.span to Import.source

See also the discussion on Zulip (this is a bit more than discussed in
that conversation, but all the changes are related).

r? @jyn514

@camelid camelid added C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Mar 10, 2021
@rust-highfive
Copy link
Collaborator

Some changes occurred in intra-doc-links.

cc @jyn514

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 10, 2021
@camelid
Copy link
Member Author

camelid commented Mar 10, 2021

This will likely conflict with #82993 so probably one of these should be merged before the other.

@camelid
Copy link
Member Author

camelid commented Mar 10, 2021

Rebased to fix conflicts.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@jyn514
Copy link
Member

jyn514 commented Mar 11, 2021

rustdoc-json: Rename Import.span to Import.source

Why this change?

@camelid
Copy link
Member Author

camelid commented Mar 11, 2021

rustdoc-json: Rename Import.span to Import.source

Why this change?

Quoting from the commit message:

  • It is called source in rustc and the rest of rustdoc
  • It is not a span, rather it is the source of the import

Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

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

LGTM with the nits fixed :)

src/librustdoc/clean/types.rs Outdated Show resolved Hide resolved
src/librustdoc/clean/types.rs Outdated Show resolved Hide resolved
src/librustdoc/clean/types.rs Outdated Show resolved Hide resolved
src/librustdoc/clean/types.rs Outdated Show resolved Hide resolved
src/librustdoc/clean/types.rs Show resolved Hide resolved
src/librustdoc/json/conversions.rs Show resolved Hide resolved
@camelid camelid added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 20, 2021
@camelid
Copy link
Member Author

camelid commented Mar 20, 2021

Addressed most of the comments, but I'm waiting on a response on #82994 (comment).

@camelid camelid removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 20, 2021
@rust-log-analyzer

This comment has been minimized.

@camelid camelid added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 22, 2021
Its type is called `clean::Span`, and also the name in the rest of
rustdoc and rustc for this kind of field is `span`.
Otherwise you get a lot of instances of `item.span.span()`, which is
just plain confusing. `item.span.inner()` conveys the correct meaning of
"get the type that `clean::Span` wraps".
* It is called `source` in rustc and the rest of rustdoc
* It is not a span, rather it is the source of the import
The rustdoc-json-types renames are breaking changes.
...and add docs to the types instead of the fields that hold the types.
These tests were added to master after I made my changes.
@camelid camelid removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 22, 2021
@jyn514 jyn514 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 Mar 22, 2021
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
@camelid camelid added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 23, 2021
@jyn514
Copy link
Member

jyn514 commented Mar 23, 2021

Looks great, thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Mar 23, 2021

📌 Commit d5f2bb2 has been approved by jyn514

@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 Mar 23, 2021
@bors
Copy link
Contributor

bors commented Mar 23, 2021

⌛ Testing commit d5f2bb2 with merge 673d0db...

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 23, 2021
…n514

Rename `source` to `span` and `span` to `source`

- Rename `clean::Item.source` to `span`
- Rename `clean::Span::span()` to `clean::Span::inner()`
- Rename `rustdoc_json_types::Item.source` to `span`
- rustdoc-json: Rename `Import.span` to `Import.source`

*See also the [discussion on Zulip][z] (this is a bit more than discussed in
that conversation, but all the changes are related).*

r? ``@jyn514``

[z]: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/get.20span.20of.20file.20from.20name/near/229603729
@bors
Copy link
Contributor

bors commented Mar 23, 2021

☀️ Test successful - checks-actions
Approved by: jyn514
Pushing 673d0db to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 23, 2021
@bors bors merged commit 673d0db into rust-lang:master Mar 23, 2021
@rustbot rustbot added this to the 1.53.0 milestone Mar 23, 2021
@camelid camelid deleted the rename-source-to-span branch March 24, 2021 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants