-use crate::ty::subst::SubstsRef;
use crate::ty::{self, Ty, TyCtxt};
use rustc_hir as hir;
-use rustc_hir::def_id::DefId;
use rustc_hir::lang_items::LangItem;
use rustc_macros::HashStable;
use rustc_span::Span;
}
impl<'tcx> OverloadedDeref<'tcx> {
- pub fn method_call(&self, tcx: TyCtxt<'tcx>, source: Ty<'tcx>) -> (DefId, SubstsRef<'tcx>) {
+ /// Get the zst function item type for this method call.
+ pub fn method_call(&self, tcx: TyCtxt<'tcx>, source: Ty<'tcx>) -> Ty<'tcx> {
let trait_def_id = match self.mutbl {
hir::Mutability::Not => tcx.require_lang_item(LangItem::Deref, None),
hir::Mutability::Mut => tcx.require_lang_item(LangItem::DerefMut, None),
.find(|m| m.kind == ty::AssocKind::Fn)
.unwrap()
.def_id;
- (method_def_id, tcx.mk_substs_trait(source, &[]))
+ tcx.mk_fn_def(method_def_id, tcx.mk_substs_trait(source, []))
}
}