Rollup merge of #139184 - Urgau:crate-root-lint-levels, r=jieyouxu
Add unstable `--print=crate-root-lint-levels` This PR implements `--print=crate-root-lint-levels` from MCP 833 https://github.com/rust-lang/compiler-team/issues/833. Tracking issue: https://github.com/rust-lang/rust/issues/139180 Best reviewed commit by commit.
This commit is contained in:
commit
eb23a597c8
15 changed files with 213 additions and 9 deletions
|
@ -450,6 +450,19 @@ impl<'s> LintLevelsBuilder<'s, TopDown> {
|
|||
builder
|
||||
}
|
||||
|
||||
pub fn crate_root(
|
||||
sess: &'s Session,
|
||||
features: &'s Features,
|
||||
lint_added_lints: bool,
|
||||
store: &'s LintStore,
|
||||
registered_tools: &'s RegisteredTools,
|
||||
crate_attrs: &[ast::Attribute],
|
||||
) -> Self {
|
||||
let mut builder = Self::new(sess, features, lint_added_lints, store, registered_tools);
|
||||
builder.add(crate_attrs, true, None);
|
||||
builder
|
||||
}
|
||||
|
||||
fn process_command_line(&mut self) {
|
||||
self.provider.cur = self
|
||||
.provider
|
||||
|
|
|
@ -130,6 +130,7 @@ pub use context::{
|
|||
};
|
||||
pub use early::{EarlyCheckNode, check_ast_node};
|
||||
pub use late::{check_crate, late_lint_mod, unerased_lint_store};
|
||||
pub use levels::LintLevelsBuilder;
|
||||
pub use passes::{EarlyLintPass, LateLintPass};
|
||||
pub use rustc_session::lint::Level::{self, *};
|
||||
pub use rustc_session::lint::{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue