We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
proc_macro_derive
1 parent 5965948 commit 60b0da1Copy full SHA for 60b0da1
tests/rustdoc-ui/proc_macro_bug.rs
@@ -0,0 +1,12 @@
1
+// regression test for failing to pass `--crate-type proc-macro` to rustdoc
2
+// when documenting a proc macro crate https://github.com/rust-lang/rust/pull/107291
3
+
4
+extern crate proc_macro;
5
6
+use proc_macro::TokenStream;
7
8
+#[proc_macro_derive(DeriveA)]
9
+//~^ ERROR the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type
10
+pub fn a_derive(input: TokenStream) -> TokenStream {
11
+ input
12
+}
tests/rustdoc-ui/proc_macro_bug.stderr
@@ -0,0 +1,8 @@
+error: the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type
+ --> $DIR/proc_macro_bug.rs:8:1
+ |
+LL | #[proc_macro_derive(DeriveA)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+error: aborting due to previous error
0 commit comments