Skip to content

Commit

Permalink
Test rustdoc encountering proc_macro_derive in a non-proc-macro crate
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Feb 23, 2023
1 parent 5965948 commit 60b0da1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/rustdoc-ui/proc_macro_bug.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// regression test for failing to pass `--crate-type proc-macro` to rustdoc
// when documenting a proc macro crate https://github.com/rust-lang/rust/pull/107291

extern crate proc_macro;

use proc_macro::TokenStream;

#[proc_macro_derive(DeriveA)]
//~^ ERROR the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type
pub fn a_derive(input: TokenStream) -> TokenStream {
input
}
8 changes: 8 additions & 0 deletions tests/rustdoc-ui/proc_macro_bug.stderr
Original file line number Diff line number Diff line change
@@ -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 comments on commit 60b0da1

Please sign in to comment.