Add version = "Two" to rustfmt.toml

Ignore UI tests since this change makes rustfmt less friendly with UI
test comments.
This commit is contained in:
Cameron Steffen
2021-03-01 11:53:33 -06:00
parent 5ae1e17e81
commit ada8c72f3f
52 changed files with 232 additions and 510 deletions

View File

@@ -25,11 +25,7 @@ pub fn until(s: &str) -> usize {
return i;
}
}
if up {
last_i
} else {
s.len()
}
if up { last_i } else { s.len() }
}
/// Returns index of the last camel-case component of `s`.

View File

@@ -1563,12 +1563,12 @@ pub fn is_trait_impl_item(cx: &LateContext<'_>, hir_id: HirId) -> bool {
/// ```
pub fn fn_has_unsatisfiable_preds(cx: &LateContext<'_>, did: DefId) -> bool {
use rustc_trait_selection::traits;
let predicates =
cx.tcx
.predicates_of(did)
.predicates
.iter()
.filter_map(|(p, _)| if p.is_global() { Some(*p) } else { None });
let predicates = cx
.tcx
.predicates_of(did)
.predicates
.iter()
.filter_map(|(p, _)| if p.is_global() { Some(*p) } else { None });
traits::impossible_predicates(
cx.tcx,
traits::elaborate_predicates(cx.tcx, predicates)

View File

@@ -36,11 +36,7 @@ fn extract_clone_suggestions<'tcx>(
abort: false,
};
visitor.visit_body(body);
if visitor.abort {
None
} else {
Some(visitor.spans)
}
if visitor.abort { None } else { Some(visitor.spans) }
}
struct PtrCloneVisitor<'a, 'tcx> {