Add #[derive(Clone, Copy)] to anonymous adts

Fix the `AssertBoundIsClone` error for anonymous adts.
This commit is contained in:
Frank King 2024-01-20 12:55:21 +08:00
parent 822d6dc5fd
commit 2b04ca94bb
5 changed files with 193 additions and 176 deletions

View file

@ -2161,6 +2161,10 @@ impl TyKind {
None
}
}
pub fn is_anon_adt(&self) -> bool {
matches!(self, TyKind::AnonStruct(..) | TyKind::AnonUnion(..))
}
}
/// Syntax used to declare a trait object.