Add AliasKind::Weak
for type aliases.
Only use it when the type alias contains an opaque type. Also does wf-checking on such type aliases.
This commit is contained in:
parent
4fdd07fe88
commit
f3b7dd6388
86 changed files with 474 additions and 199 deletions
|
@ -1465,8 +1465,8 @@ impl<'tcx> LateLintPass<'tcx> for TypeAliasBounds {
|
|||
let hir::ItemKind::TyAlias(ty, type_alias_generics) = &item.kind else {
|
||||
return
|
||||
};
|
||||
if let hir::TyKind::OpaqueDef(..) = ty.kind {
|
||||
// Bounds are respected for `type X = impl Trait`
|
||||
if cx.tcx.type_of(item.owner_id.def_id).skip_binder().has_opaque_types() {
|
||||
// Bounds are respected for `type X = impl Trait` and `type X = (impl Trait, Y);`
|
||||
return;
|
||||
}
|
||||
if cx.tcx.type_of(item.owner_id).skip_binder().has_inherent_projections() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue