mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 09:44:08 +00:00
Auto merge of #4673 - Manishearth:rustup, r=phansch
Rustup to rustc 1.40.0-nightly (237d54ff6
2019-10-15)
changelog: none
This commit is contained in:
commit
52cebb1f8f
@ -255,7 +255,10 @@ fn simplify_not(cx: &LateContext<'_, '_>, expr: &Expr) -> Option<String> {
|
|||||||
.iter()
|
.iter()
|
||||||
.cloned()
|
.cloned()
|
||||||
.flat_map(|(a, b)| vec![(a, b), (b, a)])
|
.flat_map(|(a, b)| vec![(a, b), (b, a)])
|
||||||
.find(|&(a, _)| a == path.ident.name.as_str())
|
.find(|&(a, _)| {
|
||||||
|
let path: &str = &path.ident.name.as_str();
|
||||||
|
a == path
|
||||||
|
})
|
||||||
.and_then(|(_, neg_method)| Some(format!("{}.{}()", snippet_opt(cx, args[0].span)?, neg_method)))
|
.and_then(|(_, neg_method)| Some(format!("{}.{}()", snippet_opt(cx, args[0].span)?, neg_method)))
|
||||||
},
|
},
|
||||||
_ => None,
|
_ => None,
|
||||||
|
@ -462,9 +462,12 @@ fn check_must_use_candidate<'a, 'tcx>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn must_use_attr(attrs: &[Attribute]) -> Option<&Attribute> {
|
fn must_use_attr(attrs: &[Attribute]) -> Option<&Attribute> {
|
||||||
attrs
|
attrs.iter().find(|attr| {
|
||||||
.iter()
|
attr.ident().map_or(false, |ident| {
|
||||||
.find(|attr| attr.ident().map_or(false, |ident| "must_use" == &ident.as_str()))
|
let ident: &str = &ident.as_str();
|
||||||
|
"must_use" == ident
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn returns_unit(decl: &hir::FnDecl) -> bool {
|
fn returns_unit(decl: &hir::FnDecl) -> bool {
|
||||||
|
Loading…
Reference in New Issue
Block a user