replace usages of fn_sig query with bound_fn_sig

This commit is contained in:
Kyle Matsuda 2023-01-18 15:43:20 -07:00
parent d7948c843d
commit e982971ff2
66 changed files with 147 additions and 113 deletions

View file

@ -64,9 +64,9 @@ fn is_promotable_const_fn(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
&& match tcx.lookup_const_stability(def_id) {
Some(stab) => {
if cfg!(debug_assertions) && stab.promotable {
let sig = tcx.fn_sig(def_id);
let sig = tcx.bound_fn_sig(def_id);
assert_eq!(
sig.unsafety(),
sig.skip_binder().unsafety(),
hir::Unsafety::Normal,
"don't mark const unsafe fns as promotable",
// https://github.com/rust-lang/rust/pull/53851#issuecomment-418760682

View file

@ -72,7 +72,7 @@ impl<'mir, 'tcx> ConstCx<'mir, 'tcx> {
let ty::Closure(_, substs) = ty.kind() else { bug!("type_of closure not ty::Closure") };
substs.as_closure().sig()
} else {
self.tcx.fn_sig(did)
self.tcx.bound_fn_sig(did).subst_identity()
}
}
}