Questions tagged [rust-attributes]

3 questions
2
votes
1 answer

error: `cannot find attribute in this scope` when using custom proc_macro with attributes written with darling in rust

I am writing a library which includes a custom derive macro with custom attributes. For this I use darling. My project structure, thus, is as follows: ├── pg-worm │ ├── pg-worm-derive │ │ ├── src/lib.rs │ ├── src/lib.rs My proc macro is…
Einliterflasche
  • 473
  • 6
  • 18
1
vote
1 answer

When to use "cold" built-in codegen attribute in Rust?

There isn't much information on this attribute in the reference document other than The cold attribute suggests that the attributed function is unlikely to be called. How does it work internally and when a Rust developer should use it?
BinaryButterfly
  • 18,137
  • 13
  • 50
  • 91
0
votes
1 answer

Rust Rocket Attribute having Unexpected Effect when used inside of an Implementation

I'm sure I am misunderstanding something here but I am trying to use Routes for a Rocket application like the below use rocket; use crate::endpoint::routes as endpoint_routes; /* REDACTED */ let routes = endpoint_routes::new_routes(); let…
TheLovelySausage
  • 3,838
  • 15
  • 56
  • 106