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

Resolve char as a primitive even if there is a module in scope #75318

Merged
merged 1 commit into from
Aug 10, 2020

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Aug 9, 2020

Closes #58699.
r? @Manishearth

@jyn514 jyn514 added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name labels Aug 9, 2020
@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 Aug 9, 2020
return Err(ErrorKind::AnchorFailure(AnchorFailure::Primitive));
}
return Ok((prim, Some(path_str.to_owned())));
// This resolved to a module, but we want primitive types to take precedence instead.
Copy link
Member

Choose a reason for hiding this comment

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

We should avoid this branch if it's explicitly not specified as a type, yes?

Copy link
Member Author

@jyn514 jyn514 Aug 9, 2020

Choose a reason for hiding this comment

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

Oh you're right - this should happen if there's no disambiguator or if the disambiguator is type@, but if there's a different disambiguator we should skip it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Should be fixed now.

@Manishearth
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Aug 9, 2020

📌 Commit 6d2b16fc7e9d82befdd864ec9327883424ac6668 has been approved by Manishearth

@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 Aug 9, 2020
@bors
Copy link
Contributor

bors commented Aug 9, 2020

⌛ Testing commit 6d2b16fc7e9d82befdd864ec9327883424ac6668 with merge f78b2bee99acf60e0086aa75572697d05f35b3b7...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
skip untracked path cpu-usage.csv during rustfmt invocations
skip untracked path src/doc/book/ during rustfmt invocations
skip untracked path src/doc/rust-by-example/ during rustfmt invocations
skip untracked path src/llvm-project/ during rustfmt invocations
Diff in /checkout/src/librustdoc/passes/collect_intra_doc_links.rs at line 218:
                     }
                     Res::Def(DefKind::Mod, _) => {
                         // This resolved to a module, but we want primitive types to take precedence instead.
-                        if matches!(disambiguator, None | Some(Disambiguator::Namespace(Namespace::TypeNS))) {
+                        if matches!(
+                            disambiguator,
+                            None | Some(Disambiguator::Namespace(Namespace::TypeNS))
+                        ) {
                             if let Some(prim) = is_primitive(path_str, ns) {
Running `"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustfmt" "--config-path" "/checkout" "--edition" "2018" "--unstable-features" "--skip-children" "--check" "/checkout/src/librustdoc/passes/collect_intra_doc_links.rs"` failed.
If you're running `tidy`, try again with `--bless`. Or, if you just want to format code, run `./x.py fmt` instead.
                                 if extra_fragment.is_some() {
                                     return Err(ErrorKind::AnchorFailure(AnchorFailure::Primitive));
failed to run: /checkout/obj/build/bootstrap/debug/bootstrap --stage 2 test
== clock drift check ==
  local time: Sun Aug  9 05:24:22 UTC 2020
  network time: Sun, 09 Aug 2020 05:24:22 GMT
== end clock drift check ==
== end clock drift check ==
##[error]Process completed with exit code 1.
Terminate orphan process: pid (2871) (node)
Terminate orphan process: pid (2899) (python)

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

@bors
Copy link
Contributor

bors commented Aug 9, 2020

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 9, 2020
This has less surprising behavior when there is a module with the same
name as a primitive in scope.
@jyn514
Copy link
Member Author

jyn514 commented Aug 9, 2020

@bors r=manishearth

@bors
Copy link
Contributor

bors commented Aug 9, 2020

📌 Commit b11e2f2 has been approved by manishearth

@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 Aug 9, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 10, 2020
Rollup of 8 pull requests

Successful merges:

 - rust-lang#74200 (Std panicking unsafe block in unsafe fn)
 - rust-lang#75286 (Add additional case for Path starts with)
 - rust-lang#75318 (Resolve `char` as a primitive even if there is a module in scope)
 - rust-lang#75320 (Detect likely `for foo of bar` JS syntax)
 - rust-lang#75328 (Cleanup E0749)
 - rust-lang#75344 (Rename "Important traits" to "Notable traits")
 - rust-lang#75348 (Move to intra-doc links in library/core/src/time.rs)
 - rust-lang#75350 (Do not ICE when lowering invalid extern fn with bodies)

Failed merges:

r? @ghost
@bors bors merged commit 968740a into rust-lang:master Aug 10, 2020
@jyn514 jyn514 deleted the primitive branch August 10, 2020 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name 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.

intra-doc links to modules instead of primitives inside standard library
6 participants