user_provided_sig = None;
} else {
let typeck_results = self.tcx().typeck(mir_def_id);
- user_provided_sig = typeck_results.user_provided_sigs.get(&mir_def_id.to_def_id()).map(
- |user_provided_poly_sig| {
+ user_provided_sig =
+ typeck_results.user_provided_sigs.get(&mir_def_id).map(|user_provided_poly_sig| {
// Instantiate the canonicalized variables from
// user-provided signature (e.g., the `_` in the code
// above) with fresh variables.
LateBoundRegionConversionTime::FnCall,
poly_sig,
)
- },
- );
+ });
}
debug!(?normalized_input_tys, ?body.local_decls);
let result = self.normalize_associated_types_in(self.tcx.hir().span(hir_id), result);
let c_result = self.inh.infcx.canonicalize_response(result);
- self.typeck_results.borrow_mut().user_provided_sigs.insert(expr_def_id, c_result);
+ self.typeck_results
+ .borrow_mut()
+ .user_provided_sigs
+ .insert(expr_def_id.expect_local(), c_result);
result
}
for (&def_id, c_sig) in fcx_typeck_results.user_provided_sigs.iter() {
if cfg!(debug_assertions) && c_sig.needs_infer() {
span_bug!(
- self.fcx.tcx.hir().span_if_local(def_id).unwrap(),
+ self.fcx.tcx.def_span(def_id),
"writeback: `{:?}` has inference variables",
c_sig
);
};
use rustc_hir as hir;
use rustc_hir::def::{DefKind, Res};
-use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, LocalDefId, LOCAL_CRATE};
+use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LocalDefIdMap, LOCAL_CRATE};
use rustc_hir::definitions::Definitions;
use rustc_hir::hir_id::OwnerId;
use rustc_hir::intravisit::Visitor;
/// Stores the canonicalized types provided by the user. See also
/// `AscribeUserType` statement in MIR.
- pub user_provided_sigs: DefIdMap<CanonicalPolyFnSig<'tcx>>,
+ pub user_provided_sigs: LocalDefIdMap<CanonicalPolyFnSig<'tcx>>,
adjustments: ItemLocalMap<Vec<ty::adjustment::Adjustment<'tcx>>>,