]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Move callbacked function in a new namespace
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Thu, 27 Jul 2023 13:22:48 +0000 (15:22 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:56:02 +0000 (18:56 +0100)
Move the function registered as a callback in a new anonymous namespace
in order to group every callback in the future under the same namespace.

gcc/rust/ChangeLog:

* expand/rust-proc-macro.cc: Remove static modifier and move to
an anonymous namespace.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/expand/rust-proc-macro.cc

index 9fee4bb03bdaeb7ebf351b440b53faca8c3c6363..c664e20ecbca3f4866c5d2990263a1d1913d7956 100644 (file)
@@ -26,7 +26,9 @@ namespace Rust {
 
 const std::string PROC_MACRO_DECL_PREFIX = "__gccrs_proc_macro_decls_";
 
-static ProcMacro::TokenStream
+namespace {
+
+ProcMacro::TokenStream
 tokenstream_from_string (std::string &data, bool &lex_error)
 {
   // FIXME: Insert location pointing to call site in tokens
@@ -56,6 +58,8 @@ static_assert (
               ProcMacro::from_str_function_t>::value,
   "Registration callback signature not synced, check proc macro internals.");
 
+} // namespace
+
 template <typename Symbol, typename Callback>
 bool
 register_callback (void *handle, Symbol, std::string symbol_name,