Add listing of lints (eg via -W help) to rustdoc
This commit is contained in:
@@ -74,7 +74,7 @@ use std::default::Default;
|
||||
use std::env;
|
||||
use std::process;
|
||||
|
||||
use rustc_driver::abort_on_err;
|
||||
use rustc_driver::{abort_on_err, describe_lints};
|
||||
use rustc_errors::ErrorReported;
|
||||
use rustc_interface::interface;
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
@@ -705,6 +705,12 @@ fn main_options(options: config::Options) -> MainResult {
|
||||
compiler.enter(|queries| {
|
||||
let sess = compiler.session();
|
||||
|
||||
if sess.opts.describe_lints {
|
||||
let (_, lint_store) = &*queries.register_plugins()?.peek();
|
||||
describe_lints(sess, lint_store, true);
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
// 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.
|
||||
|
||||
Reference in New Issue
Block a user