Skip to content

Commit ed397ad

Browse files
committed
completely deduplicate Visitor and MutVisitor
1 parent 4eaca5d commit ed397ad

File tree

7 files changed

+461
-674
lines changed

7 files changed

+461
-674
lines changed

compiler/rustc_ast/src/ast_traits.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,13 @@ impl<Wrapped, Tag> AstNodeWrapper<Wrapped, Tag> {
321321
}
322322
}
323323

324+
// FIXME: remove after `stmt_expr_attributes` is stabilized.
325+
impl<T, Tag> From<AstNodeWrapper<P<T>, Tag>> for AstNodeWrapper<T, Tag> {
326+
fn from(value: AstNodeWrapper<P<T>, Tag>) -> Self {
327+
AstNodeWrapper { wrapped: *value.wrapped, tag: value.tag }
328+
}
329+
}
330+
324331
impl<Wrapped: HasNodeId, Tag> HasNodeId for AstNodeWrapper<Wrapped, Tag> {
325332
fn node_id(&self) -> NodeId {
326333
self.wrapped.node_id()

0 commit comments

Comments
 (0)