Open
Description
After #19873 was closed and a new release rolled out, I went and tested the fix, but found out that only one case was fixed, and in the meantime, I found another case of the same problem. So, picking up the list again from #19873 (I could not reopen it):
a macro call in anfixed 👍impl
block expanding to some items:- very specifically, a macro call providing a format specifier for a macro that expands to a
format!
call (the original example wasanyhow!
, I recreated it with(VSCode does not expand further thanmacro_rules! my_macro { ($head:expr, $($tail:tt)*) => { format!($head, $($tail)*) }; } fn test() { _ = my_macro!( concat!("<", "{}", ">"), // this doesn't expand since 0.0.274 "hi", ); }
alloc::__export::format_args!
either before or after, but I'm guessing that might be on purpose asformat_args!
is not really a macro. Still I was getting an expansion ofconcat!
there in 0.0.273, but I'm getting none on 0.0.274) Still seeing this a macro call in aI understand this is not meant to be supported, and I'm ok with it 👍doc
attribute like#[doc = include_str!("README.md")]
. This one I can confirm that previous versions of VSCode were able to expand, but now I get no expansion.- a macro call in a
.rs
file that is included viainclude!
rather than via a normal module item (and apparently that has been done in the wild even for non-generated files). Again when going to the included file with VSCode, the macros can be expanded on older plugin versions, but can't any more on newer ones. Still seeing this - a macro call expanding in a type context
This also shows up in the IDE. This is newly discovered
macro_rules! my_int { () => { i32 }; } fn answer() -> my_int!() { // this doesn't expand since 0.0.274 42 }
I've updated the example crate with the above information.
Thanks for fixing case 1, which was by far the most worrying one. Case 5 though seems also something that could bite us.
rust-analyzer version: 0.0.285 (rust-analyzer as library from crates.io)
rustc version: 1.86
editor or extension: -
relevant settings: -
repository link (if public, optional): example crate
cc @Veykril