Reduce the amount of passed-around arguments that will get merged into one later anyway
This commit is contained in:
parent
1cbc45942d
commit
0c47deed9f
2 changed files with 12 additions and 12 deletions
|
@ -14,11 +14,10 @@ use rustc_middle::thir::*;
|
|||
use rustc_middle::ty::adjustment::{
|
||||
Adjust, Adjustment, AutoBorrow, AutoBorrowMutability, PointerCast,
|
||||
};
|
||||
use rustc_middle::ty::subst::{InternalSubsts, SubstsRef};
|
||||
use rustc_middle::ty::subst::InternalSubsts;
|
||||
use rustc_middle::ty::{
|
||||
self, AdtKind, InlineConstSubsts, InlineConstSubstsParts, ScalarInt, Ty, UpvarSubsts, UserType,
|
||||
};
|
||||
use rustc_span::def_id::DefId;
|
||||
use rustc_span::Span;
|
||||
use rustc_target::abi::VariantIdx;
|
||||
|
||||
|
@ -806,12 +805,12 @@ impl<'tcx> Cx<'tcx> {
|
|||
&mut self,
|
||||
expr: &hir::Expr<'_>,
|
||||
span: Span,
|
||||
overloaded_callee: Option<(DefId, SubstsRef<'tcx>)>,
|
||||
overloaded_callee: Option<Ty<'tcx>>,
|
||||
) -> Expr<'tcx> {
|
||||
let temp_lifetime =
|
||||
self.rvalue_scopes.temporary_scope(self.region_scope_tree, expr.hir_id.local_id);
|
||||
let (def_id, substs, user_ty) = match overloaded_callee {
|
||||
Some((def_id, substs)) => (def_id, substs, None),
|
||||
let (ty, user_ty) = match overloaded_callee {
|
||||
Some(fn_def) => (fn_def, None),
|
||||
None => {
|
||||
let (kind, def_id) =
|
||||
self.typeck_results().type_dependent_def(expr.hir_id).unwrap_or_else(|| {
|
||||
|
@ -819,10 +818,12 @@ impl<'tcx> Cx<'tcx> {
|
|||
});
|
||||
let user_ty = self.user_substs_applied_to_res(expr.hir_id, Res::Def(kind, def_id));
|
||||
debug!("method_callee: user_ty={:?}", user_ty);
|
||||
(def_id, self.typeck_results().node_substs(expr.hir_id), user_ty)
|
||||
(
|
||||
self.tcx().mk_fn_def(def_id, self.typeck_results().node_substs(expr.hir_id)),
|
||||
user_ty,
|
||||
)
|
||||
}
|
||||
};
|
||||
let ty = self.tcx().mk_fn_def(def_id, substs);
|
||||
Expr { temp_lifetime, ty, span, kind: ExprKind::ZstLiteral { user_ty } }
|
||||
}
|
||||
|
||||
|
@ -957,7 +958,7 @@ impl<'tcx> Cx<'tcx> {
|
|||
&mut self,
|
||||
expr: &'tcx hir::Expr<'tcx>,
|
||||
place_ty: Ty<'tcx>,
|
||||
overloaded_callee: Option<(DefId, SubstsRef<'tcx>)>,
|
||||
overloaded_callee: Option<Ty<'tcx>>,
|
||||
args: Box<[ExprId]>,
|
||||
span: Span,
|
||||
) -> ExprKind<'tcx> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue