1
Fork 0
rustfmt, pleaaaaase, start supporting rust

Co-authored-by: nils <48135649+Nilstrieb@users.noreply.github.com>
This commit is contained in:
Waffle Maybe 2023-01-09 20:42:36 +04:00 committed by Maybe Waffle
parent 09485eaae1
commit 66751ea73e
3 changed files with 17 additions and 18 deletions

View file

@ -847,7 +847,7 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> {
let local_decls = &mut self.source.local_decls; let local_decls = &mut self.source.local_decls;
let loc = candidate.location; let loc = candidate.location;
let statement = &mut blocks[loc.block].statements[loc.statement_index]; let statement = &mut blocks[loc.block].statements[loc.statement_index];
let StatementKind::Assign(box (_, Rvalue::Ref(region, borrow_kind, place)))= &mut statement.kind else { let StatementKind::Assign(box (_, Rvalue::Ref(region, borrow_kind, place))) = &mut statement.kind else {
bug!() bug!()
}; };

View file

@ -141,8 +141,7 @@ impl IntRange {
) -> Option<IntRange> { ) -> Option<IntRange> {
let ty = value.ty(); let ty = value.ty();
if let Some((target_size, bias)) = Self::integral_size_and_signed_bias(tcx, ty) { if let Some((target_size, bias)) = Self::integral_size_and_signed_bias(tcx, ty) {
let val = let val = if let mir::ConstantKind::Val(ConstValue::Scalar(scalar), _) = value {
if let mir::ConstantKind::Val(ConstValue::Scalar(scalar), _) = value {
// For this specific pattern we can skip a lot of effort and go // For this specific pattern we can skip a lot of effort and go
// straight to the result, after doing a bit of checking. (We // straight to the result, after doing a bit of checking. (We
// could remove this branch and just fall through, which // could remove this branch and just fall through, which