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

Properly handle primitive disambiguators in rustdoc #80660

Merged
merged 6 commits into from Jan 7, 2021

Conversation

max-heller
Copy link
Contributor

Fixes #80559

r? @jyn514

Is there a way to test that the generated intra-doc link is what I expect?

@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 Jan 3, 2021
@jyn514
Copy link
Member

jyn514 commented Jan 3, 2021

Is there a way to test that the generated intra-doc link is what I expect?

Yes, see https://rustc-dev-guide.rust-lang.org/rustdoc-internals.html#dotting-is-and-crossing-ts for instructions and src/test/rustdoc/intra-doc for examples. Please also move the test case to the intra-doc subdirectory and name it after the fix instead of the issue.

@jyn514 jyn514 added A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. 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 Jan 3, 2021
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-9 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
.................................................................................................... 9000/11240
.................................................................................................... 9100/11240
.................................................................................................... 9200/11240
....................................i......i........................................................ 9300/11240
...........................................................................iiiiii..iiiiii.i......... 9400/11240
.................................................................................................... 9600/11240
.................................................................................................... 9700/11240
.................................................................................................... 9800/11240
.................................................................................................... 9900/11240
---
Suite("src/test/assembly") not skipped for "bootstrap::test::Assembly" -- not in ["src/tools/tidy"]
Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)

running 27 tests
iiiiiiiiiiiiiiiiiiiiiiiiiii

 finished in 0.067 seconds
Suite("src/test/incremental") not skipped for "bootstrap::test::Incremental" -- not in ["src/tools/tidy"]
Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---
 finished in 10.758 seconds
Check compiletest suite=debuginfo mode=debuginfo (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)

running 116 tests
iiiiiiiiii.i.i..i..i..ii....i.i....ii...........iiii........i.....i...i.......ii.i.ii.....iiii.....i 100/116
test result: ok. 78 passed; 0 failed; 38 ignored; 0 measured; 0 filtered out; finished in 2.27s

 finished in 2.340 seconds
Suite("src/test/ui-fulldeps") not skipped for "bootstrap::test::UiFullDeps" -- not in ["src/tools/tidy"]
---
---- [rustdoc] rustdoc/intra-doc/incompatible-primitive-disambiguator.rs stdout ----

error: rustdoc failed!
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/intra-doc/incompatible-primitive-disambiguator/auxiliary" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/intra-doc/incompatible-primitive-disambiguator" "/checkout/src/test/rustdoc/intra-doc/incompatible-primitive-disambiguator.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error: unresolved link to `str::trim`
 --> /checkout/src/test/rustdoc/intra-doc/incompatible-primitive-disambiguator.rs:2:6
  |
2 | //! [struct@str::trim] //~ ERROR incompatible link
  |      |
  |      |
  |      this link resolves to the associated function `trim`, which is not in the type namespace
  |      help: to link to the associated function, add parentheses: `str::trim()`
note: the lint level is defined here
 --> /checkout/src/test/rustdoc/intra-doc/incompatible-primitive-disambiguator.rs:1:9
  |
  |
1 | #![deny(broken_intra_doc_links)]

error: aborting due to previous error


---
test result: FAILED. 405 passed; 1 failed; 2 ignored; 0 measured; 0 filtered out; finished in 37.67s



command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--rustdoc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "--src-base" "/checkout/src/test/rustdoc" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--suite" "rustdoc" "--mode" "rustdoc" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-9/bin/FileCheck" "--nodejs" "/usr/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "9.0.0" "--llvm-components" "aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver engine executionengine fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader jitlink lanai lanaiasmparser lanaicodegen lanaidesc lanaidisassembler lanaiinfo libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcjit passes perfjitevents powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvutils runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xcore xcorecodegen xcoredesc xcoredisassembler xcoreinfo xray" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"


failed to run: /checkout/obj/build/bootstrap/debug/bootstrap --stage 2 test --exclude src/tools/tidy
Build completed unsuccessfully in 0:19:48

@jyn514
Copy link
Member

jyn514 commented Jan 5, 2021

@bors r+

Thanks for sticking with this!

@bors
Copy link
Contributor

bors commented Jan 5, 2021

📌 Commit 2bdbb0d 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 5, 2021
@jyn514
Copy link
Member

jyn514 commented Jan 5, 2021

@bors squash

This messes with github unfortunately - if bors says this was merged you can trust it and close the PR.

@max-heller
Copy link
Contributor Author

@jyn514 thanks for the help!

@bors
Copy link
Contributor

bors commented Jan 6, 2021

⌛ Testing commit 2bdbb0d with merge 92350979910dc7b5616616e4c2514e1f9f002d84...

@bors
Copy link
Contributor

bors commented Jan 6, 2021

💔 Test failed - checks-actions

@bors bors removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 6, 2021
@bors bors added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 6, 2021
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@jyn514
Copy link
Member

jyn514 commented Jan 6, 2021

Looks like it couldn't find a runner for aarch64-gnu? There's no build log.

@bors retry

@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 Jan 6, 2021
@bors
Copy link
Contributor

bors commented Jan 6, 2021

⌛ Testing commit 2bdbb0d with merge b923afe4c3ec7c0d7591cb324ca7b0cba6168b0c...

@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Build completed successfully in 0:01:00
+ /scripts/validate-toolstate.sh
Cloning into 'rust-toolstate'...
<Nothing changed>
error: book maintainer @carols10cents is not assignable in the rust-lang/rust repo

  To be assignable, a person needs to be explicitly listed as a
  collaborator in the repository settings. The simple way to
  fix this is to ask someone with 'admin' privileges on the repo
  to add the person or whole team as a collaborator with 'read'
  privileges. Those privileges don't grant any extra permissions
  so it's safe to apply them.
The build will fail due to this.

@bors
Copy link
Contributor

bors commented Jan 6, 2021

💔 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 Jan 6, 2021
@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 Jan 7, 2021
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Jan 7, 2021
Properly handle primitive disambiguators in rustdoc

Fixes rust-lang#80559

r? `@jyn514`

Is there a way to test that the generated intra-doc link is what I expect?
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 7, 2021
Rollup of 10 pull requests

Successful merges:

 - rust-lang#80012 (Add pointing const identifier when emitting E0435)
 - rust-lang#80521 (MIR Inline is incompatible with coverage)
 - rust-lang#80659 (Edit rustc_ast::tokenstream docs)
 - rust-lang#80660 (Properly handle primitive disambiguators in rustdoc)
 - rust-lang#80738 (Remove bottom margin from crate version when the docs sidebar is collapsed)
 - rust-lang#80744 (rustdoc: Turn `next_def_id` comments into docs)
 - rust-lang#80750 (Don't use to_string on Symbol in rustc_passes/check_attr.rs)
 - rust-lang#80769 (Improve wording of parse doc)
 - rust-lang#80780 (Return EOF_CHAR constant instead of magic char.)
 - rust-lang#80784 (rustc_parse: Better spans for synthesized token streams)

Failed merges:

 - rust-lang#80785 (rustc_ast_pretty: Remove `PrintState::insert_extra_parens`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 2e9788b into rust-lang:master Jan 7, 2021
@rustbot rustbot added this to the 1.51.0 milestone Jan 7, 2021
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.

Rustdoc treats primitive disambiguators incorrectly
6 participants