Skip to content

Commit 4f956c7

Browse files
committed
docs: suggest to use #[macro_use(derive)] instead of importing all macros
1 parent 28bc0d3 commit 4f956c7

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Hovering over an alias `#[derive(..Alias)]` shows *exactly* what it expands into
6565
To globally override `#[std::derive]` with [`#[derive_aliases::derive]`](https://docs.rs/derive_aliases/latest/derive_aliases/attr.derive.html), add the following:
6666

6767
```rust
68-
#[macro_use]
68+
#[macro_use(derive)]
6969
extern crate derive_aliases;
7070
```
7171

proc_macro/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ See the [crate-level](https://docs.rs/derive_aliases/latest/derive_aliases) docu
4242
// they see the actual documentation, but without having duplicate documentation in the HTML documentation
4343
//
4444
// ---
45-
//
46-
// when doing `#[macro_use] extern crate proc` we will also globally import this macro
47-
// and it will be suggested by rust_analyzer. but since this macro must be called just once,
48-
// we don't want rust_analyzer to suggest it
49-
#[cfg_attr(not(doc), doc(hidden))]
5045
#[cfg_attr(not(feature = "show"), doc(hidden))]
5146
#[allow(unused_assignments)]
5247
#[proc_macro]

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
//! To globally override `#[std::derive]` with [`#[derive_aliases::derive]`](derive), add the following:
6363
//!
6464
//! ```
65-
//! #[macro_use]
65+
//! #[macro_use(derive)]
6666
//! extern crate derive_aliases;
6767
//! ```
6868
//!

0 commit comments

Comments
 (0)