Skip to content

Commit dc1216b

Browse files
committed
fixup new usages of fn_sig, bound_fn_sig after rebasing
1 parent 4a7d0e9 commit dc1216b

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

compiler/rustc_infer/src/infer/error_reporting/note_and_explain.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ fn foo(&tcx) -> Self::T { String::new() }
463463
ty::AssocKind::Fn == item.kind && Some(item.name) != current_method_ident
464464
})
465465
.filter_map(|item| {
466-
let method = tcx.fn_sig(item.def_id);
466+
let method = tcx.fn_sig(item.def_id).subst_identity();
467467
match *method.output().skip_binder().kind() {
468468
ty::Alias(ty::Projection, ty::AliasTy { def_id: item_def_id, .. })
469469
if item_def_id == proj_ty_item_def_id =>

compiler/rustc_infer/src/infer/error_reporting/suggest.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
369369
(ty::FnPtr(sig), ty::FnDef(did, substs)) => {
370370
let expected_sig = &(self.normalize_fn_sig)(*sig);
371371
let found_sig =
372-
&(self.normalize_fn_sig)(self.tcx.bound_fn_sig(*did).subst(self.tcx, substs));
372+
&(self.normalize_fn_sig)(self.tcx.fn_sig(*did).subst(self.tcx, substs));
373373

374374
let fn_name = self.tcx.def_path_str_with_substs(*did, substs);
375375

@@ -408,9 +408,9 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
408408
}
409409
(ty::FnDef(did1, substs1), ty::FnDef(did2, substs2)) => {
410410
let expected_sig =
411-
&(self.normalize_fn_sig)(self.tcx.bound_fn_sig(*did1).subst(self.tcx, substs1));
411+
&(self.normalize_fn_sig)(self.tcx.fn_sig(*did1).subst(self.tcx, substs1));
412412
let found_sig =
413-
&(self.normalize_fn_sig)(self.tcx.bound_fn_sig(*did2).subst(self.tcx, substs2));
413+
&(self.normalize_fn_sig)(self.tcx.fn_sig(*did2).subst(self.tcx, substs2));
414414

415415
if self.same_type_modulo_infer(*expected_sig, *found_sig) {
416416
diag.note("different fn items have unique types, even if their signatures are the same");
@@ -440,7 +440,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
440440
}
441441
(ty::FnDef(did, substs), ty::FnPtr(sig)) => {
442442
let expected_sig =
443-
&(self.normalize_fn_sig)(self.tcx.bound_fn_sig(*did).subst(self.tcx, substs));
443+
&(self.normalize_fn_sig)(self.tcx.fn_sig(*did).subst(self.tcx, substs));
444444
let found_sig = &(self.normalize_fn_sig)(*sig);
445445

446446
if !self.same_type_modulo_infer(*found_sig, *expected_sig) {

compiler/rustc_passes/src/check_attr.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2120,7 +2120,8 @@ impl CheckAttrVisitor<'_> {
21202120
let id = hir_id.expect_owner();
21212121
let hir_sig = tcx.hir().fn_sig_by_hir_id(hir_id).unwrap();
21222122

2123-
let sig = tcx.liberate_late_bound_regions(id.to_def_id(), tcx.fn_sig(id));
2123+
let sig =
2124+
tcx.liberate_late_bound_regions(id.to_def_id(), tcx.fn_sig(id).subst_identity());
21242125
let sig = tcx.normalize_erasing_regions(ParamEnv::empty(), sig);
21252126

21262127
// We don't currently require that the function signature is equal to

compiler/rustc_trait_selection/src/solve/trait_goals/structural_traits.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ pub(crate) fn extract_tupled_inputs_and_output_from_callable<'tcx>(
184184
) -> Result<Option<ty::Binder<'tcx, (Ty<'tcx>, Ty<'tcx>)>>, NoSolution> {
185185
match *self_ty.kind() {
186186
ty::FnDef(def_id, substs) => Ok(Some(
187-
tcx.bound_fn_sig(def_id)
187+
tcx.fn_sig(def_id)
188188
.subst(tcx, substs)
189189
.map_bound(|sig| (tcx.mk_tup(sig.inputs().iter()), sig.output())),
190190
)),

0 commit comments

Comments
 (0)