Ensure no one constructs AliasTys themselves

This commit is contained in:
Oli Scherer
2022-12-13 11:07:42 +00:00
parent 4ffe3bdf99
commit a5cd3bde95
50 changed files with 104 additions and 106 deletions

View File

@@ -779,8 +779,7 @@ fn foo(&self) -> Self::T { String::new() }
ty: Ty<'tcx>,
) -> bool {
let assoc = self.associated_item(proj_ty.def_id);
if let ty::Alias(ty::Opaque, ty::AliasTy { def_id, substs: _ }) = *proj_ty.self_ty().kind()
{
if let ty::Alias(ty::Opaque, ty::AliasTy { def_id, .. }) = *proj_ty.self_ty().kind() {
let opaque_local_def_id = def_id.as_local();
let opaque_hir_ty = if let Some(opaque_local_def_id) = opaque_local_def_id {
match &self.hir().expect_item(opaque_local_def_id).kind {