use super::{probe, MethodCallee};
-use crate::astconv::{AstConv, CreateSubstsForGenericArgsCtxt};
+use crate::astconv::{AstConv, CreateSubstsForGenericArgsCtxt, IsMethodCall};
use crate::check::{callee, FnCtxt};
use crate::hir::def_id::DefId;
use crate::hir::GenericArg;
}
}
+#[derive(Debug)]
pub struct ConfirmResult<'tcx> {
pub callee: MethodCallee<'tcx>,
pub illegal_sized_bound: Option<Span>,
// If they were not explicitly supplied, just construct fresh
// variables.
let generics = self.tcx.generics_of(pick.item.def_id);
+
let arg_count_correct = AstConv::check_generic_arg_count_for_call(
- self.tcx, self.span, &generics, &seg, true, // `is_method_call`
+ self.tcx,
+ self.span,
+ pick.item.def_id,
+ &generics,
+ seg,
+ IsMethodCall::Yes,
);
// Create subst for early-bound lifetime parameters, combining
traits::elaborate_predicates(self.tcx, predicates.predicates.iter().copied())
// We don't care about regions here.
- .filter_map(|obligation| match obligation.predicate.skip_binders() {
- ty::PredicateAtom::Trait(trait_pred, _) if trait_pred.def_id() == sized_def_id => {
+ .filter_map(|obligation| match obligation.predicate.kind().skip_binder() {
+ ty::PredicateKind::Trait(trait_pred, _) if trait_pred.def_id() == sized_def_id => {
let span = predicates
.predicates
.iter()
self.tcx,
self.span,
Some(self.self_expr.span),
+ self.call_expr.span,
trait_def_id,
),
ty::ImplContainer(..) => {}