-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
A-macromacro expansionmacro expansionA-proc-macroproc macroproc macroB-unstableunstable featureunstable featureC-featureCategory: feature requestCategory: feature request
Description
rust-analyzer version: 1.88.0-nightly (27d6200 2025-05-06)
rustc version: rustc 1.88.0-nightly (27d6200a7 2025-05-06)
editor or extension: rustaceanvim on version 5.26.0
code snippet to reproduce:
A proc macro using the nightly expand_expr
feature
#![feature(proc_macro_expand)]
extern crate proc_macro;
#[proc_macro]
pub fn expand(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
let input = input.expand_expr().unwrap();
panic!("expanded input: {input}");
}
when using this macro:
the_macro::expand!(concat!("Hello, ", "world!"));
cargo check
(and its corresponding) diagnostic produces expanded input: "Hello, world!"
, but rust analyzer also produces its own error: proc-macro panicked: expanded input: concat ! ("Hello, " , "world!") [macro-error]
In addition, it seems the macro is not expanded at all in this case by RA, leading to items emitted by said macro to not be available in completions.
Metadata
Metadata
Assignees
Labels
A-macromacro expansionmacro expansionA-proc-macroproc macroproc macroB-unstableunstable featureunstable featureC-featureCategory: feature requestCategory: feature request