diff --git a/src/test/rustdoc-ui/doc-alias-crate-level.rs b/src/test/rustdoc-ui/doc-alias-crate-level.rs new file mode 100644 index 00000000000..f70a78b2a25 --- /dev/null +++ b/src/test/rustdoc-ui/doc-alias-crate-level.rs @@ -0,0 +1,3 @@ +#![feature(doc_alias)] + +#![doc(alias = "shouldn't work!")] //~ ERROR diff --git a/src/test/rustdoc-ui/doc-alias-crate-level.stderr b/src/test/rustdoc-ui/doc-alias-crate-level.stderr new file mode 100644 index 00000000000..47c18b116e4 --- /dev/null +++ b/src/test/rustdoc-ui/doc-alias-crate-level.stderr @@ -0,0 +1,8 @@ +error: `#![doc(alias = "...")]` isn't allowed as a crate level attribute + --> $DIR/doc-alias-crate-level.rs:3:8 + | +LL | #![doc(alias = "shouldn't work!")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/doc-alias-crate-level.rs b/src/test/ui/doc-alias-crate-level.rs new file mode 100644 index 00000000000..94d320c4306 --- /dev/null +++ b/src/test/ui/doc-alias-crate-level.rs @@ -0,0 +1,5 @@ +#![feature(doc_alias)] + +#![crate_type = "lib"] + +#![doc(alias = "shouldn't work!")] //~ ERROR diff --git a/src/test/ui/doc-alias-crate-level.stderr b/src/test/ui/doc-alias-crate-level.stderr new file mode 100644 index 00000000000..5f3e494de29 --- /dev/null +++ b/src/test/ui/doc-alias-crate-level.stderr @@ -0,0 +1,8 @@ +error: `#![doc(alias = "...")]` isn't allowed as a crate level attribute + --> $DIR/doc-alias-crate-level.rs:5:8 + | +LL | #![doc(alias = "shouldn't work!")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error +