Skip to content

Commit

Permalink
Fix warning with nightly rust:
Browse files Browse the repository at this point in the history
```
warning: cannot find macro `self_test` in this scope
  --> lib.rs:44:10
   |
44 | #![doc = self_test!(/**
   |          ^^^^^^^^^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #124535 <rust-lang/rust#124535>
   = help: import `macro_rules` with `use` to make it callable above its definition
   = note: `#[warn(out_of_scope_macro_calls)]` on by default

```
  • Loading branch information
ogoffart committed Jul 11, 2024
1 parent 7c77558 commit 54636ac
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,8 @@ macro_rules! self_test {
};
}

use self_test;

// The following struct is inserted only during generation of the documentation in order to exploit doc-tests.
// These doc-tests are used to check that invalid arguments to the `document_features!` macro cause a compile time error.
// For a more principled way of testing compilation error, maybe investigate <https://docs.rs/trybuild>.
Expand Down

0 comments on commit 54636ac

Please sign in to comment.