#![feature(str_split_once)]
#![feature(iter_intersperse)]
#![recursion_limit = "256"]
+#![deny(rustc::internal)]
#[macro_use]
extern crate lazy_static;
use rustc_driver::abort_on_err;
use rustc_errors::ErrorReported;
use rustc_interface::interface;
-use rustc_middle::ty;
+use rustc_middle::ty::TyCtxt;
use rustc_session::config::{make_crate_type_option, ErrorOutputType, RustcOptGroup};
use rustc_session::getopts;
use rustc_session::{early_error, early_warn};
stable("test-args", |o| {
o.optmulti("", "test-args", "arguments to pass to the test runner", "ARGS")
}),
+ unstable("test-run-directory", |o| {
+ o.optopt(
+ "",
+ "test-run-directory",
+ "The working directory in which to run tests",
+ "PATH",
+ )
+ }),
stable("target", |o| o.optopt("", "target", "target triple to document", "TRIPLE")),
stable("markdown-css", |o| {
o.optmulti(
render_info: config::RenderInfo,
diag: &rustc_errors::Handler,
edition: rustc_span::edition::Edition,
- tcx: ty::TyCtxt<'tcx>,
+ tcx: TyCtxt<'tcx>,
) -> MainResult {
match formats::run_format::<T>(krate, renderopts, render_info, &diag, edition, tcx) {
Ok(_) => Ok(()),
sess.fatal("Compilation failed, aborting rustdoc");
}
- let mut global_ctxt = abort_on_err(queries.global_ctxt(), sess).take();
+ let mut global_ctxt = abort_on_err(queries.global_ctxt(), sess).peek_mut();
global_ctxt.enter(|tcx| {
let (mut krate, render_info, render_opts) = sess.time("run_global_ctxt", || {
info!("going to format");
let (error_format, edition, debugging_options) = diag_opts;
let diag = core::new_handler(error_format, None, &debugging_options);
- let main_result = match output_format {
+ match output_format {
None | Some(config::OutputFormat::Html) => sess.time("render_html", || {
run_renderer::<html::render::Context<'_>>(
krate,
tcx,
)
}),
- };
- // NOTE: this is normally called in codegen, but rustdoc never goes to codegen.
- tcx.alloc_self_profile_query_strings();
- main_result
+ }
})
})
})