mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
fix various rustup failures
This commit is contained in:
parent
7c94a62048
commit
6d921b4734
3 changed files with 5 additions and 3 deletions
|
@ -108,7 +108,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LetIfSeq {
|
|||
cond=snippet(cx, cond.span, "_"),
|
||||
then=if then.stmts.len() > 1 { " ..;" } else { "" },
|
||||
else=if default_multi_stmts { " ..;" } else { "" },
|
||||
value=snippet(cx, then.span, "<value>"),
|
||||
value=snippet(cx, value.span, "<value>"),
|
||||
default=snippet(cx, default.span, "<default>"),
|
||||
);
|
||||
span_lint_and_then(cx,
|
||||
|
|
|
@ -357,6 +357,9 @@ pub fn method_chain_args<'a>(expr: &'a Expr, methods: &[&str]) -> Option<Vec<&'a
|
|||
// method chains are stored last -> first
|
||||
if let ExprMethodCall(ref name, _, ref args) = current.node {
|
||||
if name.node == *method_name {
|
||||
if args.iter().any(|e| in_macro(e.span)) {
|
||||
return None;
|
||||
}
|
||||
matched.push(&**args); // build up `matched` backwards
|
||||
current = &args[0] // go to parent expression
|
||||
} else {
|
||||
|
|
|
@ -20,13 +20,12 @@ fn main() {
|
|||
lazy_static! {
|
||||
static ref MUT_MAP : HashMap<usize, &'static str> = {
|
||||
let mut m = HashMap::new();
|
||||
let mut zero = &mut &mut "zero";
|
||||
m.insert(0, "zero");
|
||||
m
|
||||
};
|
||||
static ref MUT_COUNT : usize = MUT_MAP.len();
|
||||
}
|
||||
assert!(*MUT_COUNT == 1);
|
||||
assert_eq!(*MUT_COUNT, 1);
|
||||
// FIXME: don't lint in array length, requires `check_body`
|
||||
//let _ = [""; (42.0 < std::f32::NAN) as usize];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue