Improve proc macro attribute diagnostics Closes https://github.com/rust-lang/rust/issues/102923
check_attr