Skip to content

Commit 60b0da1

Browse files
committed
Test rustdoc encountering proc_macro_derive in a non-proc-macro crate
1 parent 5965948 commit 60b0da1

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

tests/rustdoc-ui/proc_macro_bug.rs

+12
Original file line numberDiff line numberDiff line change
@@ -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+
}
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type
2+
--> $DIR/proc_macro_bug.rs:8:1
3+
|
4+
LL | #[proc_macro_derive(DeriveA)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
7+
error: aborting due to previous error
8+

0 commit comments

Comments
 (0)