#![feature(control_flow_enum)]
#![feature(box_syntax)]
#![feature(in_band_lifetimes)]
+#![feature(let_else)]
#![feature(nll)]
#![feature(test)]
#![feature(crate_visibility_modifier)]
extern crate rustc_lexer;
extern crate rustc_lint;
extern crate rustc_lint_defs;
+extern crate rustc_macros;
extern crate rustc_metadata;
extern crate rustc_middle;
extern crate rustc_parse;
extern crate rustc_passes;
extern crate rustc_resolve;
+extern crate rustc_serialize;
extern crate rustc_session;
extern crate rustc_span;
extern crate rustc_target;
}}
}
-#[macro_use]
-mod externalfiles;
-
mod clean;
mod config;
mod core;
mod docfs;
-mod doctree;
-#[macro_use]
-mod error;
mod doctest;
+mod error;
+mod externalfiles;
mod fold;
mod formats;
// used by the error-index generator, so it needs to be public
crate mod lint;
mod markdown;
mod passes;
+mod scrape_examples;
mod theme;
+mod visit;
mod visit_ast;
mod visit_lib;
"Make the identifiers in the HTML source code pages navigable",
)
}),
+ unstable("scrape-examples-output-path", |o| {
+ o.optopt(
+ "",
+ "scrape-examples-output-path",
+ "",
+ "collect function call information and output at the given path",
+ )
+ }),
+ unstable("scrape-examples-target-crate", |o| {
+ o.optmulti(
+ "",
+ "scrape-examples-target-crate",
+ "",
+ "collect function call information for functions from the target crate",
+ )
+ }),
+ unstable("with-examples", |o| {
+ o.optmulti(
+ "",
+ "with-examples",
+ "",
+ "path to function call information (for displaying examples in the documentation)",
+ )
+ }),
]
}
let default_passes = options.default_passes;
let output_format = options.output_format;
// FIXME: fix this clone (especially render_options)
+ let externs = options.externs.clone();
let manual_passes = options.manual_passes.clone();
let render_options = options.render_options.clone();
+ let scrape_examples_options = options.scrape_examples_options.clone();
let config = core::create_config(options);
interface::create_compiler_and_run(config, |compiler| {
// We need to hold on to the complete resolver, so we cause everything to be
// cloned for the analysis passes to use. Suboptimal, but necessary in the
// current architecture.
- let resolver = core::create_resolver(queries, &sess);
+ let resolver = core::create_resolver(externs, queries, sess);
- if sess.has_errors() {
+ if sess.diagnostic().has_errors_or_lint_errors() {
sess.fatal("Compilation failed, aborting rustdoc");
}
});
info!("finished with rustc");
+ if let Some(options) = scrape_examples_options {
+ return scrape_examples::run(krate, render_opts, cache, tcx, options);
+ }
+
cache.crate_version = crate_version;
if show_coverage {