Mini counter (unbaked) proposal:
There have been many requests for attribute-like macros to allow arbitrary syntax within the item they're decorating. Just as an easy example off the top of my head:
#[asm]
fn isr_3() {
// this is just asm
pushad
call increment_breakpoint_count
popad
iretd
}
This isn't possible in current Rust, because attribute macros require the item they decorate to be syntactically valid.
Item-like macros, then, would be $path! $item
, except the item does not attempt in any way to parse the contents of any brackets in its top level syntax. So the same example:
```rust
asm! fn isr_3() {
// this is just asm
pushad
call increment_breakpoint_count
popad
iretd
}
Or bitflags:
bitflags! struct Flags {
A = bit 1,
B = bit 2,
C = bit 3,
ABC = A | B | C,
}
Is this a good idea? I don't know. But it shows off a need, a practical definition, and some potential applications, so it's possible to discuss constructively.
No offense intended, @redradist, but it sounds like you're in the ideation phase for your proposal, whereas this forum (for better or for worse) prefers to discuss more concrete proposals on their technical merit.
The rust-lang development discord has a #design channel that might be more fruitful for ideation and initially discovering obvious improvements to ideas than irlo, where you're liable to get jumped on by all the regulars in parallel.
I've been an advocate for a TokenStream::open(&Path)
API for a while now. Having to pass the Rust lexer isn't actually that problematic for most formats you'd want to read in a proc macro, and getting new spans for a new file would be amazing.
And controlled by the compiler if you proxy through it.