Skip to content

Commit 2acce96

Browse files
aibaarsredsun82
andcommitted
Apply suggestions from code review
Co-authored-by: Paolo Tranquilli <[email protected]>
1 parent b7f66f8 commit 2acce96

File tree

1 file changed

+7
-2
lines changed
  • rust/extractor/src/translate

1 file changed

+7
-2
lines changed

rust/extractor/src/translate/base.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,20 @@ macro_rules! pre_emit {
4141
};
4242
($($_:tt)*) => {};
4343
}
44+
45+
// TODO: remove the mannually written Label conversions. These can be auto-generated by
46+
// changing the base class of AssocItem from AstNode to Item
4447
impl From<crate::trap::Label<generated::AssocItem>> for crate::trap::Label<generated::Item> {
4548
fn from(value: crate::trap::Label<generated::AssocItem>) -> Self {
46-
// SAFETY: this is safe because in the dbscheme Item is a subclass of Stmt
49+
// SAFETY: this is safe because every concrete instance of `@assoc_item` is also an instance of `@item`
4750
unsafe { Self::from_untyped(value.as_untyped()) }
4851
}
4952
}
53+
// TODO: remove the mannually written Label conversions. These can be auto-generated by
54+
// changing the base class of ExternItem from AstNode to Item
5055
impl From<crate::trap::Label<generated::ExternItem>> for crate::trap::Label<generated::Item> {
5156
fn from(value: crate::trap::Label<generated::ExternItem>) -> Self {
52-
// SAFETY: this is safe because in the dbscheme Item is a subclass of Stmt
57+
// SAFETY: this is safe because every concrete instance of `@extern_item` is also an instance of `@item`
5358
unsafe { Self::from_untyped(value.as_untyped()) }
5459
}
5560
}

0 commit comments

Comments
 (0)