Skip to content

Fix attrs pos #60093

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

Merged
merged 4 commits into from
May 18, 2019
Merged

Fix attrs pos #60093

merged 4 commits into from
May 18, 2019

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Apr 18, 2019

Fixes #60042.

Screenshot:

Screenshot 2019-05-12 at 15 02 25

r? @rust-lang/rustdoc

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 18, 2019
@jonas-schievink jonas-schievink added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Apr 18, 2019
@rust-highfive
Copy link
Contributor

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:0140d278:start=1555621702569470955,finish=1555621825043885335,duration=122474414380
$ 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
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
travis_time:start:test_assembly
Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:18:14] 
[01:18:14] running 9 tests
[01:18:14] iiiiiiiii
[01:18:14] 
[01:18:14]  finished in 0.158
[01:18:14] 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:31] 
[01:18:31] running 121 tests
[01:18:58] .iiiii...i.....i..i...i..i.i.i..i.ii...i.....i..i....i..........iiii..........i...ii...i.......ii.i. 100/121
[01:19:02] i.i......iii.i.....ii
[01:19:02] 
[01:19:02]  finished in 31.465
[01:19:02] travis_fold:end:test_debuginfo

---
travis_time:start:test_rustdoc
Check compiletest suite=rustdoc mode=rustdoc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:23:01] 
[01:23:01] running 304 tests
[01:24:13] .....F......................i....................................................................... 100/304
[01:26:22] .................................................................................................... 300/304
[01:26:24] ....
[01:26:24] failures:
[01:26:24] 
[01:26:24] 
[01:26:24] ---- [rustdoc] rustdoc/attributes.rs stdout ----
[01:26:24] 
[01:26:24] error: htmldocck failed!
[01:26:24] status: exit code: 1
[01:26:24] command: "/usr/bin/python2.7" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/attributes" "/checkout/src/test/rustdoc/attributes.rs"
[01:26:24] ------------------------------------------
[01:26:24] 
[01:26:24] ------------------------------------------
[01:26:24] stderr:
[01:26:24] stderr:
[01:26:24] ------------------------------------------
[01:26:24] 11: @has check failed
[01:26:24]  `XPATH PATTERN` did not match
[01:26:24]  // @has foo/enum.Foo.html '//*[@class="docblock attributes"]' '#[repr(i64)]'
[01:26:24] 12: @has check failed
[01:26:24]  `XPATH PATTERN` did not match
[01:26:24]  // @has foo/enum.Foo.html '//*[@class="docblock attributes"]' '#[must_use]'
[01:26:24] Encountered 2 errors
[01:26:24] 
[01:26:24] ------------------------------------------
[01:26:24] 
---
[01:26:24] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:517:22
[01:26:24] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[01:26:24] 
[01:26:24] 
[01:26:24] 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-6.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" "6.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"
[01:26:24] 
[01:26:24] 
[01:26:24] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:26:24] Build completed unsuccessfully in 0:20:34
[01:26:24] Build completed unsuccessfully in 0:20:34
[01:26:24] make: *** [check] Error 1
[01:26:24] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:081c847a
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Thu Apr 18 22:36:59 UTC 2019
---
travis_time:end:0df58f80:start=1555627021113141417,finish=1555627021169388909,duration=56247492
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0459ce56
$ 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:0682ab4c
$ 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 Apr 28, 2019

r? @QuietMisdreavus

@GuillaumeGomez
Copy link
Member Author

r? @Manishearth

@GuillaumeGomez
Copy link
Member Author

ping

@Manishearth
Copy link
Member

I don't understand what this is fixing, and I don't understand how. When filing such issues please include screenshots, and include a before/after in the PR.

Also you've added some parameters to some functions here but it's totally unclear what they do, please document them.

@GuillaumeGomez
Copy link
Member Author

I thought the display on the issue was clear enough, my bad... The point here is to fix the alignment of the #[...] attributes on the types declaration. Those new arguments allow to add a new class for attributes generated inside the type declaration in order to prevent those alignment issues. The screenshot itself would just be a "normal" looking type declaration, which doesn't really makes sense on its own since it's supposed to look like this from the beginning.

@Manishearth
Copy link
Member

There's no attribute there. I see padding, but no attribute.

A link to a broken page isn't good enough for this, because that page may not render the same for everyone, and once the bug is fixed it will be hard to know what was broken. Issues should be self-contained and make sense even after being fixed. So should pull requests, the justification for this should be in the comments.

The screenshot in a PR helps highlight what was changed by focusing on that. It's less necessary since usually it's just normal, but the screenshot in the issue is pretty important.

image

@GuillaumeGomez
Copy link
Member Author

GuillaumeGomez commented May 12, 2019

The issue has a broken link, not a screenshot?! Damn it... I'll try to change it later on. Sorry about the mess...

@GuillaumeGomez
Copy link
Member Author

@Manishearth I added a screenshot on both the issue and the PR.

@@ -3783,7 +3789,7 @@ const ATTRIBUTE_WHITELIST: &'static [&'static str] = &[
"non_exhaustive"
];

fn render_attributes(w: &mut dyn fmt::Write, it: &clean::Item) -> fmt::Result {
fn render_attributes(w: &mut dyn fmt::Write, it: &clean::Item, top: bool) -> fmt::Result {
Copy link
Member

Choose a reason for hiding this comment

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

Still need comments explaining what this parameter does.

Copy link
Member

@Manishearth Manishearth left a comment

Choose a reason for hiding this comment

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

code looks good, please add some comments on the function and on the CSS

@GuillaumeGomez
Copy link
Member Author

Yes sir!

@GuillaumeGomez
Copy link
Member Author

Updated!

@GuillaumeGomez
Copy link
Member Author

@Manishearth Is my comment good enough or do you have something else in mind?

@Manishearth
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented May 18, 2019

📌 Commit 180b859 has been approved by Manishearth

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 18, 2019
@bors
Copy link
Collaborator

bors commented May 18, 2019

⌛ Testing commit 180b859 with merge 963184b...

bors added a commit that referenced this pull request May 18, 2019
@bors
Copy link
Collaborator

bors commented May 18, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: Manishearth
Pushing 963184b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 18, 2019
@bors bors merged commit 180b859 into rust-lang:master May 18, 2019
@GuillaumeGomez GuillaumeGomez deleted the fix-attrs-pos branch May 19, 2019 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[doc] Unwanted padding in type declaration
7 participants