mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 23:20:39 +00:00
Move in_macro check
This commit is contained in:
parent
a828692780
commit
9034b87a53
1 changed files with 4 additions and 1 deletions
|
@ -99,6 +99,10 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for RedundantClone {
|
||||||
for (bb, bbdata) in mir.basic_blocks().iter_enumerated() {
|
for (bb, bbdata) in mir.basic_blocks().iter_enumerated() {
|
||||||
let terminator = bbdata.terminator();
|
let terminator = bbdata.terminator();
|
||||||
|
|
||||||
|
if in_macro(terminator.source_info.span) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Give up on loops
|
// Give up on loops
|
||||||
if terminator.successors().any(|s| *s == bb) {
|
if terminator.successors().any(|s| *s == bb) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -174,7 +178,6 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for RedundantClone {
|
||||||
};
|
};
|
||||||
|
|
||||||
if_chain! {
|
if_chain! {
|
||||||
if !in_macro(span);
|
|
||||||
if let Some(snip) = snippet_opt(cx, span);
|
if let Some(snip) = snippet_opt(cx, span);
|
||||||
if let Some(dot) = snip.rfind('.');
|
if let Some(dot) = snip.rfind('.');
|
||||||
then {
|
then {
|
||||||
|
|
Loading…
Reference in a new issue