Auto merge of #78697 - JohnTitor:rollup-q0fchpv, r=JohnTitor
Rollup of 8 pull requests Successful merges: - #78376 (Treat trailing semicolon as a statement in macro call) - #78400 (Fix unindent in doc comments) - #78575 (Add a test for compiletest rustc-env & unset-rustc-env directives) - #78616 (Document -Zinstrument-coverage) - #78663 (Fix ICE when a future-incompat-report has its command-line level capped) - #78664 (Fix intrinsic size_of stable link) - #78668 (inliner: Remove redundant loop) - #78676 (add mipsel-unknown-none target) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
d662f80855
27 changed files with 584 additions and 191 deletions
|
@ -22,7 +22,9 @@ pub enum LintSource {
|
|||
Node(Symbol, Span, Option<Symbol> /* RFC 2383 reason */),
|
||||
|
||||
/// Lint level was set by a command-line flag.
|
||||
CommandLine(Symbol),
|
||||
/// The provided `Level` is the level specified on the command line -
|
||||
/// the actual level may be lower due to `--cap-lints`
|
||||
CommandLine(Symbol, Level),
|
||||
}
|
||||
|
||||
impl LintSource {
|
||||
|
@ -30,7 +32,7 @@ impl LintSource {
|
|||
match *self {
|
||||
LintSource::Default => symbol::kw::Default,
|
||||
LintSource::Node(name, _, _) => name,
|
||||
LintSource::CommandLine(name) => name,
|
||||
LintSource::CommandLine(name, _) => name,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +40,7 @@ impl LintSource {
|
|||
match *self {
|
||||
LintSource::Default => DUMMY_SP,
|
||||
LintSource::Node(_, span, _) => span,
|
||||
LintSource::CommandLine(_) => DUMMY_SP,
|
||||
LintSource::CommandLine(_, _) => DUMMY_SP,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -279,12 +281,12 @@ pub fn struct_lint_level<'s, 'd>(
|
|||
&format!("`#[{}({})]` on by default", level.as_str(), name),
|
||||
);
|
||||
}
|
||||
LintSource::CommandLine(lint_flag_val) => {
|
||||
let flag = match level {
|
||||
LintSource::CommandLine(lint_flag_val, orig_level) => {
|
||||
let flag = match orig_level {
|
||||
Level::Warn => "-W",
|
||||
Level::Deny => "-D",
|
||||
Level::Forbid => "-F",
|
||||
Level::Allow => panic!(),
|
||||
Level::Allow => "-A",
|
||||
};
|
||||
let hyphen_case_lint_name = name.replace("_", "-");
|
||||
if lint_flag_val.as_str() == name {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue