This string will never change and can be constified.
gcc/rust/ChangeLog:
* expand/rust-expand-visitor.cc (derive_item): Add const
attribute to the trait name argument.
* expand/rust-macro-expand.h (struct MacroExpander): Likewise.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
}
static std::vector<std::unique_ptr<AST::Item>>
-derive_item (std::unique_ptr<AST::Item> &item, std::string &to_derive,
+derive_item (std::unique_ptr<AST::Item> &item, const std::string &to_derive,
MacroExpander &expander)
{
std::vector<std::unique_ptr<AST::Item>> result;
void import_proc_macros (std::string extern_crate);
template <typename T>
- AST::Fragment expand_derive_proc_macro (T &item, std::string &trait_name)
+ AST::Fragment expand_derive_proc_macro (T &item,
+ const std::string &trait_name)
{
ProcMacro::CustomDerive macro;