]> git.proxmox.com Git - cargo.git/commitdiff
Auto merge of #9105 - Swatinem:rustdoc-run-cwd, r=alexcrichton
authorbors <bors@rust-lang.org>
Tue, 23 Feb 2021 16:39:45 +0000 (16:39 +0000)
committerbors <bors@rust-lang.org>
Tue, 23 Feb 2021 16:39:45 +0000 (16:39 +0000)
Run rustdoc doctests relative to the workspace

By doing so, rustdoc will also emit workspace-relative filenames for the doctests.

This was first landed in #8954 but later backed out in #8996 because it changed the CWD of rustdoc test invocations.

The second try relies on the new `--test-run-directory` rustdoc option which was added in https://github.com/rust-lang/rust/pull/81264 to explicitly control the rustdoc test cwd.

fixes #8993

1  2 
src/cargo/core/features.rs

index 3b6c4e9d7d39594102722befd94bf72f78e14da0,3256f687f883be9d2988d17ffa65605b5565d307..9342c12dcc172766023803e519da690667d27061
@@@ -597,9 -597,9 +598,10 @@@ impl CliUnstable 
              "build-std-features" => self.build_std_features = Some(parse_features(v)),
              "timings" => self.timings = Some(parse_timings(v)),
              "doctest-xcompile" => self.doctest_xcompile = parse_empty(k, v)?,
+             "doctest-in-workspace" => self.doctest_in_workspace = parse_empty(k, v)?,
              "panic-abort-tests" => self.panic_abort_tests = parse_empty(k, v)?,
              "jobserver-per-rustc" => self.jobserver_per_rustc = parse_empty(k, v)?,
 +            "configurable-env" => self.configurable_env = parse_empty(k, v)?,
              "features" => {
                  // For now this is still allowed (there are still some
                  // unstable options like "compare"). This should be removed at