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 inline macro reexport #56315

Merged
merged 5 commits into from Dec 6, 2018

Conversation

Projects
None yet
5 participants
@weiznich
Copy link
Contributor

weiznich commented Nov 28, 2018

Fixes #56173

I assume this needs to have tests? Any pointers where these need to be added?

weiznich added some commits Nov 28, 2018

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Nov 28, 2018

r? @QuietMisdreavus

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

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Nov 28, 2018

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:110ad200:start=1543421713920084157,finish=1543421769557320876,duration=55637236719
$ 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:47:01] .................................................................................................... 100/5065
[00:47:04] .................................................................................................... 200/5065
[00:47:06] .............................ii............................................ii...................ii.. 300/5065
[00:47:09] ..............................................................................................iii... 400/5065
[00:47:11] .....iiiiiiii.iii............................iii...........................................i........ 500/5065
[00:47:18] .................................................................................................... 700/5065
[00:47:23] ................................................................................................i... 800/5065
[00:47:27] ........i........................................................................................... 900/5065
[00:47:30] ...............iiiii..................ii.iiii....................................................... 1000/5065
---
[00:48:08] .................................................................................................... 2300/5065
[00:48:12] .................................................................................................... 2400/5065
[00:48:16] .................................................................................................... 2500/5065
[00:48:19] .................................................................................................... 2600/5065
[00:48:23] ........iiiiiiiii................................................................................... 2700/5065
[00:48:28] .................................................................................................... 2900/5065
[00:48:32] .................................................................................................... 3000/5065
[00:48:35] .......................................................................i............................ 3100/5065
[00:48:38] .................................................................................................... 3200/5065
---
travis_time:start:test_codegen
Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:01:35] 
[01:01:35] running 117 tests
[01:01:38] i..ii...iii..iiii.....i...i.........i..iii...........i.....i.....ii...i..i.ii..............i...ii..i 100/117
[01:01:39] i.i.....iiii.....
[01:01:39] 
[01:01:39]  finished in 3.279
[01:01:39] travis_fold:end:test_codegen

---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:01:52] 
[01:01:52] running 118 tests
[01:02:14] .iiiii...i.....i..i...i..i.i..i.i..i.....i..i....i..........iiii.........i.i....i...i.......ii.i.i.i 100/118
[01:02:18] ......iii.i.....ii
[01:02:18] 
[01:02:18]  finished in 25.927
[01:02:18] 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:08:29] 
[01:08:29] running 276 tests
[01:09:34] .......................i............................................................F............... 100/276
[01:11:03] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:503:22
[01:11:03] ............................................................................
[01:11:03] failures:
[01:11:03] 
[01:11:03] 
[01:11:03] ---- [rustdoc] rustdoc/inline_cross/proc_macro.rs stdout ----
[01:11:03] 
[01:11:03] error: htmldocck failed!
[01:11:03] status: exit code: 1
[01:11:03] command: "/usr/bin/python2.7" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/inline_cross/proc_macro" "/checkout/src/test/rustdoc/inline_cross/proc_macro.rs"
[01:11:03] ------------------------------------------
[01:11:03] 
[01:11:03] ------------------------------------------
[01:11:03] stderr:
[01:11:03] stderr:
[01:11:03] ------------------------------------------
[01:11:03] 21: @has check failed
[01:11:03]  `XPATH PATTERN` did not match
[01:11:03]  // @has - '//a/@href' '../some_macros/macro.some_proc_macro.html'
[01:11:03] 23: @has check failed
[01:11:03]  `XPATH PATTERN` did not match
[01:11:03]  // @has - '//a/@href' '../some_macros/derive.SomeDerive.html'
[01:11:03] 24: @!has check failed
[01:11:03]  // @!has proc_macro/macro.some_proc_macro.html
[01:11:03] 26: @!has check failed
[01:11:03]  // @!has proc_macro/derive.SomeDerive.html
[01:11:03] Encountered 4 errors
[01:11:03] 
[01:11:03] ------------------------------------------
[01:11:03] 
---
[01:11:03] test result: FAILED. 273 passed; 1 failed; 2 ignored; 0 measured; 0 filtered out
[01:11:03] 
[01:11:03] 
[01:11:03] 
[01:11:03] 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-5.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--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"
[01:11:03] 
[01:11:03] 
[01:11:03] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:11:03] Build completed unsuccessfully in 0:27:46
[01:11:03] Build completed unsuccessfully in 0:27:46
[01:11:03] Makefile:58: recipe for target 'check' failed
[01:11:03] make: *** [check] Error 1
55788 ./obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu
55784 ./obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release
53888 ./.git/modules/src/tools
52160 ./src/llvm/test/CodeGen/X86
---
36560 ./.git/modules/src/libcompiler_builtins/modules
36044 ./.git/modules/src/libcompiler_builtins/modules/compiler-rt
35640 ./src/tools/clang/lib
35580 ./.git/modules/src/libcompiler_builtins/modules/compiler-rt/objects
35572 ./.travis_time:start:0c1d051c
$ 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:0dfbcfc9
travis_time:start:0dfbcfc9
$ 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:012bba58
$ 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)

@ollie27
Copy link
Contributor

ollie27 left a comment

From #54577 it looks like we're intentionally not reexporting proc macros across crates so I don't know if the proc macro change should be done yet.

Tests go in src/test/rustdoc.

Show resolved Hide resolved src/librustdoc/visit_ast.rs Outdated
@QuietMisdreavus

This comment has been minimized.

Copy link
Member

QuietMisdreavus commented Dec 3, 2018

Copying in the relevant paragraph from the PR @ollie27 linked:

There's one wrinkle which this PR doesn't address, which is why i didn't mark this as fixing the linked issue. Currently, proc-macros don't expose their attributes or source span across crates, so while rustdoc knows they exist, that's about all the information it gets. This leads to an "inlined" macro that has absolutely no docs on it, and no [src] link to show you where it was declared.

So, i can't accept the parts that enable proc-macro re-export, since (as far as i know) this information still doesn't exist. If that's no longer the case, though, then i'd be happy to take it!

There's a brief intro to rustdoc's tests in the rustc guide, otherwise you can take a look at the src/test/rustdoc/inline_cross/proc_macro.rs test to get an idea of what it's currently looking for. (This is the test that failed in travis, too.)

weiznich added some commits Dec 4, 2018

@weiznich

This comment has been minimized.

Copy link
Contributor

weiznich commented Dec 4, 2018

So, i can't accept the parts that enable proc-macro re-export, since (as far as i know) this information still doesn't exist. If that's no longer the case, though, then i'd be happy to take it!

I've missed that part. It's now removed. Do you know what needs to be done to get this working?

@QuietMisdreavus

This comment has been minimized.

Copy link
Member

QuietMisdreavus commented Dec 4, 2018

It would involve changing proc-macros in general to be able to save more information between crates than what we currently send. I'm not too familiar with their implementation; maybe someone from @rust-lang/compiler can provide more input?

@QuietMisdreavus
Copy link
Member

QuietMisdreavus left a comment

The rest of this PR looks good, thanks for adding the test!

@QuietMisdreavus

This comment has been minimized.

Copy link
Member

QuietMisdreavus commented Dec 4, 2018

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 4, 2018

📌 Commit 956b03f has been approved by QuietMisdreavus

pietroalbini added a commit to pietroalbini/rust that referenced this pull request Dec 6, 2018

Rollup merge of rust-lang#56315 - weiznich:rustdoc_inline_macro_reexp…
…ort, r=QuietMisdreavus

Rustdoc inline macro reexport

Fixes rust-lang#56173

I assume this needs to have tests? Any pointers where these need to be added?

bors added a commit that referenced this pull request Dec 6, 2018

Auto merge of #56557 - pietroalbini:rollup, r=pietroalbini
Rollup of 11 pull requests

Successful merges:

 - #56315 (Rustdoc inline macro reexport)
 - #56332 ([rustdoc] Specific crate search)
 - #56362 (Stabilise exhaustive integer patterns)
 - #56426 (libsyntax_pos: A few tweaks)
 - #56441 (rustbuild: Fix issues with compiler docs)
 - #56446 (pass the parameter environment to `traits::find_associated_item`)
 - #56500 (cleanup: remove static lifetimes from consts)
 - #56525 (Avoid extra copy and syscall in std::env::current_exe)
 - #56528 (Remove unused dependency (rustc_lint -> rustc_mir))
 - #56548 (Optimized string FromIterator + Extend impls)
 - #56553 (Don't print the profiling summary to stdout when -Zprofile-json is set)

Failed merges:

r? @ghost

bors added a commit that referenced this pull request Dec 6, 2018

Auto merge of #56557 - pietroalbini:rollup, r=pietroalbini
Rollup of 11 pull requests

Successful merges:

 - #56315 (Rustdoc inline macro reexport)
 - #56332 ([rustdoc] Specific crate search)
 - #56362 (Stabilise exhaustive integer patterns)
 - #56426 (libsyntax_pos: A few tweaks)
 - #56441 (rustbuild: Fix issues with compiler docs)
 - #56446 (pass the parameter environment to `traits::find_associated_item`)
 - #56500 (cleanup: remove static lifetimes from consts)
 - #56525 (Avoid extra copy and syscall in std::env::current_exe)
 - #56528 (Remove unused dependency (rustc_lint -> rustc_mir))
 - #56548 (Optimized string FromIterator + Extend impls)
 - #56553 (Don't print the profiling summary to stdout when -Zprofile-json is set)

Failed merges:

r? @ghost
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 6, 2018

⌛️ Testing commit 956b03f with merge 367e783...

@bors bors merged commit 956b03f into rust-lang:master Dec 6, 2018

1 of 2 checks passed

homu Testing commit 956b03f7db8b6b6b73bb4b2b6e0cbb1016e08f8a with merge 367e783e6f66a4dba32decdc68a262953d2f3f1b...
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment