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

Fix links in String deref docs for str::escape methods #58596

Closed
wants to merge 1 commit into from

Conversation

tspiteri
Copy link
Contributor

This fixes links to the respective char methods in the docs for String::escape_debug, String::escape_default and String::escape_unicode similarly to how char links were fixed in #53052.

@rust-highfive
Copy link
Collaborator

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 20, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (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.
travis_time:end:1dd7be70:start=1550672011582408772,finish=1550672012398773168,duration=816364396
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
[00:58:26]  Documenting core v0.0.0 (/checkout/src/libcore)
[00:58:42] warning: `[char::escape_debug]` cannot be resolved, ignoring it...
[00:58:42]     --> src/libcore/str/mod.rs:3968:67
[00:58:42]      |
[00:58:42] 3968 |     /// Return an iterator that escapes each char in `self` with [`char::escape_debug`].
[00:58:42]      |
[00:58:42] note: lint level defined here
[00:58:42]     --> src/libcore/lib.rs:63:9
[00:58:42]      |
[00:58:42]      |
[00:58:42] 63   | #![warn(intra_doc_link_resolution_failure)]
[00:58:42]      |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:58:42]      = help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
[00:58:42] 
[00:58:42] warning: `[char::escape_default]` cannot be resolved, ignoring it...
[00:58:42]     --> src/libcore/str/mod.rs:4014:67
[00:58:42]      |
[00:58:42] 4014 |     /// Return an iterator that escapes each char in `self` with [`char::escape_default`].
[00:58:42]      |
[00:58:42]      = help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
[00:58:42] 
[00:58:42] warning: `[char::escape_unicode]` cannot be resolved, ignoring it...
[00:58:42] warning: `[char::escape_unicode]` cannot be resolved, ignoring it...
[00:58:42]     --> src/libcore/str/mod.rs:4050:67
[00:58:42]      |
[00:58:42] 4050 |     /// Return an iterator that escapes each char in `self` with [`char::escape_unicode`].
[00:58:42]      |
[00:58:42]      = help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
[00:58:42] 
[00:58:48]     Finished release [optimized] target(s) in 22.77s
---
[00:58:54]  Documenting std v0.0.0 (/checkout/src/libstd)
[00:59:00] error: `[char::escape_debug]` cannot be resolved, ignoring it...
[00:59:00]     --> /checkout/src/libcore/str/mod.rs:3968:67
[00:59:00]      |
[00:59:00] 3968 |     /// Return an iterator that escapes each char in `self` with [`char::escape_debug`].
[00:59:00]      |
[00:59:00] note: lint level defined here
[00:59:00]     --> src/libstd/lib.rs:209:9
[00:59:00]      |
[00:59:00]      |
[00:59:00] 209  | #![deny(intra_doc_link_resolution_failure)]
[00:59:00]      |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:00]      = help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
[00:59:00] 
[00:59:00] error: `[char::escape_default]` cannot be resolved, ignoring it...
[00:59:00]      |
[00:59:00]      |
[00:59:00] 4014 |     /// Return an iterator that escapes each char in `self` with [`char::escape_default`].
[00:59:00]      |
[00:59:00]      = help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
[00:59:00] 
[00:59:00] error: `[char::escape_unicode]` cannot be resolved, ignoring it...
[00:59:00] error: `[char::escape_unicode]` cannot be resolved, ignoring it...
[00:59:00]     --> /checkout/src/libcore/str/mod.rs:4050:67
[00:59:00]      |
[00:59:00] 4050 |     /// Return an iterator that escapes each char in `self` with [`char::escape_unicode`].
[00:59:00]      |
[00:59:00]      = help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
[00:59:00] 
[00:59:01] error: Could not document `std`.
[00:59:01] error: Could not document `std`.
[00:59:01] 
[00:59:01] Caused by:
[00:59:01]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustdoc --crate-name std src/libstd/lib.rs --color always --target x86_64-unknown-linux-gnu -o /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/doc --cfg 'feature="backtrace"' --cfg 'feature="backtrace-sys"' --cfg 'feature="compiler_builtins"' --cfg 'feature="compiler_builtins_c"' --cfg 'feature="default"' --cfg 'feature="panic-unwind"' --cfg 'feature="panic_unwind"' --cfg 'feature="std_detect_dlsym_getauxval"' --cfg 'feature="std_detect_file_io"' --markdown-css rust.css --markdown-no-toc --generate-redirect-pages --index-page /checkout/src/doc/index.md -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/release/deps --extern alloc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/liballoc-9e6c0311b71511c6.rmeta --extern backtrace_sys=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libbacktrace_sys-f13b165ed9b4dd57.rmeta --extern compiler_builtins=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libcompiler_builtins-d54fe968dea87029.rmeta --extern core=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libcore-84e5b9599b1b7754.rmeta --extern libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/liblibc-a69fda92b07aedd5.rmeta --extern panic_abort=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libpanic_abort-349a3e5cce9f18ee.rmeta --extern panic_unwind=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libpanic_unwind-d7c48504ff1056b6.rmeta --extern rustc_demangle=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/librustc_demangle-20814bca47e9a554.rmeta --extern rustc_asan=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/librustc_asan-8bc4c4bf1d4ec8f0.rmeta --extern rustc_lsan=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/librustc_lsan-0814373332ff833c.rmeta --extern rustc_msan=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/librustc_msan-655667bc8a1522d0.rmeta --extern rustc_tsan=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/librustc_tsan-5756fbda854daecf.rmeta --extern unwind=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libunwind-5e31c590860d0940.rmeta` (exit code: 1)
[00:59:01] 
[00:59:01] 
[00:59:01] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustdoc" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-Z" "unstable-options" "-p" "std" "--" "--markdown-css" "rust.css" "--markdown-no-toc" "--generate-redirect-pages" "--index-page" "/checkout/src/doc/index.md"
[00:59:01] 
[00:59:01] 
[00:59:01] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap doc
[00:59:01] Build completed unsuccessfully in 0:05:58
[00:59:01] Build completed unsuccessfully in 0:05:58
[00:59:01] make: *** [all] Error 1
[00:59:01] Makefile:18: recipe for target 'all' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0a70c8b2
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Wed Feb 20 15:12:45 UTC 2019
---
travis_time:end:00705538:start=1550675566434693651,finish=1550675566439225313,duration=4531662
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:06507058
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0b03afba
travis_time:start:0b03afba
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:01b60e61
$ dmesg | grep -i kill

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 @TimNN. (Feature Requests)

@alexcrichton
Copy link
Member

Thanks! Looks like CI is failing, but otherwise looks good to me!

@tspiteri
Copy link
Contributor Author

Hmm, it seems as if the intra-rustdoc links feature accepts methods on structs etc., accepts primitives, but does not accept methods on primitives.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (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.
travis_time:end:26258363:start=1551002030495889378,finish=1551002032872750424,duration=2376861046
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:13:41] 
[01:13:41] running 119 tests
[01:14:07] .iiiii...i.....i..i...i..i.i..i.ii...i.....i..i....i..........iiii..........i...ii...i.......ii.i.i. 100/119
[01:14:12] i......iii.i.....ii
[01:14:12] 
[01:14:12]  finished in 30.502
[01:14:12] travis_fold:end:test_debuginfo

---
[01:40:45] travis_fold:end:stage0-linkchecker

[01:40:45] travis_time:end:stage0-linkchecker:start=1551008086699973458,finish=1551008088722490149,duration=2022516691

[01:40:47] std/primitive.str.html:1142: absolute path - /checkout/src/libcore/std/primitive.char.html
[01:40:47] std/primitive.str.html:1165: absolute path - /checkout/src/libcore/std/primitive.char.html
[01:40:47] std/primitive.str.html:1186: absolute path - /checkout/src/libcore/std/primitive.char.html
[01:40:53] thread 'main' panicked at 'found some broken links', src/tools/linkchecker/main.rs:41:9
[01:40:53] 
[01:40:53] 
[01:40:53] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/linkchecker" "/checkout/obj/build/x86_64-unknown-linux-gnu/doc"
[01:40:53] expected success, got: exit code: 101
[01:40:53] expected success, got: exit code: 101
[01:40:53] 
[01:40:53] 
[01:40:53] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:40:53] Build completed unsuccessfully in 0:39:04
[01:40:53] make: *** [check] Error 1
[01:40:53] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:21a6f60a
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Sun Feb 24 11:34:56 UTC 2019
---
travis_time:end:0db00ba5:start=1551008098748373489,finish=1551008098803739531,duration=55366042
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0f0f5137
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:068cd678
$ dmesg | grep -i kill

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 @TimNN. (Feature Requests)

@tspiteri
Copy link
Contributor Author

So now primitives are correctly linked in intra-docs for non-std crates, but linking to primitives using intra-doc links fails in the standard library. For example the links used in #53052 point to module char instead of the primitive char (issue #58699).

Centril added a commit to Centril/rust that referenced this pull request Feb 28, 2019
Replace `s` with `self` in docs for str methods taking self.

Cherry picked from PR rust-lang#58596 which is blocked on some intra-doc link bugs.
Centril added a commit to Centril/rust that referenced this pull request Feb 28, 2019
Replace `s` with `self` in docs for str methods taking self.

Cherry picked from PR rust-lang#58596 which is blocked on some intra-doc link bugs.
Centril added a commit to Centril/rust that referenced this pull request Feb 28, 2019
Replace `s` with `self` in docs for str methods taking self.

Cherry picked from PR rust-lang#58596 which is blocked on some intra-doc link bugs.
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Feb 28, 2019
Replace `s` with `self` in docs for str methods taking self.

Cherry picked from PR rust-lang#58596 which is blocked on some intra-doc link bugs.
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Mar 1, 2019
Replace `s` with `self` in docs for str methods taking self.

Cherry picked from PR rust-lang#58596 which is blocked on some intra-doc link bugs.
kennytm added a commit to kennytm/rust that referenced this pull request Mar 2, 2019
Replace `s` with `self` in docs for str methods taking self.

Cherry picked from PR rust-lang#58596 which is blocked on some intra-doc link bugs.
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Mar 2, 2019
Replace `s` with `self` in docs for str methods taking self.

Cherry picked from PR rust-lang#58596 which is blocked on some intra-doc link bugs.
@bors
Copy link
Contributor

bors commented Mar 3, 2019

☔ The latest upstream changes (presumably #58866) made this pull request unmergeable. Please resolve the merge conflicts.

@Dylan-DPC-zz
Copy link

ping from triage @tspiteri you have a conflict to resolve.

@Dylan-DPC-zz Dylan-DPC-zz 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 18, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (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.
travis_time:end:0d2a15b3:start=1553243607992122098,finish=1553243608881277650,duration=889155552
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
Setting environment variables from .travis.yml
---
travis_time:start:test_assembly
Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:18:39] 
[01:18:39] running 9 tests
[01:18:39] iiiiiiiii
[01:18:39] 
[01:18:39]  finished in 0.146
[01:18:39] travis_fold:end:test_assembly

---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:18:54] 
[01:18:54] running 120 tests
[01:19:18] .iiiii...i.....i..i...i..i.i...i.ii...i.....i..i....i..........iiii..........i...ii...i.......ii.i.i 100/120
[01:19:23] .i......iii.i.....ii
[01:19:23] 
[01:19:23]  finished in 28.501
[01:19:23] travis_fold:end:test_debuginfo

---
[01:44:19] travis_fold:end:stage0-linkchecker

[01:44:19] travis_time:end:stage0-linkchecker:start=1553249876514449711,finish=1553249878615474062,duration=2101024351

[01:44:21] std/primitive.str.html:1142: absolute path - /checkout/src/libcore/std/primitive.char.html
[01:44:21] std/primitive.str.html:1165: absolute path - /checkout/src/libcore/std/primitive.char.html
[01:44:21] std/primitive.str.html:1186: absolute path - /checkout/src/libcore/std/primitive.char.html
[01:44:26] thread 'main' panicked at 'found some broken links', src/tools/linkchecker/main.rs:41:9
[01:44:26] 
[01:44:26] 
[01:44:26] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/linkchecker" "/checkout/obj/build/x86_64-unknown-linux-gnu/doc"
[01:44:26] expected success, got: exit code: 101
[01:44:26] expected success, got: exit code: 101
[01:44:26] 
[01:44:26] 
[01:44:26] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:44:26] Build completed unsuccessfully in 0:36:59
[01:44:26] Makefile:48: recipe for target 'check' failed
[01:44:26] make: *** [check] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:04d084c8
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Fri Mar 22 10:18:06 UTC 2019
---
travis_time:end:0bdddae1:start=1553249888321494669,finish=1553249888326445552,duration=4950883
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:1da607b1
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0033780e
travis_time:start:0033780e
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:020f99d9
$ dmesg | grep -i kill

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 @TimNN. (Feature Requests)

@Centril
Copy link
Contributor

Centril commented Mar 30, 2019

Ping from triage, @tspiteri unfortunately, it seems like you have some test failures now?

@tspiteri
Copy link
Contributor Author

tspiteri commented Apr 6, 2019

It seems to me that there are some issues in rustdoc intra-doc links that are making this commit fail. I tried to look into rustdoc but couldn't see how to fix it as I don't know that code so much. Maybe if #58699 is fixed that'll give a few pointers on how to proceed, otherwise this PR is blocked.

@Dylan-DPC-zz Dylan-DPC-zz removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 29, 2019
@Dylan-DPC-zz Dylan-DPC-zz added the S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. label Apr 29, 2019
@jonas-schievink
Copy link
Contributor

Triage: #58699 (comment) seems to be a workaround that could help here

@tspiteri
Copy link
Contributor Author

I tried to see if that workaround could help but it didn't; I forgot the details as it's been some time.

I wrote this PR because I thought it could improve the docs slightly with little effort, but that didn't work out and now I'm thinking this PR should be closed. I don't think there needs to be a new issue as I think this is a case of #32129.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants