Encode cross-crate opaque type origin
This commit is contained in:
parent
4add5e4211
commit
e093b82a41
19 changed files with 53 additions and 43 deletions
|
@ -384,7 +384,10 @@ impl<T> Trait<T> for X {
|
|||
| DefKind::AssocFn
|
||||
| DefKind::AssocConst
|
||||
)
|
||||
&& tcx.is_type_alias_impl_trait(opaque_ty.def_id)
|
||||
&& matches!(
|
||||
tcx.opaque_ty_origin(opaque_ty.def_id),
|
||||
hir::OpaqueTyOrigin::TyAlias { .. }
|
||||
)
|
||||
&& !tcx
|
||||
.opaque_types_defined_by(body_owner_def_id.expect_local())
|
||||
.contains(&opaque_ty.def_id.expect_local())
|
||||
|
|
|
@ -2648,7 +2648,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
|
|||
obligation: &PredicateObligation<'tcx>,
|
||||
def_id: DefId,
|
||||
) -> ErrorGuaranteed {
|
||||
let name = match self.tcx.opaque_type_origin(def_id.expect_local()) {
|
||||
let name = match self.tcx.local_opaque_ty_origin(def_id.expect_local()) {
|
||||
hir::OpaqueTyOrigin::FnReturn { .. } | hir::OpaqueTyOrigin::AsyncFn { .. } => {
|
||||
"opaque type".to_string()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue