1
Fork 0

Bump rustfmt version

Also switches on formatting of the mir build module
This commit is contained in:
Mark Rousskov 2021-01-09 12:00:45 -05:00
parent f6cb45ad01
commit d5b760ba62
30 changed files with 224 additions and 164 deletions

View file

@ -1659,12 +1659,15 @@ impl<'tcx> LifetimeContext<'_, 'tcx> {
match missing {
MissingLifetimeSpot::Generics(generics) => {
let (span, sugg) = if let Some(param) = generics.params.iter().find(|p| {
!matches!(p.kind, hir::GenericParamKind::Type {
synthetic: Some(hir::SyntheticTyParamKind::ImplTrait),
..
} | hir::GenericParamKind::Lifetime {
kind: hir::LifetimeParamKind::Elided,
})
!matches!(
p.kind,
hir::GenericParamKind::Type {
synthetic: Some(hir::SyntheticTyParamKind::ImplTrait),
..
} | hir::GenericParamKind::Lifetime {
kind: hir::LifetimeParamKind::Elided,
}
)
}) {
(param.span.shrink_to_lo(), format!("{}, ", lifetime_ref))
} else {
@ -1844,10 +1847,13 @@ impl<'tcx> LifetimeContext<'_, 'tcx> {
msg = "consider introducing a named lifetime parameter".to_string();
should_break = true;
if let Some(param) = generics.params.iter().find(|p| {
!matches!(p.kind, hir::GenericParamKind::Type {
synthetic: Some(hir::SyntheticTyParamKind::ImplTrait),
..
})
!matches!(
p.kind,
hir::GenericParamKind::Type {
synthetic: Some(hir::SyntheticTyParamKind::ImplTrait),
..
}
)
}) {
(param.span.shrink_to_lo(), "'a, ".to_string())
} else {