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

rustbuild: Fix compiler docs yet again #42806

Merged
merged 1 commit into from
Jun 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/bootstrap/bin/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ fn main() {
.env(bootstrap::util::dylib_path_var(),
env::join_paths(&dylib_path).unwrap());

// Pass the `rustbuild` feature flag to crates which rustbuild is
// building. See the comment in bootstrap/lib.rs where this env var is
// set for more details.
if env::var_os("RUSTBUILD_UNSTABLE").is_some() {
cmd.arg("--cfg").arg("rustbuild");
// Force all crates compiled by this compiler to (a) be unstable and (b)
// allow the `rustc_private` feature to link to other unstable crates
// also in the sysroot.
if env::var_os("RUSTC_FORCE_UNSTABLE").is_some() {
cmd.arg("-Z").arg("force-unstable-if-unmarked");
}

std::process::exit(match cmd.status() {
Expand Down
7 changes: 6 additions & 1 deletion src/librustdoc/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ pub fn run_core(search_paths: SearchPaths,
input: Input,
triple: Option<String>,
maybe_sysroot: Option<PathBuf>,
allow_warnings: bool) -> (clean::Crate, RenderInfo)
allow_warnings: bool,
force_unstable_if_unmarked: bool) -> (clean::Crate, RenderInfo)
{
// Parse, resolve, and typecheck the given crate.

Expand All @@ -128,6 +129,10 @@ pub fn run_core(search_paths: SearchPaths,
// Ensure that rustdoc works even if rustc is feature-staged
unstable_features: UnstableFeatures::Allow,
actually_rustdoc: true,
debugging_opts: config::DebuggingOptions {
force_unstable_if_unmarked: force_unstable_if_unmarked,
..config::basic_debugging_options()
},
..config::basic_options().clone()
};

Expand Down
6 changes: 5 additions & 1 deletion src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,17 @@ where R: 'static + Send, F: 'static + Send + FnOnce(Output) -> R {
info!("starting to run rustc");
let display_warnings = matches.opt_present("display-warnings");

let force_unstable_if_unmarked = matches.opt_strs("Z").iter().any(|x| {
*x == "force-unstable-if-unmarked"
});

let (tx, rx) = channel();
rustc_driver::monitor(move || {
use rustc::session::config::Input;

let (mut krate, renderinfo) =
core::run_core(paths, cfgs, externs, Input::File(cr), triple, maybe_sysroot,
display_warnings);
display_warnings, force_unstable_if_unmarked);

info!("finished with rustc");

Expand Down