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

Add #[doc(hidden)] attribute on compiler generated module. #60562

Merged
merged 1 commit into from
May 14, 2019

Conversation

iliekturtles
Copy link
Contributor

Resolves unavoidable missing_docs warning/error on proc-macro crates.
Resolves #42008.

Changes not yet tested locally, however I wanted to submit first since rustc takes forever to compile.

@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 May 5, 2019
@alexcrichton
Copy link
Member

Thanks! I think that one of the arguments to item_mod is the list of attributes, so perhaps this could be included in there? Additionally could a test be added for this?

@iliekturtles
Copy link
Contributor Author

I see where the code changes can be made (also noticed mk_decls has a comment that should be updated). Where do tests for this method live?

@alexcrichton
Copy link
Member

Tests typically live in src/test, and there's a number of locations a test could be added but my guess is that src/test/ui may be the most appropriate for this test.

@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:32136ab9:start=1557190013426422078,finish=1557190014194054855,duration=767632777
$ 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
---
[01:12:58] .................................................................................................... 4000/5496
[01:13:00] ......................................................i............................................. 4100/5496
[01:13:03] .................................................................................................... 4200/5496
[01:13:11] .................................................................................................... 4300/5496
[01:13:18] ........F........................................................................................... 4400/5496
[01:13:25] .................................................................................................... 4600/5496
[01:13:30] .................................................................................................... 4700/5496
[01:13:36] .................................................................................................... 4800/5496
[01:13:39] .................................................................................................... 4900/5496
---
[01:14:00] ---- [ui] ui/proc-macro/no-missing-docs.rs stdout ----
[01:14:00] 
[01:14:00] error: ui test compiled successfully!
[01:14:00] status: exit code: 0
[01:14:00] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/proc-macro/no-missing-docs.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/proc-macro/no-missing-docs/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/proc-macro/no-missing-docs/auxiliary" "-A" "unused"
[01:14:00] ------------------------------------------
[01:14:00] 
[01:14:00] ------------------------------------------
[01:14:00] stderr:
---
[01:14:00] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:519:22
[01:14:00] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[01:14:00] 
[01:14:00] 
[01:14:00] 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" "--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-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:14:00] 
[01:14:00] 
[01:14:00] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:14:00] Build completed unsuccessfully in 0:04:31
[01:14:00] Build completed unsuccessfully in 0:04:31
[01:14:00] make: *** [check] Error 1
[01:14:00] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:157fafb4
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Tue May  7 02:01:06 UTC 2019
---
travis_time:end:004554aa:start=1557194467539389480,finish=1557194467548611035,duration=9221555
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:03f8e2fe
$ 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:088f680f
travis_time:start:088f680f
$ 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:1394c9ca
$ 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

I think you may need to also tag the test with // compile-pass to avoid trying to execute it?

@iliekturtles
Copy link
Contributor Author

Ahhh thanks! I only had time to write the test but not run it locally last time. Will make that adjustment in the next few days and push the changes when I believe we're ready for a final review.

Stops unavoidable `missing_docs` warning/error on proc-macro crates.
Resolves rust-lang#42008.
@iliekturtles
Copy link
Contributor Author

@alexcrichton, I believe everything is set for your review. Tests are passing locally.

@alexcrichton
Copy link
Member

@bors: r+
Thanks!

@bors
Copy link
Contributor

bors commented May 13, 2019

📌 Commit 5ccf2fb has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented May 13, 2019

🌲 The tree is currently closed for pull requests below priority 500, this pull request will be tested once the tree is reopened

@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 13, 2019
Centril added a commit to Centril/rust that referenced this pull request May 13, 2019
…s, r=alexcrichton

Add #[doc(hidden)] attribute on compiler generated module.

Resolves unavoidable `missing_docs` warning/error on proc-macro crates.
Resolves rust-lang#42008.

Changes not yet tested locally, however I wanted to submit first since `rustc` takes forever to compile.
bors added a commit that referenced this pull request May 14, 2019
Rollup of 5 pull requests

Successful merges:

 - #60176 (Explain error when yielding a reference to a local variable)
 - #60201 (coretest: Downgrade deny to warn)
 - #60562 (Add #[doc(hidden)] attribute on compiler generated module.)
 - #60710 (Use `delay_span_bug` for error cases when checking `AnonConst` parent)
 - #60770 (add impl_trait_in_bindings to INCOMPLETE_FEATURES)

Failed merges:

r? @ghost
@bors bors merged commit 5ccf2fb into rust-lang:master May 14, 2019
@iliekturtles iliekturtles deleted the proc-macro-missing-docs branch May 28, 2019 23:41
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.

Incorrect missing docs lint for proc-macro-lib crates
4 participants