Encode cross-crate opaque type origin

This commit is contained in:
Michael Goulet 2024-10-02 23:16:31 -04:00
parent 4add5e4211
commit e093b82a41
19 changed files with 53 additions and 43 deletions

View file

@ -155,7 +155,10 @@ impl<'tcx> InferCtxt<'tcx> {
// however in `fn fut() -> impl Future<Output = i32> { async { 42 } }`, where
// it is of no concern, so we only check for TAITs.
if self.can_define_opaque_ty(b_def_id)
&& self.tcx.is_type_alias_impl_trait(b_def_id)
&& matches!(
self.tcx.opaque_ty_origin(b_def_id),
hir::OpaqueTyOrigin::TyAlias { .. }
)
{
self.dcx().emit_err(OpaqueHiddenTypeDiag {
span,