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

rustdoc: display rustc_private APIs as "Internal" #56824

Merged
merged 2 commits into from
Dec 22, 2018

Conversation

euclio
Copy link
Contributor

@euclio euclio commented Dec 14, 2018

This PR updates the display of rustc_private APIs to be "Internal" instead of "Experimental", and changes the colors appropriately. It also updates the copy of the rustc_private feature to sound more informative and less like a compiler suggestion.

The PR additionally contains a significant refactor of the short_stability function to remove duplication and fix a few rendering bugs due to extra or missing spaces.

Before:

screen shot 2018-12-14 at 11 45 28 am

After:

screen shot 2018-12-14 at 11 45 11 am

@euclio euclio changed the title display rustc_private APIs as "Internal" rustdoc: display rustc_private APIs as "Internal" Dec 14, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.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:00cf2c79:start=1544807335307619232,finish=1544807338304616753,duration=2996997521
$ 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-5.0
---
[00:45:59] .................................................................................................... 2100/5169
[00:46:04] .................................................................................................... 2200/5169
[00:46:07] .................................................................................................... 2300/5169
[00:46:11] .................................................................................................... 2400/5169
[00:46:15] ........................................................................................F........... 2500/5169
[00:46:22] .................................................................................................... 2700/5169
[00:46:26] .................................................................................................... 2800/5169
[00:46:29] .................................................................................................... 2900/5169
[00:46:32] .................................................................................................... 3000/5169
---
[00:47:46] 
[00:47:46] ---- [ui] ui/issues/issue-37887.rs stdout ----
[00:47:46] diff of stderr:
[00:47:46] 
[00:47:46] 4 LL |     use libc::*; //~ ERROR unresolved import
[00:47:46] 5    |         ^^^^ maybe a missing `extern crate libc;`?
[00:47:46] - error[E0658]: use of unstable library feature 'rustc_private': this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead? (see issue #27812)
[00:47:46] - error[E0658]: use of unstable library feature 'rustc_private': this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead? (see issue #27812)
[00:47:46] + error[E0658]: use of unstable library feature 'rustc_private': This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from [crates.io](https://crates.io) via [`Cargo.toml`](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html). (see issue #27812)
[00:47:46] 9    |
[00:47:46] 9    |
[00:47:46] 10 LL |     extern crate libc; //~ ERROR use of unstable
[00:47:46] 
[00:47:46] The actual stderr differed from the expected stderr.
[00:47:46] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-37887/issue-37887.stderr
[00:47:46] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-37887/issue-37887.stderr
[00:47:46] To update references, rerun the tests and pass the `--bless` flag
[00:47:46] To only update this specific test, also pass `--test-args issues/issue-37887.rs`
[00:47:46] error: 1 errors occurred comparing output.
[00:47:46] status: exit code: 1
[00:47:46] status: exit code: 1
[00:47:46] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-37887.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-37887/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-37887/auxiliary" "-A" "unused"
[00:47:46] ------------------------------------------
[00:47:46] 
[00:47:46] ------------------------------------------
[00:47:46] stderr:
[00:47:46] stderr:
[00:47:46] ------------------------------------------
[00:47:46] {"message":"unresolved import `libc`","code":{"code":"E0432","explanation":"\nAn import was unresolved.\n\nErroneous code example:\n\n```compile_failst" "--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" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-5.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -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" "5.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[00:47:46] 
[00:47:46] 
[00:47:46] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:47:46] Build completed unsuccessfully in 0:03:51
[00:47:46] Build completed unsuccessfully in 0:03:51
[00:47:46] make: *** [check] Error 1
[00:47:46] Makefile:58: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_tFri, 14 Dec 2018 17:56:53 GMT
travis_time:end:04ec2a7e:start=1544810213363188482,finish=1544810213401227658,duration=38039176
The command "date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

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)

@Dylan-DPC-zz
Copy link

r? @QuietMisdreavus

@Dylan-DPC-zz Dylan-DPC-zz added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 14, 2018
@@ -199,6 +203,7 @@ a.test-arrow {
}

.stab.unstable { background: #FFF5D6; border-color: #FFC600; color: #404040; }
.stab.internal { background: #FF9A91; border-color: #B71C1C; color: #404040; }
Copy link
Member

Choose a reason for hiding this comment

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

This color seems a bit dark to me, somehow. The color-contrast tool i fed the colors to said it should be fine, but i think it would be much easier to read if the background color here (and in the light theme) were changed to something like #ffb9b3. That gives you something like this:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that color looks better to me too. Fixed.

@QuietMisdreavus QuietMisdreavus 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 Dec 20, 2018
Copy link
Member

@QuietMisdreavus QuietMisdreavus left a comment

Choose a reason for hiding this comment

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

Thanks so much! I like the refactors you did, it makes the code easier to read.

@QuietMisdreavus
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Dec 20, 2018

📌 Commit 8d393bf has been approved by QuietMisdreavus

@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 Dec 20, 2018
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Dec 21, 2018
…avus

rustdoc: display rustc_private APIs as "Internal"

This PR updates the display of `rustc_private` APIs to be "Internal" instead of "Experimental", and changes the colors appropriately. It also updates the copy of the `rustc_private` feature to sound more informative and less like a compiler suggestion.

The PR additionally contains a significant refactor of the `short_stability` function to remove duplication and fix a few rendering bugs due to extra or missing spaces.

Before:

![screen shot 2018-12-14 at 11 45 28 am](https://user-images.githubusercontent.com/1372438/50015926-c9768d80-ff95-11e8-9649-5df29df6909b.png)

After:

![screen shot 2018-12-14 at 11 45 11 am](https://user-images.githubusercontent.com/1372438/50015934-cf6c6e80-ff95-11e8-912b-74b893f55425.png)
Centril added a commit to Centril/rust that referenced this pull request Dec 22, 2018
…avus

rustdoc: display rustc_private APIs as "Internal"

This PR updates the display of `rustc_private` APIs to be "Internal" instead of "Experimental", and changes the colors appropriately. It also updates the copy of the `rustc_private` feature to sound more informative and less like a compiler suggestion.

The PR additionally contains a significant refactor of the `short_stability` function to remove duplication and fix a few rendering bugs due to extra or missing spaces.

Before:

![screen shot 2018-12-14 at 11 45 28 am](https://user-images.githubusercontent.com/1372438/50015926-c9768d80-ff95-11e8-9649-5df29df6909b.png)

After:

![screen shot 2018-12-14 at 11 45 11 am](https://user-images.githubusercontent.com/1372438/50015934-cf6c6e80-ff95-11e8-912b-74b893f55425.png)
@bors
Copy link
Contributor

bors commented Dec 22, 2018

⌛ Testing commit 8d393bf with merge 24667aa...

bors added a commit that referenced this pull request Dec 22, 2018
rustdoc: display rustc_private APIs as "Internal"

This PR updates the display of `rustc_private` APIs to be "Internal" instead of "Experimental", and changes the colors appropriately. It also updates the copy of the `rustc_private` feature to sound more informative and less like a compiler suggestion.

The PR additionally contains a significant refactor of the `short_stability` function to remove duplication and fix a few rendering bugs due to extra or missing spaces.

Before:

![screen shot 2018-12-14 at 11 45 28 am](https://user-images.githubusercontent.com/1372438/50015926-c9768d80-ff95-11e8-9649-5df29df6909b.png)

After:

![screen shot 2018-12-14 at 11 45 11 am](https://user-images.githubusercontent.com/1372438/50015934-cf6c6e80-ff95-11e8-912b-74b893f55425.png)
@bors
Copy link
Contributor

bors commented Dec 22, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: QuietMisdreavus
Pushing 24667aa to master...

@bors bors merged commit 8d393bf into rust-lang:master Dec 22, 2018
@euclio euclio deleted the internal-apis branch December 22, 2018 14:17
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.

5 participants