Review suggestions
This commit is contained in:
parent
98f30e833a
commit
8d3c90ae13
3 changed files with 18 additions and 20 deletions
|
@ -363,11 +363,11 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||||
src: &OpTy<'tcx, M::Provenance>,
|
src: &OpTy<'tcx, M::Provenance>,
|
||||||
) -> InterpResult<'tcx, Either<MPlaceTy<'tcx, M::Provenance>, ImmTy<'tcx, M::Provenance>>> {
|
) -> InterpResult<'tcx, Either<MPlaceTy<'tcx, M::Provenance>, ImmTy<'tcx, M::Provenance>>> {
|
||||||
Ok(match src.as_mplace_or_imm() {
|
Ok(match src.as_mplace_or_imm() {
|
||||||
Left(mplace) => {
|
Left(ref mplace) => {
|
||||||
if let Some(val) = self.read_immediate_from_mplace_raw(&mplace)? {
|
if let Some(val) = self.read_immediate_from_mplace_raw(mplace)? {
|
||||||
Right(val)
|
Right(val)
|
||||||
} else {
|
} else {
|
||||||
Left(mplace)
|
Left(*mplace)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Right(val) => Right(val),
|
Right(val) => Right(val),
|
||||||
|
|
|
@ -1368,22 +1368,20 @@ fn compare_number_of_method_arguments<'tcx>(
|
||||||
})
|
})
|
||||||
.or(trait_item_span);
|
.or(trait_item_span);
|
||||||
|
|
||||||
let impl_span = {
|
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) };
|
||||||
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) };
|
let pos = impl_number_args.saturating_sub(1);
|
||||||
let pos = impl_number_args.saturating_sub(1);
|
let impl_span = impl_m_sig
|
||||||
impl_m_sig
|
.decl
|
||||||
.decl
|
.inputs
|
||||||
.inputs
|
.get(pos)
|
||||||
.get(pos)
|
.map(|arg| {
|
||||||
.map(|arg| {
|
if pos == 0 {
|
||||||
if pos == 0 {
|
arg.span
|
||||||
arg.span
|
} else {
|
||||||
} else {
|
arg.span.with_lo(impl_m_sig.decl.inputs[0].span.lo())
|
||||||
arg.span.with_lo(impl_m_sig.decl.inputs[0].span.lo())
|
}
|
||||||
}
|
})
|
||||||
})
|
.unwrap_or(impl_m_span);
|
||||||
.unwrap_or(impl_m_span)
|
|
||||||
};
|
|
||||||
|
|
||||||
let mut err = struct_span_err!(
|
let mut err = struct_span_err!(
|
||||||
tcx.sess,
|
tcx.sess,
|
||||||
|
|
|
@ -230,7 +230,7 @@ impl<'cx, 'tcx> FallibleTypeFolder<'tcx> for QueryNormalizer<'cx, 'tcx> {
|
||||||
if concrete_ty == ty {
|
if concrete_ty == ty {
|
||||||
bug!(
|
bug!(
|
||||||
"infinite recursion generic_ty: {:#?}, substs: {:#?}, \
|
"infinite recursion generic_ty: {:#?}, substs: {:#?}, \
|
||||||
concrete_ty: {:#?}, ty: {:#?}",
|
concrete_ty: {:#?}, ty: {:#?}",
|
||||||
generic_ty,
|
generic_ty,
|
||||||
substs,
|
substs,
|
||||||
concrete_ty,
|
concrete_ty,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue