diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-06-29 14:25:44 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-06-29 16:24:34 +0000 |
| commit | 9dbfcbcbb5d835c2a5784e2f4da4816b90c43ff5 (patch) | |
| tree | 9f7322b09596a56dea4a769fc08e135639d5df99 /compiler | |
| parent | 493c960a3e6cdd2e2fbe8b6ea130fadea05f1ab0 (diff) | |
| download | rust-9dbfcbcbb5d835c2a5784e2f4da4816b90c43ff5.tar.gz rust-9dbfcbcbb5d835c2a5784e2f4da4816b90c43ff5.zip | |
pessimistically treat all function items as containing an opaque type
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_middle/src/ty/flags.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/ty/flags.rs b/compiler/rustc_middle/src/ty/flags.rs index ea6bb8a7abd..49db121db1b 100644 --- a/compiler/rustc_middle/src/ty/flags.rs +++ b/compiler/rustc_middle/src/ty/flags.rs @@ -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| { |
