rustup (rustc 1.0.0-nightly (00978a987 2015-04-18) (built 2015-04-19))
This commit is contained in:
parent
ab65383f64
commit
2935c31692
|
@ -1,5 +1,5 @@
|
||||||
#![feature(plugin_registrar, box_syntax)]
|
#![feature(plugin_registrar, box_syntax)]
|
||||||
#![feature(rustc_private, core, collections)]
|
#![feature(rustc_private, collections)]
|
||||||
|
|
||||||
#![allow(unused_imports)]
|
#![allow(unused_imports)]
|
||||||
|
|
||||||
|
|
|
@ -37,9 +37,9 @@ impl LintPass for MiscPass {
|
||||||
let map = cx.sess().codemap();
|
let map = cx.sess().codemap();
|
||||||
span_note_and_lint(cx, SINGLE_MATCH, expr.span,
|
span_note_and_lint(cx, SINGLE_MATCH, expr.span,
|
||||||
"You seem to be trying to use match for destructuring a single type. Did you mean to use `if let`?",
|
"You seem to be trying to use match for destructuring a single type. Did you mean to use `if let`?",
|
||||||
format!("Try if let {} = {} {{ ... }}",
|
&*format!("Try if let {} = {} {{ ... }}",
|
||||||
map.span_to_snippet(arms[0].pats[0].span).unwrap_or("..".to_string()),
|
&*map.span_to_snippet(arms[0].pats[0].span).unwrap_or("..".to_string()),
|
||||||
map.span_to_snippet(ex.span).unwrap_or("..".to_string())).as_slice()
|
&*map.span_to_snippet(ex.span).unwrap_or("..".to_string()))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue