mirror of
https://github.com/github/codeql.git
synced 2025-12-21 19:26:31 +01:00
Rust: fix QL compilation errors
This commit is contained in:
2
rust/extractor/src/generated/.generated.list
generated
2
rust/extractor/src/generated/.generated.list
generated
@@ -1,2 +1,2 @@
|
||||
mod.rs 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7
|
||||
top.rs 8db75515b09f6c96beb8c2895e7495350e76557d01399de5faf6c314a45ce594 8db75515b09f6c96beb8c2895e7495350e76557d01399de5faf6c314a45ce594
|
||||
top.rs 4b7dc25409974b210c908c4a15d5b69d242c07305e6e78c9dfe0fa434c22e2bd 4b7dc25409974b210c908c4a15d5b69d242c07305e6e78c9dfe0fa434c22e2bd
|
||||
|
||||
675
rust/extractor/src/generated/top.rs
generated
675
rust/extractor/src/generated/top.rs
generated
@@ -6055,6 +6055,51 @@ impl From<trap::Label<ParenType>> for trap::Label<TypeRef> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct PathAstNode {
|
||||
_unused: ()
|
||||
}
|
||||
|
||||
impl trap::TrapClass for PathAstNode {
|
||||
fn class_name() -> &'static str { "PathAstNode" }
|
||||
}
|
||||
|
||||
impl From<trap::Label<PathAstNode>> for trap::Label<AstNode> {
|
||||
fn from(value: trap::Label<PathAstNode>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme PathAstNode is a subclass of AstNode
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<PathAstNode>> for trap::Label<Element> {
|
||||
fn from(value: trap::Label<PathAstNode>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme PathAstNode is a subclass of Element
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<PathAstNode>> for trap::Label<Locatable> {
|
||||
fn from(value: trap::Label<PathAstNode>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme PathAstNode is a subclass of Locatable
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<PathAstNode>> for trap::Label<Resolvable> {
|
||||
fn from(value: trap::Label<PathAstNode>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme PathAstNode is a subclass of Resolvable
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct PathExprBase {
|
||||
_unused: ()
|
||||
@@ -6100,83 +6145,6 @@ impl From<trap::Label<PathExprBase>> for trap::Label<Locatable> {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<PathExprBase>> for trap::Label<Resolvable> {
|
||||
fn from(value: trap::Label<PathExprBase>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme PathExprBase is a subclass of Resolvable
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct PathPat {
|
||||
pub id: trap::TrapId<PathPat>,
|
||||
pub path: Option<trap::Label<Path>>,
|
||||
}
|
||||
|
||||
impl trap::TrapEntry for PathPat {
|
||||
fn extract_id(&mut self) -> trap::TrapId<Self> {
|
||||
std::mem::replace(&mut self.id, trap::TrapId::Star)
|
||||
}
|
||||
|
||||
fn emit(self, id: trap::Label<Self>, out: &mut trap::Writer) {
|
||||
out.add_tuple("path_pats", vec![id.into()]);
|
||||
if let Some(v) = self.path {
|
||||
out.add_tuple("path_pat_paths", vec![id.into(), v.into()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl trap::TrapClass for PathPat {
|
||||
fn class_name() -> &'static str { "PathPat" }
|
||||
}
|
||||
|
||||
impl From<trap::Label<PathPat>> for trap::Label<AstNode> {
|
||||
fn from(value: trap::Label<PathPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme PathPat is a subclass of AstNode
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<PathPat>> for trap::Label<Element> {
|
||||
fn from(value: trap::Label<PathPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme PathPat is a subclass of Element
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<PathPat>> for trap::Label<Locatable> {
|
||||
fn from(value: trap::Label<PathPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme PathPat is a subclass of Locatable
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<PathPat>> for trap::Label<Pat> {
|
||||
fn from(value: trap::Label<PathPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme PathPat is a subclass of Pat
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<PathPat>> for trap::Label<Resolvable> {
|
||||
fn from(value: trap::Label<PathPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme PathPat is a subclass of Resolvable
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct PathType {
|
||||
pub id: trap::TrapId<PathType>,
|
||||
@@ -6508,78 +6476,6 @@ impl From<trap::Label<RangePat>> for trap::Label<Pat> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct RecordExpr {
|
||||
pub id: trap::TrapId<RecordExpr>,
|
||||
pub path: Option<trap::Label<Path>>,
|
||||
pub record_expr_field_list: Option<trap::Label<RecordExprFieldList>>,
|
||||
}
|
||||
|
||||
impl trap::TrapEntry for RecordExpr {
|
||||
fn extract_id(&mut self) -> trap::TrapId<Self> {
|
||||
std::mem::replace(&mut self.id, trap::TrapId::Star)
|
||||
}
|
||||
|
||||
fn emit(self, id: trap::Label<Self>, out: &mut trap::Writer) {
|
||||
out.add_tuple("record_exprs", vec![id.into()]);
|
||||
if let Some(v) = self.path {
|
||||
out.add_tuple("record_expr_paths", vec![id.into(), v.into()]);
|
||||
}
|
||||
if let Some(v) = self.record_expr_field_list {
|
||||
out.add_tuple("record_expr_record_expr_field_lists", vec![id.into(), v.into()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl trap::TrapClass for RecordExpr {
|
||||
fn class_name() -> &'static str { "RecordExpr" }
|
||||
}
|
||||
|
||||
impl From<trap::Label<RecordExpr>> for trap::Label<AstNode> {
|
||||
fn from(value: trap::Label<RecordExpr>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme RecordExpr is a subclass of AstNode
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<RecordExpr>> for trap::Label<Element> {
|
||||
fn from(value: trap::Label<RecordExpr>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme RecordExpr is a subclass of Element
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<RecordExpr>> for trap::Label<Expr> {
|
||||
fn from(value: trap::Label<RecordExpr>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme RecordExpr is a subclass of Expr
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<RecordExpr>> for trap::Label<Locatable> {
|
||||
fn from(value: trap::Label<RecordExpr>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme RecordExpr is a subclass of Locatable
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<RecordExpr>> for trap::Label<Resolvable> {
|
||||
fn from(value: trap::Label<RecordExpr>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme RecordExpr is a subclass of Resolvable
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct RecordFieldList {
|
||||
pub id: trap::TrapId<RecordFieldList>,
|
||||
@@ -6639,78 +6535,6 @@ impl From<trap::Label<RecordFieldList>> for trap::Label<Locatable> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct RecordPat {
|
||||
pub id: trap::TrapId<RecordPat>,
|
||||
pub path: Option<trap::Label<Path>>,
|
||||
pub record_pat_field_list: Option<trap::Label<RecordPatFieldList>>,
|
||||
}
|
||||
|
||||
impl trap::TrapEntry for RecordPat {
|
||||
fn extract_id(&mut self) -> trap::TrapId<Self> {
|
||||
std::mem::replace(&mut self.id, trap::TrapId::Star)
|
||||
}
|
||||
|
||||
fn emit(self, id: trap::Label<Self>, out: &mut trap::Writer) {
|
||||
out.add_tuple("record_pats", vec![id.into()]);
|
||||
if let Some(v) = self.path {
|
||||
out.add_tuple("record_pat_paths", vec![id.into(), v.into()]);
|
||||
}
|
||||
if let Some(v) = self.record_pat_field_list {
|
||||
out.add_tuple("record_pat_record_pat_field_lists", vec![id.into(), v.into()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl trap::TrapClass for RecordPat {
|
||||
fn class_name() -> &'static str { "RecordPat" }
|
||||
}
|
||||
|
||||
impl From<trap::Label<RecordPat>> for trap::Label<AstNode> {
|
||||
fn from(value: trap::Label<RecordPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme RecordPat is a subclass of AstNode
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<RecordPat>> for trap::Label<Element> {
|
||||
fn from(value: trap::Label<RecordPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme RecordPat is a subclass of Element
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<RecordPat>> for trap::Label<Locatable> {
|
||||
fn from(value: trap::Label<RecordPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme RecordPat is a subclass of Locatable
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<RecordPat>> for trap::Label<Pat> {
|
||||
fn from(value: trap::Label<RecordPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme RecordPat is a subclass of Pat
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<RecordPat>> for trap::Label<Resolvable> {
|
||||
fn from(value: trap::Label<RecordPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme RecordPat is a subclass of Resolvable
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct RefExpr {
|
||||
pub id: trap::TrapId<RefExpr>,
|
||||
@@ -7475,78 +7299,6 @@ impl From<trap::Label<TuplePat>> for trap::Label<Pat> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct TupleStructPat {
|
||||
pub id: trap::TrapId<TupleStructPat>,
|
||||
pub fields: Vec<trap::Label<Pat>>,
|
||||
pub path: Option<trap::Label<Path>>,
|
||||
}
|
||||
|
||||
impl trap::TrapEntry for TupleStructPat {
|
||||
fn extract_id(&mut self) -> trap::TrapId<Self> {
|
||||
std::mem::replace(&mut self.id, trap::TrapId::Star)
|
||||
}
|
||||
|
||||
fn emit(self, id: trap::Label<Self>, out: &mut trap::Writer) {
|
||||
out.add_tuple("tuple_struct_pats", vec![id.into()]);
|
||||
for (i, v) in self.fields.into_iter().enumerate() {
|
||||
out.add_tuple("tuple_struct_pat_fields", vec![id.into(), i.into(), v.into()]);
|
||||
}
|
||||
if let Some(v) = self.path {
|
||||
out.add_tuple("tuple_struct_pat_paths", vec![id.into(), v.into()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl trap::TrapClass for TupleStructPat {
|
||||
fn class_name() -> &'static str { "TupleStructPat" }
|
||||
}
|
||||
|
||||
impl From<trap::Label<TupleStructPat>> for trap::Label<AstNode> {
|
||||
fn from(value: trap::Label<TupleStructPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme TupleStructPat is a subclass of AstNode
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<TupleStructPat>> for trap::Label<Element> {
|
||||
fn from(value: trap::Label<TupleStructPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme TupleStructPat is a subclass of Element
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<TupleStructPat>> for trap::Label<Locatable> {
|
||||
fn from(value: trap::Label<TupleStructPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme TupleStructPat is a subclass of Locatable
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<TupleStructPat>> for trap::Label<Pat> {
|
||||
fn from(value: trap::Label<TupleStructPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme TupleStructPat is a subclass of Pat
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<TupleStructPat>> for trap::Label<Resolvable> {
|
||||
fn from(value: trap::Label<TupleStructPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme TupleStructPat is a subclass of Resolvable
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct TupleType {
|
||||
pub id: trap::TrapId<TupleType>,
|
||||
@@ -9411,8 +9163,8 @@ impl From<trap::Label<Module>> for trap::Label<Stmt> {
|
||||
#[derive(Debug)]
|
||||
pub struct PathExpr {
|
||||
pub id: trap::TrapId<PathExpr>,
|
||||
pub attrs: Vec<trap::Label<Attr>>,
|
||||
pub path: Option<trap::Label<Path>>,
|
||||
pub attrs: Vec<trap::Label<Attr>>,
|
||||
}
|
||||
|
||||
impl trap::TrapEntry for PathExpr {
|
||||
@@ -9422,12 +9174,12 @@ impl trap::TrapEntry for PathExpr {
|
||||
|
||||
fn emit(self, id: trap::Label<Self>, out: &mut trap::Writer) {
|
||||
out.add_tuple("path_exprs", vec![id.into()]);
|
||||
if let Some(v) = self.path {
|
||||
out.add_tuple("path_ast_node_paths", vec![id.into(), v.into()]);
|
||||
}
|
||||
for (i, v) in self.attrs.into_iter().enumerate() {
|
||||
out.add_tuple("path_expr_attrs", vec![id.into(), i.into(), v.into()]);
|
||||
}
|
||||
if let Some(v) = self.path {
|
||||
out.add_tuple("path_expr_paths", vec![id.into(), v.into()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9471,6 +9223,15 @@ impl From<trap::Label<PathExpr>> for trap::Label<Locatable> {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<PathExpr>> for trap::Label<PathAstNode> {
|
||||
fn from(value: trap::Label<PathExpr>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme PathExpr is a subclass of PathAstNode
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<PathExpr>> for trap::Label<PathExprBase> {
|
||||
fn from(value: trap::Label<PathExpr>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme PathExpr is a subclass of PathExprBase
|
||||
@@ -9489,6 +9250,245 @@ impl From<trap::Label<PathExpr>> for trap::Label<Resolvable> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct PathPat {
|
||||
pub id: trap::TrapId<PathPat>,
|
||||
pub path: Option<trap::Label<Path>>,
|
||||
}
|
||||
|
||||
impl trap::TrapEntry for PathPat {
|
||||
fn extract_id(&mut self) -> trap::TrapId<Self> {
|
||||
std::mem::replace(&mut self.id, trap::TrapId::Star)
|
||||
}
|
||||
|
||||
fn emit(self, id: trap::Label<Self>, out: &mut trap::Writer) {
|
||||
out.add_tuple("path_pats", vec![id.into()]);
|
||||
if let Some(v) = self.path {
|
||||
out.add_tuple("path_ast_node_paths", vec![id.into(), v.into()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl trap::TrapClass for PathPat {
|
||||
fn class_name() -> &'static str { "PathPat" }
|
||||
}
|
||||
|
||||
impl From<trap::Label<PathPat>> for trap::Label<AstNode> {
|
||||
fn from(value: trap::Label<PathPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme PathPat is a subclass of AstNode
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<PathPat>> for trap::Label<Element> {
|
||||
fn from(value: trap::Label<PathPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme PathPat is a subclass of Element
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<PathPat>> for trap::Label<Locatable> {
|
||||
fn from(value: trap::Label<PathPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme PathPat is a subclass of Locatable
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<PathPat>> for trap::Label<Pat> {
|
||||
fn from(value: trap::Label<PathPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme PathPat is a subclass of Pat
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<PathPat>> for trap::Label<PathAstNode> {
|
||||
fn from(value: trap::Label<PathPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme PathPat is a subclass of PathAstNode
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<PathPat>> for trap::Label<Resolvable> {
|
||||
fn from(value: trap::Label<PathPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme PathPat is a subclass of Resolvable
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct RecordExpr {
|
||||
pub id: trap::TrapId<RecordExpr>,
|
||||
pub path: Option<trap::Label<Path>>,
|
||||
pub record_expr_field_list: Option<trap::Label<RecordExprFieldList>>,
|
||||
}
|
||||
|
||||
impl trap::TrapEntry for RecordExpr {
|
||||
fn extract_id(&mut self) -> trap::TrapId<Self> {
|
||||
std::mem::replace(&mut self.id, trap::TrapId::Star)
|
||||
}
|
||||
|
||||
fn emit(self, id: trap::Label<Self>, out: &mut trap::Writer) {
|
||||
out.add_tuple("record_exprs", vec![id.into()]);
|
||||
if let Some(v) = self.path {
|
||||
out.add_tuple("path_ast_node_paths", vec![id.into(), v.into()]);
|
||||
}
|
||||
if let Some(v) = self.record_expr_field_list {
|
||||
out.add_tuple("record_expr_record_expr_field_lists", vec![id.into(), v.into()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl trap::TrapClass for RecordExpr {
|
||||
fn class_name() -> &'static str { "RecordExpr" }
|
||||
}
|
||||
|
||||
impl From<trap::Label<RecordExpr>> for trap::Label<AstNode> {
|
||||
fn from(value: trap::Label<RecordExpr>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme RecordExpr is a subclass of AstNode
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<RecordExpr>> for trap::Label<Element> {
|
||||
fn from(value: trap::Label<RecordExpr>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme RecordExpr is a subclass of Element
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<RecordExpr>> for trap::Label<Expr> {
|
||||
fn from(value: trap::Label<RecordExpr>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme RecordExpr is a subclass of Expr
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<RecordExpr>> for trap::Label<Locatable> {
|
||||
fn from(value: trap::Label<RecordExpr>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme RecordExpr is a subclass of Locatable
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<RecordExpr>> for trap::Label<PathAstNode> {
|
||||
fn from(value: trap::Label<RecordExpr>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme RecordExpr is a subclass of PathAstNode
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<RecordExpr>> for trap::Label<Resolvable> {
|
||||
fn from(value: trap::Label<RecordExpr>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme RecordExpr is a subclass of Resolvable
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct RecordPat {
|
||||
pub id: trap::TrapId<RecordPat>,
|
||||
pub path: Option<trap::Label<Path>>,
|
||||
pub record_pat_field_list: Option<trap::Label<RecordPatFieldList>>,
|
||||
}
|
||||
|
||||
impl trap::TrapEntry for RecordPat {
|
||||
fn extract_id(&mut self) -> trap::TrapId<Self> {
|
||||
std::mem::replace(&mut self.id, trap::TrapId::Star)
|
||||
}
|
||||
|
||||
fn emit(self, id: trap::Label<Self>, out: &mut trap::Writer) {
|
||||
out.add_tuple("record_pats", vec![id.into()]);
|
||||
if let Some(v) = self.path {
|
||||
out.add_tuple("path_ast_node_paths", vec![id.into(), v.into()]);
|
||||
}
|
||||
if let Some(v) = self.record_pat_field_list {
|
||||
out.add_tuple("record_pat_record_pat_field_lists", vec![id.into(), v.into()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl trap::TrapClass for RecordPat {
|
||||
fn class_name() -> &'static str { "RecordPat" }
|
||||
}
|
||||
|
||||
impl From<trap::Label<RecordPat>> for trap::Label<AstNode> {
|
||||
fn from(value: trap::Label<RecordPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme RecordPat is a subclass of AstNode
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<RecordPat>> for trap::Label<Element> {
|
||||
fn from(value: trap::Label<RecordPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme RecordPat is a subclass of Element
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<RecordPat>> for trap::Label<Locatable> {
|
||||
fn from(value: trap::Label<RecordPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme RecordPat is a subclass of Locatable
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<RecordPat>> for trap::Label<Pat> {
|
||||
fn from(value: trap::Label<RecordPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme RecordPat is a subclass of Pat
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<RecordPat>> for trap::Label<PathAstNode> {
|
||||
fn from(value: trap::Label<RecordPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme RecordPat is a subclass of PathAstNode
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<RecordPat>> for trap::Label<Resolvable> {
|
||||
fn from(value: trap::Label<RecordPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme RecordPat is a subclass of Resolvable
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Static {
|
||||
pub id: trap::TrapId<Static>,
|
||||
@@ -9902,6 +9902,87 @@ impl From<trap::Label<TraitAlias>> for trap::Label<Stmt> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct TupleStructPat {
|
||||
pub id: trap::TrapId<TupleStructPat>,
|
||||
pub path: Option<trap::Label<Path>>,
|
||||
pub fields: Vec<trap::Label<Pat>>,
|
||||
}
|
||||
|
||||
impl trap::TrapEntry for TupleStructPat {
|
||||
fn extract_id(&mut self) -> trap::TrapId<Self> {
|
||||
std::mem::replace(&mut self.id, trap::TrapId::Star)
|
||||
}
|
||||
|
||||
fn emit(self, id: trap::Label<Self>, out: &mut trap::Writer) {
|
||||
out.add_tuple("tuple_struct_pats", vec![id.into()]);
|
||||
if let Some(v) = self.path {
|
||||
out.add_tuple("path_ast_node_paths", vec![id.into(), v.into()]);
|
||||
}
|
||||
for (i, v) in self.fields.into_iter().enumerate() {
|
||||
out.add_tuple("tuple_struct_pat_fields", vec![id.into(), i.into(), v.into()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl trap::TrapClass for TupleStructPat {
|
||||
fn class_name() -> &'static str { "TupleStructPat" }
|
||||
}
|
||||
|
||||
impl From<trap::Label<TupleStructPat>> for trap::Label<AstNode> {
|
||||
fn from(value: trap::Label<TupleStructPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme TupleStructPat is a subclass of AstNode
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<TupleStructPat>> for trap::Label<Element> {
|
||||
fn from(value: trap::Label<TupleStructPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme TupleStructPat is a subclass of Element
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<TupleStructPat>> for trap::Label<Locatable> {
|
||||
fn from(value: trap::Label<TupleStructPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme TupleStructPat is a subclass of Locatable
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<TupleStructPat>> for trap::Label<Pat> {
|
||||
fn from(value: trap::Label<TupleStructPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme TupleStructPat is a subclass of Pat
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<TupleStructPat>> for trap::Label<PathAstNode> {
|
||||
fn from(value: trap::Label<TupleStructPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme TupleStructPat is a subclass of PathAstNode
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<trap::Label<TupleStructPat>> for trap::Label<Resolvable> {
|
||||
fn from(value: trap::Label<TupleStructPat>) -> Self {
|
||||
// SAFETY: this is safe because in the dbscheme TupleStructPat is a subclass of Resolvable
|
||||
unsafe {
|
||||
Self::from_untyped(value.as_untyped())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct TypeAlias {
|
||||
pub id: trap::TrapId<TypeAlias>,
|
||||
|
||||
Reference in New Issue
Block a user