Skip to content

Commit 8d3c90a

Browse files
committed
Review suggestions
1 parent 98f30e8 commit 8d3c90a

File tree

3 files changed

+18
-20
lines changed

3 files changed

+18
-20
lines changed

compiler/rustc_const_eval/src/interpret/operand.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,11 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
363363
src: &OpTy<'tcx, M::Provenance>,
364364
) -> InterpResult<'tcx, Either<MPlaceTy<'tcx, M::Provenance>, ImmTy<'tcx, M::Provenance>>> {
365365
Ok(match src.as_mplace_or_imm() {
366-
Left(mplace) => {
367-
if let Some(val) = self.read_immediate_from_mplace_raw(&mplace)? {
366+
Left(ref mplace) => {
367+
if let Some(val) = self.read_immediate_from_mplace_raw(mplace)? {
368368
Right(val)
369369
} else {
370-
Left(mplace)
370+
Left(*mplace)
371371
}
372372
}
373373
Right(val) => Right(val),

compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

+14-16
Original file line numberDiff line numberDiff line change
@@ -1368,22 +1368,20 @@ fn compare_number_of_method_arguments<'tcx>(
13681368
})
13691369
.or(trait_item_span);
13701370

1371-
let impl_span = {
1372-
let ImplItemKind::Fn(impl_m_sig, _) = &tcx.hir().expect_impl_item(impl_m.def_id.expect_local()).kind else { bug!("{:?} is not a method", impl_m) };
1373-
let pos = impl_number_args.saturating_sub(1);
1374-
impl_m_sig
1375-
.decl
1376-
.inputs
1377-
.get(pos)
1378-
.map(|arg| {
1379-
if pos == 0 {
1380-
arg.span
1381-
} else {
1382-
arg.span.with_lo(impl_m_sig.decl.inputs[0].span.lo())
1383-
}
1384-
})
1385-
.unwrap_or(impl_m_span)
1386-
};
1371+
let ImplItemKind::Fn(impl_m_sig, _) = &tcx.hir().expect_impl_item(impl_m.def_id.expect_local()).kind else { bug!("{:?} is not a method", impl_m) };
1372+
let pos = impl_number_args.saturating_sub(1);
1373+
let impl_span = impl_m_sig
1374+
.decl
1375+
.inputs
1376+
.get(pos)
1377+
.map(|arg| {
1378+
if pos == 0 {
1379+
arg.span
1380+
} else {
1381+
arg.span.with_lo(impl_m_sig.decl.inputs[0].span.lo())
1382+
}
1383+
})
1384+
.unwrap_or(impl_m_span);
13871385

13881386
let mut err = struct_span_err!(
13891387
tcx.sess,

compiler/rustc_trait_selection/src/traits/query/normalize.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ impl<'cx, 'tcx> FallibleTypeFolder<'tcx> for QueryNormalizer<'cx, 'tcx> {
230230
if concrete_ty == ty {
231231
bug!(
232232
"infinite recursion generic_ty: {:#?}, substs: {:#?}, \
233-
concrete_ty: {:#?}, ty: {:#?}",
233+
concrete_ty: {:#?}, ty: {:#?}",
234234
generic_ty,
235235
substs,
236236
concrete_ty,

0 commit comments

Comments
 (0)