diff --git a/gcc/rust/ast/rust-ast-visitor.cc b/gcc/rust/ast/rust-ast-visitor.cc index d8395820892e..4ec5c7cf1d0a 100644 --- a/gcc/rust/ast/rust-ast-visitor.cc +++ b/gcc/rust/ast/rust-ast-visitor.cc @@ -30,20 +30,6 @@ namespace Rust { namespace AST { -template -void -DefaultASTVisitor::visit (T &node) -{ - node.accept_vis (*this); -} - -template -void -DefaultASTVisitor::visit (std::unique_ptr &node) -{ - node->accept_vis (*this); -} - void DefaultASTVisitor::visit (AST::Crate &crate) { diff --git a/gcc/rust/ast/rust-ast-visitor.h b/gcc/rust/ast/rust-ast-visitor.h index 00886f616e30..8ea118bc3fa2 100644 --- a/gcc/rust/ast/rust-ast-visitor.h +++ b/gcc/rust/ast/rust-ast-visitor.h @@ -395,9 +395,12 @@ class DefaultASTVisitor : public ASTVisitor virtual void visit (AST::FunctionParam ¶m) override; virtual void visit (AST::VariadicParam ¶m) override; - template void visit (T &node); + template void visit (T &node) { node.accept_vis (*this); } - template void visit (std::unique_ptr &node); + template void visit (std::unique_ptr &node) + { + node->accept_vis (*this); + } virtual void visit (AST::GenericArgsBinding &binding); virtual void visit (AST::PathExprSegment &segment);