Closed
Description
On beta and nightly, items generated by macros in external crates do not have to be documented, even in the presence of #![deny(missing_docs)]
.
Consider this code: https://gist.github.com/0dda35f371bdde94780fc65bb99c4bf0
Now observe the reaction! Compiling with stable:
$ cargo +stable build
Compiling b v0.1.0 (file:///Users/alex/Documents/work/macdoc/b)
Compiling a v0.1.0 (file:///Users/alex/Documents/work/macdoc/a)
error: missing documentation for a function
--> src/lib.rs:8:9
|
8 | pub fn $f() {}
| ^^^^^^^^^^^
...
14 | a!(bar, Bar);
| ------------- in this macro invocation
|
note: lint level defined here
--> src/lib.rs:1:9
|
1 | #![deny(missing_docs)]
| ^^^^^^^^^^^^
error: missing documentation for a struct
--> src/lib.rs:10:9
|
10 | pub struct $g;
| ^^^^^^^^^^^^^^
...
14 | a!(bar, Bar);
| ------------- in this macro invocation
error: missing documentation for a function
--> src/lib.rs:15:1
|
15 | b!(foo, Foo);
| ^^^^^^^^^^^^^
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error: missing documentation for a struct
--> src/lib.rs:15:1
|
15 | b!(foo, Foo);
| ^^^^^^^^^^^^^
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error: aborting due to 4 previous errors
error: Could not compile `a`.
To learn more, run the command again with --verbose.
And with beta:
$ cargo +beta build
Compiling b v0.1.0 (file:///Users/alex/Documents/work/macdoc/b)
Compiling a v0.1.0 (file:///Users/alex/Documents/work/macdoc/a)
error: missing documentation for a function
--> src/lib.rs:8:9
|
8 | pub fn $f() {}
| ^^^^^^^^^^^
...
14 | a!(bar, Bar);
| ------------- in this macro invocation
|
note: lint level defined here
--> src/lib.rs:1:9
|
1 | #![deny(missing_docs)]
| ^^^^^^^^^^^^
error: missing documentation for a struct
--> src/lib.rs:10:9
|
10 | pub struct $g;
| ^^^^^^^^^^^^^^
...
14 | a!(bar, Bar);
| ------------- in this macro invocation
error: aborting due to 2 previous errors
error: Could not compile `a`.
To learn more, run the command again with --verbose.
Note only the two errors!
cc: @Dylan-DPC