1
Fork 0

pessimistically treat all function items as containing an opaque type

This commit is contained in:
Oli Scherer 2022-06-29 14:25:44 +00:00
parent 493c960a3e
commit 9dbfcbcbb5
7 changed files with 63 additions and 4 deletions

View file

@ -207,6 +207,11 @@ impl FlagComputation {
&ty::FnDef(_, substs) => {
self.add_substs(substs);
// HACK(#98608, oli-obk): Function items with opaque types in their signature will
// end up not having the HAS_TY_OPAQUE flag set, causing `evaluate_obligation` to
// optimistically assume the function item matches any signature. See documentation
// on `HAS_FREE_LOCAL_NAMES` for details.
self.add_flags(TypeFlags::HAS_TY_OPAQUE);
}
&ty::FnPtr(fn_sig) => self.bound_computation(fn_sig, |computation, fn_sig| {