You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `doc_test!` macro defines two local variables (`entries` and `doc`),
which are then accessed from the provided `block`.
However, this only compiled due to a bug in rustc: substituted
metavariables cannot refer to names defined within the macro body. For
example, the following ode does not compile:
```rust
macro_rules! foo {
($block:expr) => {
let mut bar = false;
$block
}
}
fn main() {
foo!({bar = true});
}
```
In this case, the `doc_test!` macro was incorrectly allowed to compile
due to the presence of the `#[tokio::test]` macro on the enclosing
function. When the underlying compiler bug is fixed in
rust-lang/rust#75800,
this macro will stop compiling.
0 commit comments