Rust: remove VariantDef

This commit is contained in:
Paolo Tranquilli
2025-06-20 15:59:18 +02:00
parent 0d292b785c
commit 02b6e856a3
21 changed files with 39 additions and 232 deletions

View File

@@ -1,2 +1,2 @@
mod.rs 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7
top.rs 78da6fde6bc6f66baf63b298b3d565d6a057b54e891f739a3510aff4563a9f1b 78da6fde6bc6f66baf63b298b3d565d6a057b54e891f739a3510aff4563a9f1b
top.rs 4cd878b17ebc18c28cbaac2eb77a7401d60c0870247877c4c1dd155c31342482 4cd878b17ebc18c28cbaac2eb77a7401d60c0870247877c4c1dd155c31342482

View File

@@ -3227,42 +3227,6 @@ impl From<trap::Label<UseTreeList>> for trap::Label<Element> {
}
}
#[derive(Debug)]
pub struct VariantDef {
_unused: ()
}
impl trap::TrapClass for VariantDef {
fn class_name() -> &'static str { "VariantDef" }
}
impl From<trap::Label<VariantDef>> for trap::Label<AstNode> {
fn from(value: trap::Label<VariantDef>) -> Self {
// SAFETY: this is safe because in the dbscheme VariantDef is a subclass of AstNode
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<VariantDef>> for trap::Label<Locatable> {
fn from(value: trap::Label<VariantDef>) -> Self {
// SAFETY: this is safe because in the dbscheme VariantDef is a subclass of Locatable
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<VariantDef>> for trap::Label<Element> {
fn from(value: trap::Label<VariantDef>) -> Self {
// SAFETY: this is safe because in the dbscheme VariantDef is a subclass of Element
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
#[derive(Debug)]
pub struct VariantList {
pub id: trap::TrapId<VariantList>,
@@ -8646,9 +8610,9 @@ impl trap::TrapClass for Variant {
fn class_name() -> &'static str { "Variant" }
}
impl From<trap::Label<Variant>> for trap::Label<VariantDef> {
impl From<trap::Label<Variant>> for trap::Label<Addressable> {
fn from(value: trap::Label<Variant>) -> Self {
// SAFETY: this is safe because in the dbscheme Variant is a subclass of VariantDef
// SAFETY: this is safe because in the dbscheme Variant is a subclass of Addressable
unsafe {
Self::from_untyped(value.as_untyped())
}
@@ -8682,15 +8646,6 @@ impl From<trap::Label<Variant>> for trap::Label<Element> {
}
}
impl From<trap::Label<Variant>> for trap::Label<Addressable> {
fn from(value: trap::Label<Variant>) -> Self {
// SAFETY: this is safe because in the dbscheme Variant is a subclass of Addressable
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
#[derive(Debug)]
pub struct WildcardPat {
pub id: trap::TrapId<WildcardPat>,
@@ -11551,15 +11506,6 @@ impl From<trap::Label<Struct>> for trap::Label<Addressable> {
}
}
impl From<trap::Label<Struct>> for trap::Label<VariantDef> {
fn from(value: trap::Label<Struct>) -> Self {
// SAFETY: this is safe because in the dbscheme Struct is a subclass of VariantDef
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
#[derive(Debug)]
pub struct Union {
pub id: trap::TrapId<Union>,
@@ -11666,15 +11612,6 @@ impl From<trap::Label<Union>> for trap::Label<Addressable> {
}
}
impl From<trap::Label<Union>> for trap::Label<VariantDef> {
fn from(value: trap::Label<Union>) -> Self {
// SAFETY: this is safe because in the dbscheme Union is a subclass of VariantDef
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
#[derive(Debug)]
pub struct WhileExpr {
pub id: trap::TrapId<WhileExpr>,