Don't fire invalid_doc_attributes
on extern crate
items
This commit is contained in:
parent
34b9932f5c
commit
b8ebf4431e
@ -577,7 +577,7 @@ fn check_doc_inline(
|
||||
target: Target,
|
||||
specified_inline: &mut Option<(bool, Span)>,
|
||||
) -> bool {
|
||||
if target == Target::Use {
|
||||
if target == Target::Use || target == Target::ExternCrate {
|
||||
let do_inline = meta.name_or_empty() == sym::inline;
|
||||
if let Some((prev_inline, prev_span)) = *specified_inline {
|
||||
if do_inline != prev_inline {
|
||||
|
9
src/test/ui/rustdoc/doc-inline-extern-crate.rs
Normal file
9
src/test/ui/rustdoc/doc-inline-extern-crate.rs
Normal file
@ -0,0 +1,9 @@
|
||||
#[doc(inline)]
|
||||
//~^ ERROR conflicting
|
||||
#[doc(no_inline)]
|
||||
pub extern crate core;
|
||||
|
||||
// no warning
|
||||
pub extern crate alloc;
|
||||
|
||||
fn main() {}
|
13
src/test/ui/rustdoc/doc-inline-extern-crate.stderr
Normal file
13
src/test/ui/rustdoc/doc-inline-extern-crate.stderr
Normal file
@ -0,0 +1,13 @@
|
||||
error: conflicting doc inlining attributes
|
||||
--> $DIR/doc-inline-extern-crate.rs:1:7
|
||||
|
|
||||
LL | #[doc(inline)]
|
||||
| ^^^^^^ this attribute...
|
||||
LL |
|
||||
LL | #[doc(no_inline)]
|
||||
| ^^^^^^^^^ ...conflicts with this attribute
|
||||
|
|
||||
= help: remove one of the conflicting attributes
|
||||
|
||||
error: aborting due to previous error
|
||||
|
Loading…
Reference in New Issue
Block a user