mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
Merge pull request #1619 from Techcable/fix/mir_passes
Fix compilation on latest nightly
This commit is contained in:
commit
d77dc1f281
3 changed files with 15 additions and 2 deletions
|
@ -58,6 +58,10 @@ impl EarlyLintPass for ItemsAfterStatements {
|
|||
if in_macro(cx, it.span) {
|
||||
return;
|
||||
}
|
||||
if let ItemKind::MacroDef(..) = it.node {
|
||||
// do not lint `macro_rules`, but continue processing further statements
|
||||
continue;
|
||||
}
|
||||
span_lint(cx,
|
||||
ITEMS_AFTER_STATEMENTS,
|
||||
it.span,
|
||||
|
|
|
@ -89,7 +89,6 @@ impl<'a> CompilerCalls<'a> for ClippyCompilerCalls {
|
|||
lint_groups,
|
||||
llvm_passes,
|
||||
attributes,
|
||||
mir_passes,
|
||||
.. } = registry;
|
||||
let sess = &state.session;
|
||||
let mut ls = sess.lint_store.borrow_mut();
|
||||
|
@ -105,7 +104,6 @@ impl<'a> CompilerCalls<'a> for ClippyCompilerCalls {
|
|||
}
|
||||
|
||||
sess.plugin_llvm_passes.borrow_mut().extend(llvm_passes);
|
||||
sess.mir_passes.borrow_mut().extend(mir_passes);
|
||||
sess.plugin_attributes.borrow_mut().extend(attributes);
|
||||
}
|
||||
old(state);
|
||||
|
|
|
@ -17,3 +17,14 @@ fn main() {
|
|||
fn foo() { println!("foo"); }
|
||||
foo();
|
||||
}
|
||||
|
||||
fn mac() {
|
||||
let mut a = 5;
|
||||
println!("{}", a);
|
||||
// do not lint this, because it needs to be after `a`
|
||||
macro_rules! b {
|
||||
() => {{ a = 6 }}
|
||||
}
|
||||
b!();
|
||||
println!("{}", a);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue