Repository navigation
Conversation
|
@rfcbot merge rustdoc-internals |
|
@Urgau has proposed to merge this. The next step is review by the rest of the tagged team members: Concerns:
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
|
Not a stabilization blocker, but could you clarify what artifacts the I am thinking from build tool integration angle (apparently cargo) |
As you discovered we had weird bug with the As for your more fundamental question, the |
|
@rfcbot concern inclusion-of-rustc-specific-scopes What's the motivation for allowing the rustc-specific scopes The reasoning can't be "it makes it easier for build systems to blindly forward these options to both rustc & rustdoc" because by that logic rustc should also include @rfcbot reviewed |
We do the use rust/src/librustdoc/calculate_doc_coverage.rs Line 190 in 0617e57 As for As for the /// ```rust
/// panic!();
/// ```
pub fn foo() {}$ RUST_BACKTRACE=1 rustdoc +nightly --test /tmp/foo/a.rs --extern a=liba.rlib --remap-path-prefix=/tmp=/remapped --remap-path-scope=debuginfo -Zunstable-options -Cdebuginfo=1
That's what I proposing in #163896, that |
Stabilization report of
--remap-path-scopein rustdoc and thedocumentationscopeSummary
rustcsupports remapping source paths prefixes as a best effort in all compiler generated output, including compiler diagnostics, debugging information, macro expansions, documentation, doctests, etc.This is useful for normalizing build products, for example, by removing the current directory out of the paths emitted into object files.
This stabilization stabilize the same flag used by
rustcto control which generted output has remapped paths inrustdoc.Cargo is starting to use the
rustcflag with rust-lang/cargo#17488.Tracking issue: #155451.
It's the last major part of the trim-paths feature.
What is stabilized
The rustdoc
--remap-path-scopeflag is being stabilized by this PR. It's equivalent to the rustc flag.It permits defines which scopes should be remapped by
-–remap-path-prefix:macro,diagnostics,documentation,debuginfo,coverage,object,all.Example
rustdoc src/lib.rs --remap-path-prefix="$PWD=/foo" --remap-path-prefix=documentationThe
documentationIn addition to the other scopes (
diagnostics,debuginfo, ...).rustdocuses thedocumentationscope, it's a new scope to be shared withrustc(T-compiler FCP here).Implementation
Major parts
--remap-path-scopeas unstable in rustdoc #155357documentationremapping path scope for rustdoc usage #151589rustcinvocation for doctests #163956Coverage
tests/rustdoc-ui/remap-path-prefix.rstests/rustdoc-ui/remap-path-prefix-doctest.rstests/ui/errors/remap-path-prefix-macro.rstests/ui/errors/remap-path-prefix-diagnostics.rsOutstanding bugs
There are no outstanding bugs regarding
--remap-path-scopeinrustdoc.There are caveats and limitation in
rustc, but they mostly concern generated object files, which we don't really have.Outstanding FIXMEs
There are no FIXME regarding
--remap-path-scope(in rustc or rustdoc).cc @ojeda (for Rust-for-Linux)
cc @weihanglo
r? rustdoc