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: make #[doc(include)] relative to the containing file #60938

Merged
merged 7 commits into from
Jul 26, 2019
Merged

rustdoc: make #[doc(include)] relative to the containing file #60938

merged 7 commits into from
Jul 26, 2019

Conversation

jonas-schievink
Copy link
Contributor

This matches the behavior of other in-source paths like #[path] and the include_X! macros.

Fixes #58373 (comment)
Also addresses #44732 (comment)

cc #44732

This is still missing a stdsimd change (https://github.com/jonas-schievink/stdsimd/commit/42ed30e0b5fb5e2d11765b5d1e1f36234af85984), so CI will currently fail. I'll land that change once I get initial feedback for this PR.

@jonas-schievink jonas-schievink added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label May 18, 2019
@rust-highfive
Copy link
Collaborator

r? @michaelwoerister

(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 18, 2019
@jonas-schievink
Copy link
Contributor Author

r? @GuillaumeGomez or @QuietMisdreavus

@rust-highfive

This comment has been minimized.

@GuillaumeGomez
Copy link
Member

Changes look good to me. However two things: first, since it's changing libsyntax, we'll need someone from the @rust-lang/compiler team to take a look. Second, I recall us having a document explaining rustdoc features. Please update/add this behaviour into it.

@rust-highfive

This comment has been minimized.

@Dylan-DPC-zz Dylan-DPC-zz added S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 3, 2019
@Dylan-DPC-zz
Copy link

ping from triage, waiting from feedback from @rust-lang/compiler

@cramertj
Copy link
Member

cramertj commented Jun 3, 2019

This matches the behavior of other in-source paths like #[path] and the include_X! macros.

FWIW, #[path] is not relative to the including file-- the relationship is much more complicated than that unfortunately :(. See #55560 for more info.

@jonas-schievink
Copy link
Contributor Author

Oh, that's unfortunate. Perhaps something that could be fixed in the next edition.

Correct me if I'm wrong, but it would still hold for the usual use case of #[path] to include another file from inside a non-inline module, right?

@cramertj
Copy link
Member

cramertj commented Jun 3, 2019

Correct me if I'm wrong, but it would still hold for the usual use case of #[path] to include another file from inside a non-inline module, right?

If you're inside a file named mod.rs/lib.rs/main.rs, yes, but otherwise no.

@QuietMisdreavus QuietMisdreavus added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 10, 2019
@QuietMisdreavus
Copy link
Member

+1 for changing the implementation of doc(include). It's confused enough people that we should just defer to the behavior of include!() and friends. (The behavior of #[path] is odd, but i would consider that secondary to the intent of this PR. I haven't seen #[path] brought up in path-root confusion, just include_str!() - after all, #[doc(include="filename")] was supposed to be sugar for #[doc=include_str!("filename")].) I know i've been an obstacle to changing this behavior in the past, but after seeing it break stdsimd, i'd rather save the headache for everyone else.

@petrochenkov petrochenkov self-assigned this Jun 17, 2019
@petrochenkov petrochenkov added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 22, 2019
@petrochenkov
Copy link
Contributor

The change looks entirely reasonable to me and using a common function is a good way to ensure the behavior won't diverge.
So, r=me with the nits addressed if rustdoc team is happy with the change.

@petrochenkov petrochenkov removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 22, 2019
@jonas-schievink jonas-schievink 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-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). labels Jun 22, 2019
@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:236d0ff0:start=1561233267195445824,finish=1561233269315700261,duration=2120254437
$ 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
---
[00:26:22]    Compiling cc v1.0.35
[00:26:22]    Compiling core v0.0.0 (/checkout/src/libcore)
[00:26:22]    Compiling libc v0.2.54
[00:26:22]    Compiling unwind v0.0.0 (/checkout/src/libunwind)
[00:26:22] error: couldn't read src/libcore/../stdsimd/crates/core_arch/src/../stdsimd/crates/core_arch/src/core_arch_docs.md: No such file or directory (os error 2)
[00:26:22]    |
[00:26:22]    |
[00:26:22] 13 |     doc(include = "../stdsimd/crates/core_arch/src/core_arch_docs.md")
[00:26:22]    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ couldn't read file
[00:26:22]    Compiling build_helper v0.1.0 (/checkout/src/build_helper)
[00:26:23]    Compiling autocfg v0.1.4
[00:26:25]    Compiling backtrace v0.3.29
[00:26:28]    Compiling compiler_builtins v0.1.16
---
travis_time:end:013a209c:start=1561234884298851755,finish=1561234884303616034,duration=4764279
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:090dde4a
$ 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:1391eac5
travis_time:start:1391eac5
$ 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:06dbc17e
$ 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)

@jonas-schievink
Copy link
Contributor Author

Okay, if @rust-lang/rustdoc is happy with this now, this only needs rust-lang/stdarch#769 to land and a submodule update. There seems to be some trouble with updating stdsimd though (#61540), so marking as blocked.

@jonas-schievink
Copy link
Contributor Author

Failure is due to #62811, so this should be able to land regardless.

@bors r=petrochenkov

@bors
Copy link
Contributor

bors commented Jul 23, 2019

📌 Commit 218ab4c has been approved by petrochenkov

@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 Jul 23, 2019
Centril added a commit to Centril/rust that referenced this pull request Jul 24, 2019
…r=petrochenkov

rustdoc: make #[doc(include)] relative to the containing file

This matches the behavior of other in-source paths like `#[path]` and the `include_X!` macros.

Fixes rust-lang#58373 (comment)
Also addresses rust-lang#44732 (comment)

cc rust-lang#44732

This is still missing a stdsimd change (https://github.com/jonas-schievink/stdsimd/commit/42ed30e0b5fb5e2d11765b5d1e1f36234af85984), so CI will currently fail. I'll land that change once I get initial feedback for this PR.
Centril added a commit to Centril/rust that referenced this pull request Jul 24, 2019
Rollup of 10 pull requests

Successful merges:

 - rust-lang#60938 (rustdoc: make #[doc(include)] relative to the containing file)
 - rust-lang#61890 (Fix some sanity checks)
 - rust-lang#62261 (Take substs into account in `conservative_is_privately_uninhabited`)
 - rust-lang#62528 (Add joining slices of slices with a slice separator, not just a single item)
 - rust-lang#62735 (Turn `#[global_allocator]` into a regular attribute macro)
 - rust-lang#62801 (Remove support for -Zlower-128bit-ops)
 - rust-lang#62808 (Revert "Disable stack probing for gnux32.")
 - rust-lang#62819 (Display name of crate requiring rustc_private in error messages.)
 - rust-lang#62904 (Disable d32 on armv6 hf targets)
 - rust-lang#62907 (Initialize the MSP430 AsmParser)

Failed merges:

r? @ghost
Centril added a commit to Centril/rust that referenced this pull request Jul 24, 2019
…r=petrochenkov

rustdoc: make #[doc(include)] relative to the containing file

This matches the behavior of other in-source paths like `#[path]` and the `include_X!` macros.

Fixes rust-lang#58373 (comment)
Also addresses rust-lang#44732 (comment)

cc rust-lang#44732

This is still missing a stdsimd change (https://github.com/jonas-schievink/stdsimd/commit/42ed30e0b5fb5e2d11765b5d1e1f36234af85984), so CI will currently fail. I'll land that change once I get initial feedback for this PR.
Centril added a commit to Centril/rust that referenced this pull request Jul 24, 2019
Rollup of 13 pull requests

Successful merges:

 - rust-lang#60938 (rustdoc: make #[doc(include)] relative to the containing file)
 - rust-lang#61890 (Fix some sanity checks)
 - rust-lang#62084 (allow clippy::unreadable_literal in unicode tables)
 - rust-lang#62261 (Take substs into account in `conservative_is_privately_uninhabited`)
 - rust-lang#62528 (Add joining slices of slices with a slice separator, not just a single item)
 - rust-lang#62735 (Turn `#[global_allocator]` into a regular attribute macro)
 - rust-lang#62801 (Remove support for -Zlower-128bit-ops)
 - rust-lang#62808 (Revert "Disable stack probing for gnux32.")
 - rust-lang#62822 (Improve some pointer-related documentation)
 - rust-lang#62904 (Disable d32 on armv6 hf targets)
 - rust-lang#62907 (Initialize the MSP430 AsmParser)
 - rust-lang#62921 (Add method disambiguation help for trait implementation)
 - rust-lang#62942 (Use match ergonomics in Condvar documentation)

Failed merges:

r? @ghost
Centril added a commit to Centril/rust that referenced this pull request Jul 25, 2019
…r=petrochenkov

rustdoc: make #[doc(include)] relative to the containing file

This matches the behavior of other in-source paths like `#[path]` and the `include_X!` macros.

Fixes rust-lang#58373 (comment)
Also addresses rust-lang#44732 (comment)

cc rust-lang#44732

This is still missing a stdsimd change (https://github.com/jonas-schievink/stdsimd/commit/42ed30e0b5fb5e2d11765b5d1e1f36234af85984), so CI will currently fail. I'll land that change once I get initial feedback for this PR.
Centril added a commit to Centril/rust that referenced this pull request Jul 25, 2019
…r=petrochenkov

rustdoc: make #[doc(include)] relative to the containing file

This matches the behavior of other in-source paths like `#[path]` and the `include_X!` macros.

Fixes rust-lang#58373 (comment)
Also addresses rust-lang#44732 (comment)

cc rust-lang#44732

This is still missing a stdsimd change (https://github.com/jonas-schievink/stdsimd/commit/42ed30e0b5fb5e2d11765b5d1e1f36234af85984), so CI will currently fail. I'll land that change once I get initial feedback for this PR.
bors added a commit that referenced this pull request Jul 25, 2019
Rollup of 15 pull requests

Successful merges:

 - #60066 (Stabilize the type_name intrinsic in core::any)
 - #60938 (rustdoc: make #[doc(include)] relative to the containing file)
 - #61884 (Stablize Euclidean Modulo (feature euclidean_division))
 - #61890 (Fix some sanity checks)
 - #62528 (Add joining slices of slices with a slice separator, not just a single item)
 - #62707 (Add tests for overlapping explicitly dropped locals in generators)
 - #62735 (Turn `#[global_allocator]` into a regular attribute macro)
 - #62822 (Improve some pointer-related documentation)
 - #62887 (Make the parser TokenStream more resilient after mismatched delimiter recovery)
 - #62921 (Add method disambiguation help for trait implementation)
 - #62930 (Add test for #51559)
 - #62942 (Use match ergonomics in Condvar documentation)
 - #62977 (Fix inconsistent highlight blocks.)
 - #62978 (Remove `cfg(bootstrap)` code for array implementations)
 - #62981 (Add note suggesting to borrow a String argument to find)

Failed merges:

 - #62964 (clarify and unify some type test names)

r? @ghost
@bors bors merged commit 218ab4c into rust-lang:master Jul 26, 2019
hdevalence added a commit to dalek-cryptography/curve25519-dalek that referenced this pull request Jul 31, 2019
Since rust-lang/rust#60938 the path root changed and
these new paths are required to compile on nightly.
hdevalence added a commit to dalek-cryptography/curve25519-dalek that referenced this pull request Jul 31, 2019
Since rust-lang/rust#60938 the path root changed and
these new paths are required to compile on nightly.

Closes #268.
plotskogwq added a commit to plotskogwq/curve25519-dalek that referenced this pull request Aug 10, 2024
Since rust-lang/rust#60938 the path root changed and
these new paths are required to compile on nightly.

Closes #268.
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. 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.

10 participants