use format-args-capture and remove unnecessary nested if blocks in some parts of rustc_passes

break before the `&&`

Update compiler/rustc_passes/src/check_const.rs

Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
This commit is contained in:
Takayuki Maeda
2022-03-18 22:48:21 +09:00
parent d6f3a4ecb4
commit 726206696e
5 changed files with 61 additions and 78 deletions

View File

@@ -80,8 +80,7 @@ impl<'tcx> hir::itemlikevisit::ItemLikeVisitor<'tcx> for CheckConstTraitVisitor<
/// of the trait being implemented; as those provided functions can be non-const.
fn visit_item<'hir>(&mut self, item: &'hir hir::Item<'hir>) {
let _: Option<_> = try {
if let hir::ItemKind::Impl(ref imp) = item.kind {
if let hir::Constness::Const = imp.constness {
if let hir::ItemKind::Impl(ref imp) = item.kind && let hir::Constness::Const = imp.constness {
let trait_def_id = imp.of_trait.as_ref()?.trait_def_id()?;
let ancestors = self
.tcx
@@ -132,7 +131,6 @@ impl<'tcx> hir::itemlikevisit::ItemLikeVisitor<'tcx> for CheckConstTraitVisitor<
.note(&format!("`{}` not implemented", to_implement.join("`, `")))
.emit();
}
}
}
};
}