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

Doc alias improvements #71724

Merged
merged 9 commits into from
May 16, 2020
Merged

Conversation

GuillaumeGomez
Copy link
Member

After this message, I realized that the doc alias. So this PR does the followings:

  • Align the alias discovery on items added into the search-index. It brings a few nice advantages:
    • Instead of cloning the data between the two (in rustdoc source code), we now have the search-index one and aliases which reference to the first one. So we go from one big map containing a lot of duplicated data to just integers...
  • In the front-end (main.js), I improved the code around aliases to allow them to go through the same transformation as other items when we show the search results.
  • Improve the search tester in order to perform multiple requests into one file (I think it's better in this case than having a file for each case considering how many there are...)
    • I also had to add the new function inside the tester (handleAliases)

Once this PR is merged, I intend to finally stabilize this feature.

r? @ollie27

cc @rust-lang/rustdoc

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-8 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.
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /home/vsts/work/_temp/fd82bc2a-e6e0-4e36-a459-041011af1d6e.sh

##[section]Finishing: Disable git automatic line ending conversion
##[section]Starting: Checkout rust-lang/rust@refs/pull/71724/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
---
##[command]git remote add origin https://github.com/rust-lang/rust
##[command]git config gc.auto 0
##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
##[command]git config --get-all http.proxy
##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/71724/merge:refs/remotes/pull/71724/merge
---
 ---> cb2676f08729
Step 5/8 : ENV RUST_CONFIGURE_ARGS       --build=x86_64-unknown-linux-gnu       --llvm-root=/usr/lib/llvm-8       --enable-llvm-link-shared       --set rust.thin-lto-import-instr-limit=10
 ---> Using cache
 ---> df25ce111862
Step 6/8 : ENV SCRIPT python2.7 ../x.py test --exclude src/tools/tidy &&            python2.7 ../x.py test src/test/mir-opt --pass=build                                   --target=armv5te-unknown-linux-gnueabi &&            python2.7 ../x.py test src/tools/tidy
 ---> 599b9ac96b27
Step 7/8 : ENV NO_DEBUG_ASSERTIONS=1
 ---> Using cache
 ---> 091087e35a36
---
Looks like docker image is the same as before, not uploading
[CI_JOB_NAME=x86_64-gnu-llvm-8]
[CI_JOB_NAME=x86_64-gnu-llvm-8]
== clock drift check ==
  local time: Thu Apr 30 23:01:38 UTC 2020
  network time: Thu, 30 Apr 2020 23:01:38 GMT
Starting sccache server...
configure: processing command line
configure: 
configure: rust.dist-src        := False
---
   Compiling unicode-width v0.1.6
   Compiling getopts v0.2.21
   Compiling test v0.0.0 (/checkout/src/libtest)
    Finished release [optimized] target(s) in 57.32s
{"reason":"build-finished","success":true}
Building stage0 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling cfg-if v0.1.10
   Compiling libc v0.2.69
   Compiling semver-parser v0.7.0
---
   Compiling rustc_feature v0.0.0 (/checkout/src/librustc_feature)
   Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
   Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
   Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
   Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
   Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
   Compiling rustc_attr v0.0.0 (/checkout/src/librustc_attr)
   Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
   Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
   Compiling rustc_passes v0.0.0 (/checkout/src/librustc_passes)
   Compiling rustc_plugin_impl v0.0.0 (/checkout/src/librustc_plugin_impl)
   Compiling rustc_privacy v0.0.0 (/checkout/src/librustc_privacy)
   Compiling rustc-main v0.0.0 (/checkout/src/rustc)
{"reason":"build-finished","success":true}
Copying stage0 rustc from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Assembling stage1 compiler (x86_64-unknown-linux-gnu)
Building stage1 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling cc v1.0.50
---
   Compiling proc_macro v0.0.0 (/checkout/src/libproc_macro)
   Compiling unicode-width v0.1.6
   Compiling getopts v0.2.21
   Compiling test v0.0.0 (/checkout/src/libtest)
{"reason":"build-finished","success":true}
Copying stage1 std from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage1 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling cfg-if v0.1.10
   Compiling libc v0.2.69
---
   Compiling rustc_feature v0.0.0 (/checkout/src/librustc_feature)
   Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
   Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
   Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
   Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
   Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
   Compiling rustc_attr v0.0.0 (/checkout/src/librustc_attr)
   Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
   Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
   Compiling rustc_traits v0.0.0 (/checkout/src/librustc_traits)
   Compiling rustc_privacy v0.0.0 (/checkout/src/librustc_privacy)
   Compiling rustc_plugin_impl v0.0.0 (/checkout/src/librustc_plugin_impl)
   Compiling rustc-main v0.0.0 (/checkout/src/rustc)
 {"reason":"build-finished","success":true}
Copying stage1 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Assembling stage2 compiler (x86_64-unknown-linux-gnu)
Uplifting stage1 std (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Copying stage2 std from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
---
   Compiling serde_json v1.0.40
   Compiling rustfix v0.5.0
   Compiling compiletest v0.0.0 (/checkout/src/tools/compiletest)
    Finished release [optimized] target(s) in 1m 18s
{"reason":"build-finished","success":true}

running 9963 tests
.................................................................................................... 100/9963
.................................................................................................... 200/9963
---
..............i..................................................................................... 1800/9963
.................................................................................................... 1900/9963
..............................i..................................................................... 2000/9963
.................................................................................................... 2100/9963
....................iiiii........................................................................... 2200/9963
.................................................................................................... 2400/9963
.................................................................................................... 2500/9963
.................................................................................................... 2600/9963
.................................................................................................... 2700/9963
---
....i...............i............................................................................... 5100/9963
.................................................................................................... 5200/9963
..................................................i................................................. 5300/9963
.........................................i.......................................................... 5400/9963
...........................................ii.ii........i...i....................................... 5500/9963
..........................................................................................i......... 5700/9963
.................................................................................................... 5800/9963
.........................ii.....................................i................................... 5900/9963
.................................................................................................... 6000/9963
.................................................................................................... 6000/9963
.................................................................................................... 6100/9963
...........................................................ii...i..ii...........i................... 6200/9963
.................................................................................................... 6400/9963
.................................................................................................... 6500/9963
.................................................................................................... 6500/9963
...........................................................................................i..ii.... 6600/9963
.................................................................................................... 6800/9963
............................................................................................i....... 6900/9963
.................................................................................................... 7000/9963
.................................................................................................... 7100/9963
---
.................................................................................................... 7900/9963
.................................................................................................... 8000/9963
.................................................................................................... 8100/9963
..i................................................................................................. 8200/9963
...................................................iiiiii.iiiii.i................................... 8300/9963
....i............................................................................................... 8500/9963
.................................................................................................... 8600/9963
.................................................................................................... 8700/9963
.................................................................................................... 8800/9963
---
Suite("src/test/codegen") not skipped for "bootstrap::test::Codegen" -- not in ["src/tools/tidy"]
Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)

running 186 tests
iiii......i.............ii.i..........i.............................i..i..................i....i.... 100/186
........i.i.i...iii..iiiiiiiiiiiiiiii.......................iii...............ii......

 finished in 5.464
Suite("src/test/codegen-units") not skipped for "bootstrap::test::CodegenUnits" -- not in ["src/tools/tidy"]
Check compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---
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 9 tests
iiiiiiiii

 finished in 0.149
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)
---
Suite("src/test/debuginfo") not skipped for "bootstrap::test::Debuginfo" -- not in ["src/tools/tidy"]
Check compiletest suite=debuginfo mode=debuginfo (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)

running 115 tests
iiiii..i.....i..i...i..i.i.i..i..i..ii....i.i....ii..........iiii.........i.....i..i.......ii.i.ii.. 100/115
...iiii.....ii.

 finished in 14.228
Suite("src/test/ui-fulldeps") not skipped for "bootstrap::test::UiFullDeps" -- not in ["src/tools/tidy"]
Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---

running 339 tests
.........................................i.......................................................... 100/339
..............................................................i..................................... 200/339
.....................................F......................................FF.F..i................. 300/339
failures:

---- [rustdoc] rustdoc/keyword.rs stdout ----


error: htmldocck failed!
status: exit code: 1
command: "/usr/bin/python2.7" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/keyword" "/checkout/src/test/rustdoc/keyword.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
12: @!has check failed
 // @!has foo/foo/index.html
13: @!has-dir check failed
 // @!has-dir foo/foo
Encountered 2 errors

------------------------------------------



---- [rustdoc] rustdoc/redirect-const.rs stdout ----

error: htmldocck failed!
status: exit code: 1
command: "/usr/bin/python2.7" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/redirect-const" "/checkout/src/test/rustdoc/redirect-const.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
8: @has check failed
 `XPATH PATTERN` did not match
     // @has - '//p/a' '../../foo/static.STATIC_FOO.html'
11: @has check failed
 `XPATH PATTERN` did not match
     // @has - '//p/a' '../../foo/constant.CONST_FOO.html'
Encountered 2 errors

------------------------------------------



---- [rustdoc] rustdoc/redirect-rename.rs stdout ----

error: htmldocck failed!
status: exit code: 1
command: "/usr/bin/python2.7" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/redirect-rename" "/checkout/src/test/rustdoc/redirect-rename.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
5: @has check failed
 `XPATH PATTERN` did not match
     // @has - '//p/a' '../../foo/struct.FooBar.html'
9: @has check failed
 `XPATH PATTERN` did not match
     // @has - '//p/a' '../../foo/baz/index.html'
12: @has check failed
 `XPATH PATTERN` did not match
         // @has - '//p/a' '../../foo/baz/struct.Thing.html'
Encountered 3 errors

------------------------------------------



---- [rustdoc] rustdoc/redirect.rs stdout ----

error: htmldocck failed!
status: exit code: 1
command: "/usr/bin/python2.7" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/redirect" "/checkout/src/test/rustdoc/redirect.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
23: @has check failed
 `XPATH PATTERN` did not match
 // @has - '//p/a' '../../reexp_stripped/struct.Quz.html'
Encountered 1 errors

------------------------------------------

---
thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


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" "--mode" "rustdoc" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-8/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" "8.0.0" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"


failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --exclude src/tools/tidy
Build completed unsuccessfully in 1:03:09
Build completed unsuccessfully in 1:03:09
== clock drift check ==
  local time: Fri May  1 00:06:25 UTC 2020
  network time: Fri, 01 May 2020 00:06:25 GMT
== end clock drift check ==

##[error]Bash exited with code '1'.
##[section]Finishing: Run build
##[section]Starting: Checkout rust-lang/rust@refs/pull/71724/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
Author       : Microsoft
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Cleaning any cached credential from repository: rust-lang/rust (GitHub)
##[section]Finishing: Checkout rust-lang/rust@refs/pull/71724/merge to s
Cleaning up task key
Start cleaning up orphan processes.
Terminate orphan process: pid (4093) (python)
##[section]Finishing: Finalize Job

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)

@GuillaumeGomez GuillaumeGomez force-pushed the doc-alias-improvements branch from 61be7ed to 70fcb74 Compare May 1, 2020 11:42
Copy link
Member

@ollie27 ollie27 left a comment

Choose a reason for hiding this comment

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

There are a few things we can do to simplify this. How about adding an aliases field to IndexItem to store the list of aliases for each item. Then the actual aliases map can be built inside build_index after the paths and parents for each item have been fully calculated. Additionally we can add the aliases map to CrateData so it will be included in search-index.js allowing us to remove the aliases field on Cache and the seperate aliases.js file.

src/librustdoc/html/render/cache.rs Outdated Show resolved Hide resolved
src/librustdoc/html/render/cache.rs Outdated Show resolved Hide resolved
@GuillaumeGomez GuillaumeGomez force-pushed the doc-alias-improvements branch from 82d2bb7 to a293680 Compare May 4, 2020 13:27
@GuillaumeGomez
Copy link
Member Author

GuillaumeGomez commented May 4, 2020

@ollie27 I don't know why I didn't think about putting aliases in the search index before, this is a brilliant idea!

However, I don't like the idea to put the aliases into IndexItem, I think we should keep the relation as it is now: aliases refer to items, not the opposite. It allows to just keep an index in the search index on the items, which is quite small compared to the full original item. :)

Anyway, I integrated your suggestions. Thanks a lot!

Copy link
Member

@ollie27 ollie27 left a comment

Choose a reason for hiding this comment

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

This is looking a lot better but there's still some issues to deal with. The main visible one is that the results should list items from the current crate before others.

src/librustdoc/clean/types.rs Show resolved Hide resolved
src/librustdoc/html/render.rs Outdated Show resolved Hide resolved
src/librustdoc/html/render/cache.rs Outdated Show resolved Hide resolved
src/librustdoc/html/render/cache.rs Outdated Show resolved Hide resolved
src/librustdoc/html/render/cache.rs Outdated Show resolved Hide resolved
src/librustdoc/html/render/cache.rs Outdated Show resolved Hide resolved
src/librustdoc/html/render/cache.rs Outdated Show resolved Hide resolved
src/librustdoc/html/static/main.js Outdated Show resolved Hide resolved
src/test/rustdoc-js/doc-alias.rs Outdated Show resolved Hide resolved
src/test/rustdoc-js-std/alias-2.js Outdated Show resolved Hide resolved
@GuillaumeGomez GuillaumeGomez force-pushed the doc-alias-improvements branch 2 times, most recently from 4081845 to b0c5e2c Compare May 7, 2020 20:01
@GuillaumeGomez
Copy link
Member Author

Updated!

@rust-highfive
Copy link
Collaborator

The job mingw-check 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.
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /home/vsts/work/_temp/4a3b0c5d-cb2e-4f81-bbd3-b2e7b1311687.sh

##[section]Finishing: Disable git automatic line ending conversion
##[section]Starting: Checkout rust-lang/rust@refs/pull/71724/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
---
##[command]git remote add origin https://github.com/rust-lang/rust
##[command]git config gc.auto 0
##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
##[command]git config --get-all http.proxy
##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/71724/merge:refs/remotes/pull/71724/merge
---
 ---> 3adb0605cc65
Step 6/7 : ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
 ---> Using cache
 ---> 28dbc326cb7f
Step 7/7 : ENV SCRIPT python3 ../x.py test src/tools/expand-yaml-anchors &&            python3 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu &&            python3 ../x.py build --stage 0 src/tools/build-manifest &&            python3 ../x.py test --stage 0 src/tools/compiletest &&            python3 ../x.py test src/tools/tidy &&            python3 ../x.py doc --stage 0 src/libstd &&            /scripts/validate-toolstate.sh
 ---> 537a01811900
Successfully built 537a01811900
Successfully tagged rust-ci:latest
Built container sha256:537a018119009dc218456238dec90b5530050db1e2a1e166550c218003f6159d
---
    Checking rustc_feature v0.0.0 (/checkout/src/librustc_feature)
    Checking fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
    Checking rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
    Checking rustc_hir v0.0.0 (/checkout/src/librustc_hir)
    Checking rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
    Checking rustc_parse v0.0.0 (/checkout/src/librustc_parse)
    Checking rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
    Checking rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
    Checking rustc_ast_passes v0.0.0 (/checkout/src/librustc_ast_passes)
---
configure: llvm.ccache          := sccache
configure: rust.codegen-units-std := 1
configure: rust.verify-llvm-ir  := True
configure: dist.missing-tools   := True
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure: 
configure: run `python /checkout/x.py --help`
configure: 
---
Hugepagesize:       2048 kB
DirectMap4k:      149440 kB
DirectMap2M:     2996224 kB
DirectMap1G:     6291456 kB
+ python3 ../x.py test src/tools/expand-yaml-anchors
Ensuring the YAML anchors in the GitHub Actions config were expanded
Ensuring the YAML anchors in the GitHub Actions config were expanded
Building stage0 tool expand-yaml-anchors (x86_64-unknown-linux-gnu)
   Compiling unicode-xid v0.2.0
   Compiling syn v1.0.11
   Compiling linked-hash-map v0.5.2
   Compiling lazy_static v1.4.0
   Compiling lazy_static v1.4.0
   Compiling yaml-rust v0.4.3
   Compiling quote v1.0.2
   Compiling thiserror-impl v1.0.5
   Compiling thiserror v1.0.5
   Compiling yaml-merge-keys v0.4.0
   Compiling expand-yaml-anchors v0.1.0 (/checkout/src/tools/expand-yaml-anchors)
Build completed successfully in 0:00:27
+ python3 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu
    Finished dev [unoptimized] target(s) in 0.20s
Checking rustdoc artifacts (x86_64-unknown-linux-gnu -> i686-pc-windows-gnu)
---
    Checking rustc_feature v0.0.0 (/checkout/src/librustc_feature)
    Checking fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
    Checking rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
    Checking rustc_hir v0.0.0 (/checkout/src/librustc_hir)
    Checking rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
    Checking rustc_parse v0.0.0 (/checkout/src/librustc_parse)
    Checking rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
    Checking rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
    Checking rustc_ast_passes v0.0.0 (/checkout/src/librustc_ast_passes)
---
   Compiling cargo_metadata v0.9.1
   Compiling tidy v0.1.0 (/checkout/src/tools/tidy)
    Finished release [optimized] target(s) in 23.18s
tidy check
tidy error: /checkout/src/test/rustdoc-js/doc-alias.js:36: tab character
tidy error: /checkout/src/test/rustdoc-js/doc-alias.js:47: tab character
tidy error: /checkout/src/test/rustdoc-js/doc-alias.js:58: tab character
tidy error: /checkout/src/test/rustdoc-js/doc-alias.js:77: tab character
tidy error: /checkout/src/test/rustdoc-js/doc-alias.js:79: tab character
tidy error: /checkout/src/test/rustdoc-js/doc-alias.js:88: tab character
tidy error: /checkout/src/test/rustdoc-js/doc-alias.js:99: tab character
tidy error: /checkout/src/test/rustdoc-js/doc-alias.js:110: tab character
tidy error: /checkout/src/test/rustdoc-js/doc-alias.js:121: tab character
tidy error: /checkout/src/test/rustdoc-js/doc-alias.js:132: tab character
tidy error: /checkout/src/test/rustdoc-js/doc-alias.js:143: tab character
tidy error: /checkout/src/test/rustdoc-js/doc-alias.js:154: tab character
tidy error: /checkout/src/test/rustdoc-js/doc-alias.js:165: tab character
tidy error: /checkout/src/test/rustdoc-js/doc-alias.js:176: tab character
tidy error: /checkout/src/test/rustdoc-js/doc-alias.js:187: tab character
tidy error: /checkout/src/test/rustdoc-js/doc-alias.js:198: tab character
tidy error: /checkout/src/test/rustdoc-js/doc-alias.js:209: tab character
tidy error: /checkout/src/test/rustdoc-js/doc-alias.js:220: tab character
tidy error: /checkout/src/test/rustdoc-js/doc-alias.js:237: tab character
tidy error: /checkout/src/test/rustdoc-js/doc-alias.js:248: tab character
tidy error: /checkout/src/test/rustdoc-js/doc-alias.js:259: tab character
some tidy checks failed
Found 492 error codes
Found 0 error codes with no tests
Done!
Done!


command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo"


failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
Build completed unsuccessfully in 0:00:35
Build completed unsuccessfully in 0:00:35
== clock drift check ==
  local time: Thu May  7 20:19:52 UTC 2020
  network time: Thu, 07 May 2020 20:19:52 GMT
== end clock drift check ==

##[error]Bash exited with code '1'.
##[section]Finishing: Run build
##[section]Starting: Checkout rust-lang/rust@refs/pull/71724/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
Author       : Microsoft
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Cleaning any cached credential from repository: rust-lang/rust (GitHub)
##[section]Finishing: Checkout rust-lang/rust@refs/pull/71724/merge to s
Cleaning up task key
Start cleaning up orphan processes.
Terminate orphan process: pid (13424) (python)
##[section]Finishing: Finalize Job

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)

@GuillaumeGomez GuillaumeGomez force-pushed the doc-alias-improvements branch from b0c5e2c to 2fded7c Compare May 8, 2020 12:02
@GuillaumeGomez
Copy link
Member Author

Fixed tidy issue...

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-8 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.
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /home/vsts/work/_temp/14559034-b9e3-4701-b2e1-480bb5520287.sh

##[section]Finishing: Disable git automatic line ending conversion
##[section]Starting: Checkout rust-lang/rust@refs/pull/71724/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
---
##[command]git remote add origin https://github.com/rust-lang/rust
##[command]git config gc.auto 0
##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
##[command]git config --get-all http.proxy
##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/71724/merge:refs/remotes/pull/71724/merge
---
 ---> cb2676f08729
Step 5/8 : ENV RUST_CONFIGURE_ARGS       --build=x86_64-unknown-linux-gnu       --llvm-root=/usr/lib/llvm-8       --enable-llvm-link-shared       --set rust.thin-lto-import-instr-limit=10
 ---> Using cache
 ---> df25ce111862
Step 6/8 : ENV SCRIPT python2.7 ../x.py test --exclude src/tools/tidy &&            python2.7 ../x.py test src/test/mir-opt --pass=build                                   --target=armv5te-unknown-linux-gnueabi &&            python2.7 ../x.py test src/tools/tidy
 ---> 599b9ac96b27
Step 7/8 : ENV NO_DEBUG_ASSERTIONS=1
 ---> Using cache
 ---> 091087e35a36
---
   Compiling rustc_feature v0.0.0 (/checkout/src/librustc_feature)
   Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
   Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
   Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
   Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
   Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
   Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
   Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
   Compiling rustc_ast_passes v0.0.0 (/checkout/src/librustc_ast_passes)
---
   Compiling rustc_feature v0.0.0 (/checkout/src/librustc_feature)
   Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
   Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
   Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
   Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
   Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
   Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
   Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
   Compiling rustc_ast_passes v0.0.0 (/checkout/src/librustc_ast_passes)
---
......................i............................................................................. 1800/9995
.................................................................................................... 1900/9995
.......................................i............................................................ 2000/9995
.................................................................................................... 2100/9995
.............................iiiii.................................................................. 2200/9995
.................................................................................................... 2400/9995
.................................................................................................... 2500/9995
.................................................................................................... 2600/9995
.................................................................................................... 2700/9995
---
....................i...............i............................................................... 5100/9995
.................................................................................................... 5200/9995
..................................................................i................................. 5300/9995
..........................................................i......................................... 5400/9995
...............................................................ii.ii........i...i................... 5500/9995
.....i.............................................................................................. 5700/9995
...........i........................................................................................ 5800/9995
...............................................ii.....................................i............. 5900/9995
.................................................................................................... 6000/9995
.................................................................................................... 6000/9995
.................................................................................................... 6100/9995
...................................................................................ii...i..ii....... 6200/9995
.................................................................................................... 6400/9995
.................................................................................................... 6500/9995
.................................................................................................... 6600/9995
.................................................................................................... 6600/9995
...............i..ii................................................................................ 6700/9995
.................................................................................................... 6900/9995
................i................................................................................... 7000/9995
.................................................................................................... 7100/9995
..........................................................i......................................... 7200/9995
---
.................................................................................................... 7900/9995
.................................................................................................... 8000/9995
.................................................................................................... 8100/9995
..........................i......................................................................... 8200/9995
................................................................................iiiiii.iiiii.i...... 8300/9995
.................................i.................................................................. 8500/9995
.................................................................................................... 8600/9995
.................................................................................................... 8700/9995
.................................................................................................... 8800/9995
---
Suite("src/test/codegen") not skipped for "bootstrap::test::Codegen" -- not in ["src/tools/tidy"]
Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)

running 188 tests
iiii......i.............ii.i..........i...............................i..i..................i....i.. 100/188
..........i.i.i...iii..iiiiiiiiiiiiiiii.......................iii...............ii......

 finished in 5.713
Suite("src/test/codegen-units") not skipped for "bootstrap::test::CodegenUnits" -- not in ["src/tools/tidy"]
Check compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---
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 9 tests
iiiiiiiii

 finished in 0.142
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)
---
Suite("src/test/debuginfo") not skipped for "bootstrap::test::Debuginfo" -- not in ["src/tools/tidy"]
Check compiletest suite=debuginfo mode=debuginfo (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)

running 115 tests
iiiii..i.....i..i...i..i.i.i..i..i..ii....i.i....ii..........iiii.........i.....i..i.......ii.i.ii.. 100/115
...iiii.....ii.

 finished in 14.772
Suite("src/test/ui-fulldeps") not skipped for "bootstrap::test::UiFullDeps" -- not in ["src/tools/tidy"]
Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---

   Doc-tests core

running 2552 tests
......iiiii......................................................................................... 100/2552
.......................................................................................ii........... 200/2552
.......................i............................................................................ 400/2552
.............................................................................i..i..................i 500/2552
iii................................................................................................. 600/2552
.................................................................................................... 700/2552
---
.................................................................................................... 500/764
......................thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', src/libstd/sync/mpsc/mod.rs:2741:22
....thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', src/libstd/sync/mpsc/mod.rs:2778:21
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: "SendError(..)"', src/libstd/sync/mpsc/mod.rs:2766:17
.......thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', src/libstd/sync/mpsc/mod.rs:2645:13
..........................................thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', src/libstd/sync/mpsc/mod.rs:1997:22
.....thread '..<unnamed>.' panicked at '..called `Result::unwrap()` on an `Err` value: RecvError', .src/libstd/sync/mpsc/mod.rsthread ':2034:21
.............. 600/764
........................thread '<unnamed>' panicked at 'explicit panic', src/libstd/sync/mutex.rs:634:13
..thread '<unnamed>' panicked at 'test panic in inner thread to poison mutex', src/libstd/sync/mutex.rs:588:13
....thread '<unnamed>' panicked at 'test panic in inner thread to poison mutex', src/libstd/sync/mutex.rs:564:13
---

running 1020 tests
i................................................................................................... 100/1020
.................................................................................................... 200/1020
...................iii......i......i...i......i..................................................... 300/1020
.................................................................................................... 400/1020
....................................................i....i......................................ii.. 500/1020
.................................................................................................... 700/1020
.................................................................................................... 700/1020
..............................................iiii.................................................. 800/1020
.................................................................................................... 900/1020
....................................................................iiii............................ 1000/1020
test result: ok. 1000 passed; 0 failed; 20 ignored; 0 measured; 0 filtered out

 finished in 153.229
Set({"src/libterm"}) not skipped for "bootstrap::test::Crate" -- not in ["src/tools/tidy"]
---

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

 finished in 0.981
Set({"/checkout/src/librustc_query_system"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Testing rustc_query_system stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
     Running build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc_query_system-d2b3159181a74606

running 0 tests

---
Set({"/checkout/src/librustc_parse"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"/checkout/src/librustc_passes"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"/checkout/src/librustc_plugin_impl"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"/checkout/src/librustc_privacy"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"/checkout/src/librustc_query_system"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"/checkout/src/librustc_save_analysis"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"/checkout/src/librustc_session"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"/checkout/src/librustc_span"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"/checkout/src/librustc_symbol_mangling"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
---
Suite("src/test/run-make-fulldeps") not skipped for "bootstrap::test::RunMakeFullDeps" -- not in ["src/tools/tidy"]
Check compiletest suite=run-make-fulldeps mode=run-make (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)

running 211 tests
......................i...ii.......................................................................i 100/211
........................................iiiiii......i..............iii.............................. 200/211
.......ii..

 finished in 67.550
Set({"src/doc/rustdoc"}) not skipped for "bootstrap::test::RustdocBook" -- not in ["src/tools/tidy"]
doc tests for: /checkout/src/doc/rustdoc/src/advanced-features.md
---
doc tests for: /checkout/src/doc/rustc/src/targets/index.md
doc tests for: /checkout/src/doc/rustc/src/what-is-rustc.md
 finished in 4.071
Set({"src/test/rustdoc-js-std"}) not skipped for "bootstrap::test::RustdocJSStd" -- not in ["src/tools/tidy"]
Checking "alias-1" ... OK
Checking "alias-2" ... OK
Checking "alias-3" ... OK
Checking "alias" ... OK
Checking "basic" ... OK
Checking "deduplication" ... OK
Checking "enum-option" ... OK
Checking "filter-crate" ... OK
Checking "fn-forget" ... OK
Checking "from_u" ... OK
Checking "keyword" ... OK
Checking "macro-check" ... OK
Checking "macro-print" ... OK
Checking "multi-query" ... OK
Checking "never" ... OK
Checking "quoted" ... OK
Checking "return-specific-literal" ... OK
Checking "return-specific" ... OK
Checking "should-fail" ... OK
Checking "string-from_ut" ... OK
Checking "struct-vec" ... OK
Checking "vec-new" ... OK
Check compiletest suite=rustdoc-js mode=js-doc-test (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)

running 7 tests
.F.....
.F.....
failures:

---- [js-doc-test] rustdoc-js/doc-alias.rs stdout ----

error: rustdoc-js test failed!
status: exit code: 1
command: "/usr/bin/node" "/checkout/src/tools/rustdoc-js/tester.js" "--doc-folder" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-js/doc-alias" "--crate-name" "doc_alias" "--test-file" "/checkout/src/test/rustdoc-js/doc-alias.js"
------------------------------------------
Checking "doc-alias" ... 

------------------------------------------
------------------------------------------
stderr:
------------------------------------------
tmp.js:88
                'is_alias': true

SyntaxError: Unexpected string
SyntaxError: Unexpected string
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at loadContent (/checkout/src/tools/rustdoc-js/tester.js:165:7)
    at runChecks (/checkout/src/tools/rustdoc-js/tester.js:310:22)
    at checkFile (/checkout/src/tools/rustdoc-js/tester.js:412:12)
    at main (/checkout/src/tools/rustdoc-js/tester.js:428:19)
    at Object.<anonymous> (/checkout/src/tools/rustdoc-js/tester.js:441:14)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
------------------------------------------



---
thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


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-js" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-js" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "js-doc-test" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-8/bin/FileCheck" "--nodejs" "/usr/bin/node" "--host-rustcflags" "-Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-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" "8.0.0" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"


failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --exclude src/tools/tidy
Build completed unsuccessfully in 1:41:07
Build completed unsuccessfully in 1:41:07
== clock drift check ==
  local time: Fri May  8 13:49:21 UTC 2020
  network time: Fri, 08 May 2020 13:49:21 GMT
== end clock drift check ==

##[error]Bash exited with code '1'.
##[section]Finishing: Run build
##[section]Starting: Checkout rust-lang/rust@refs/pull/71724/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
Author       : Microsoft
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Cleaning any cached credential from repository: rust-lang/rust (GitHub)
##[section]Finishing: Checkout rust-lang/rust@refs/pull/71724/merge to s
Cleaning up task key
Start cleaning up orphan processes.
Terminate orphan process: pid (4790) (python)
##[section]Finishing: Finalize Job

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)

@GuillaumeGomez GuillaumeGomez force-pushed the doc-alias-improvements branch from 2fded7c to 1b84e80 Compare May 8, 2020 21:35
@GuillaumeGomez
Copy link
Member Author

And with this one I added the missing comma in the JS test (long day).

@GuillaumeGomez GuillaumeGomez requested a review from ollie27 May 10, 2020 10:35
src/librustdoc/html/render/cache.rs Outdated Show resolved Hide resolved
@@ -582,6 +553,12 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> String {
parent_idx: None,
search_type: get_index_search_type(&item),
});
for alias in item.attrs.get_doc_aliases().into_iter() {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
for alias in item.attrs.get_doc_aliases().into_iter() {
for alias in item.attrs.get_doc_aliases() {

When I make a suggestion like this it applies to all instances not just the one I comment on. This is why we should be trying to avoid code duplication.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry...

src/librustdoc/html/render/cache.rs Outdated Show resolved Hide resolved
src/librustdoc/html/render/cache.rs Outdated Show resolved Hide resolved
src/librustdoc/clean/types.rs Show resolved Hide resolved

for alias in item.attrs.get_doc_aliases().into_iter() {
self.aliases
.entry(alias.to_lowercase())
Copy link
Member

Choose a reason for hiding this comment

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

I guess it's not a big issue for now. It does seem weird that aliases are treated differently to the other search results though.

@GuillaumeGomez
Copy link
Member Author

Updated, the code is indeed much better!

Copy link
Member

@ollie27 ollie27 left a comment

Choose a reason for hiding this comment

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

The #[doc(alias)] implementation is looking a lot better now, nice work.

Just one nit and with the commits squashed r=me.

src/librustdoc/html/render/cache.rs Outdated Show resolved Hide resolved
@GuillaumeGomez GuillaumeGomez force-pushed the doc-alias-improvements branch from 9050eed to e553226 Compare May 14, 2020 09:34
…terministic results

  * Update Javascript to take this change into account
* Update CrateData::aliases field to take a reference instead (it allowed to remove a conversion loop)
@GuillaumeGomez GuillaumeGomez force-pushed the doc-alias-improvements branch from e553226 to e17ac66 Compare May 14, 2020 09:36
@GuillaumeGomez
Copy link
Member Author

I squashed a few commits but kept the big changes into their own commits if this is ok with you.

@GuillaumeGomez
Copy link
Member Author

cc @ollie27

@ollie27
Copy link
Member

ollie27 commented May 15, 2020

I squashed a few commits but kept the big changes into their own commits if this is ok with you.

There are still commits that makes changes that subsequent commits just revert. Feel free to r=me if you think it's too much work to clean up the commits or you don't want to squash into one commit. It's the end result that matters most after all.

@GuillaumeGomez
Copy link
Member Author

Well, for me it's important to keep one change per commit. It makes the git history easier to follow. Even more considering how much the tests impact here. I squashed commits in order to keep it clean so I'll r+ it like this. Thanks a lot for your great reviews! Once this PR is merged, I'll need to check what remains to be done so this feature can finally be stabilized.

@bors: r+

@bors
Copy link
Contributor

bors commented May 15, 2020

📌 Commit e17ac66 has been approved by GuillaumeGomez

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label May 15, 2020
@GuillaumeGomez
Copy link
Member Author

Erf...

@bors: r-

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 15, 2020
@GuillaumeGomez
Copy link
Member Author

@bors: r=ollie27

@bors
Copy link
Contributor

bors commented May 15, 2020

📌 Commit e17ac66 has been approved by ollie27

@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 May 15, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request May 15, 2020
…ts, r=ollie27

Doc alias improvements

After [this message](rust-lang#50146 (comment)), I realized that the **doc alias**. So this PR does the followings:

 * Align the alias discovery on items added into the search-index. It brings a few nice advantages:
   * Instead of cloning the data between the two (in rustdoc source code), we now have the search-index one and aliases which reference to the first one. So we go from one big map containing a lot of duplicated data to just integers...
 * In the front-end (main.js), I improved the code around aliases to allow them to go through the same transformation as other items when we show the search results.
 * Improve the search tester in order to perform multiple requests into one file (I think it's better in this case than having a file for each case considering how many there are...)
    * I also had to add the new function inside the tester (`handleAliases`)

Once this PR is merged, I intend to finally stabilize this feature.

r? @ollie27

cc @rust-lang/rustdoc
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request May 15, 2020
…ts, r=ollie27

Doc alias improvements

After [this message](rust-lang#50146 (comment)), I realized that the **doc alias**. So this PR does the followings:

 * Align the alias discovery on items added into the search-index. It brings a few nice advantages:
   * Instead of cloning the data between the two (in rustdoc source code), we now have the search-index one and aliases which reference to the first one. So we go from one big map containing a lot of duplicated data to just integers...
 * In the front-end (main.js), I improved the code around aliases to allow them to go through the same transformation as other items when we show the search results.
 * Improve the search tester in order to perform multiple requests into one file (I think it's better in this case than having a file for each case considering how many there are...)
    * I also had to add the new function inside the tester (`handleAliases`)

Once this PR is merged, I intend to finally stabilize this feature.

r? @ollie27

cc @rust-lang/rustdoc
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request May 15, 2020
…ts, r=ollie27

Doc alias improvements

After [this message](rust-lang#50146 (comment)), I realized that the **doc alias**. So this PR does the followings:

 * Align the alias discovery on items added into the search-index. It brings a few nice advantages:
   * Instead of cloning the data between the two (in rustdoc source code), we now have the search-index one and aliases which reference to the first one. So we go from one big map containing a lot of duplicated data to just integers...
 * In the front-end (main.js), I improved the code around aliases to allow them to go through the same transformation as other items when we show the search results.
 * Improve the search tester in order to perform multiple requests into one file (I think it's better in this case than having a file for each case considering how many there are...)
    * I also had to add the new function inside the tester (`handleAliases`)

Once this PR is merged, I intend to finally stabilize this feature.

r? @ollie27

cc @rust-lang/rustdoc
bors added a commit to rust-lang-ci/rust that referenced this pull request May 16, 2020
Rollup of 9 pull requests

Successful merges:

 - rust-lang#71662 (Implement FromStr for OsString)
 - rust-lang#71677 (Add explicit references to the BuildHasher trait)
 - rust-lang#71724 (Doc alias improvements)
 - rust-lang#71948 (Suggest to await future before ? operator)
 - rust-lang#72090 (rustc_driver: factor out computing the exit code)
 - rust-lang#72206 (Cleanup stale 'FIXME(rust-lang#64197)')
 - rust-lang#72218 (make sure even unleashed miri does not do pointer stuff)
 - rust-lang#72220 ([const-prop] Don't replace Rvalues that are already constants)
 - rust-lang#72224 (doc: add links to rotate_(left|right))

Failed merges:

r? @ghost
@bors bors merged commit 154db50 into rust-lang:master May 16, 2020
@GuillaumeGomez GuillaumeGomez deleted the doc-alias-improvements branch May 16, 2020 12:35
@ollie27
Copy link
Member

ollie27 commented May 16, 2020

Well, for me it's important to keep one change per commit. It makes the git history easier to follow.

I agree but that's not what we have. Take for example cf41b1d which adds pub to IndexItem and then 883c177 which removes it. There was no reason for that change and in my opinion no reason for it to now be in the git history. This kind of thing makes the git history harder to follow.

@GuillaumeGomez
Copy link
Member Author

Oh, I completely overlooked it, sorry about this too...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants