From: Pierre-Emmanuel Patry Date: Tue, 6 Jun 2023 12:57:14 +0000 (+0200) Subject: gccrs: collector: Move implementation to header X-Git-Tag: basepoints/gcc-15~2490 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0af8582fc71521172e745b8f15b2dc9b83237ad4;p=thirdparty%2Fgcc.git gccrs: collector: Move implementation to header Move implementation from cc file to header, in order to allow call from other headers and prevent linker errors. gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): Move implementation from here... * ast/rust-ast-collector.h: ... to here. Signed-off-by: Pierre-Emmanuel Patry --- diff --git a/gcc/rust/ast/rust-ast-collector.cc b/gcc/rust/ast/rust-ast-collector.cc index a09869b7e6dd..639200aca799 100644 --- a/gcc/rust/ast/rust-ast-collector.cc +++ b/gcc/rust/ast/rust-ast-collector.cc @@ -43,13 +43,6 @@ TokenCollector::visit (AST::Item &item) item.accept_vis (*this); } -template -void -TokenCollector::visit (std::unique_ptr &node) -{ - node->accept_vis (*this); -} - template void TokenCollector::visit (T &node) diff --git a/gcc/rust/ast/rust-ast-collector.h b/gcc/rust/ast/rust-ast-collector.h index e1857977a035..ae4f9fd9d130 100644 --- a/gcc/rust/ast/rust-ast-collector.h +++ b/gcc/rust/ast/rust-ast-collector.h @@ -47,7 +47,10 @@ private: * types implementing `accept_vis` method and for classes for which the * `visit` method is directly implemented. */ - template void visit (std::unique_ptr &node); + template void visit (std::unique_ptr &node) + { + node->accept_vis (*this); + } /** * @see visit>