I have a proc-macro that uses doc comments. It gets invoked through a macro_rules! macro which seems somewhat relevant, but I can actually reproduce the issue by writing out #[doc = "something"] and bypassing the macro_rules! macro:
#[doc = "some docs"]
#[derive(SomeMacroThatFailsIfThereIsNoDocAttribute)]
pub struct MyStruct;
Works with rustc, fails with rust-analyzer.