-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing tests from test/ui/rustdoc into test/rustdoc-ui
- Loading branch information
1 parent
2ac7443
commit 9a4c5fb
Showing
9 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// check-pass | ||
|
||
#[cfg(doc)] | ||
pub struct Foo; | ||
|
||
fn main() { | ||
let f = Foo; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#![deny(invalid_doc_attributes)] | ||
//~^ NOTE defined here | ||
#![doc(x)] | ||
//~^ ERROR unknown `doc` attribute `x` | ||
//~| WARNING will become a hard error | ||
//~| NOTE see issue #82730 | ||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
error: unknown `doc` attribute `x` | ||
--> $DIR/deny-invalid-doc-attrs.rs:3:8 | ||
| | ||
LL | #![doc(x)] | ||
| ^ | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/deny-invalid-doc-attrs.rs:1:9 | ||
| | ||
LL | #![deny(invalid_doc_attributes)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
= 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 #82730 <https://github.com/rust-lang/rust/issues/82730> | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#[doc(inline)] | ||
//~^ ERROR conflicting | ||
#[doc(no_inline)] | ||
pub extern crate core; | ||
|
||
// no warning | ||
pub extern crate alloc; | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#![crate_type = "lib"] | ||
#![feature(doc_keyword)] | ||
|
||
#![doc(keyword = "hello")] //~ ERROR | ||
|
||
#[doc(keyword = "hell")] //~ ERROR | ||
mod foo { | ||
fn hell() {} | ||
} | ||
|
||
#[doc(keyword = "hall")] //~ ERROR | ||
fn foo() {} | ||
|
||
|
||
// Regression test for the ICE described in #83512. | ||
trait Foo { | ||
#[doc(keyword = "match")] | ||
//~^ ERROR: `#[doc(keyword = "...")]` can only be used on modules | ||
fn quux() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
error: `#[doc(keyword = "...")]` can only be used on empty modules | ||
--> $DIR/doc_keyword.rs:6:7 | ||
| | ||
LL | #[doc(keyword = "hell")] | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: `#[doc(keyword = "...")]` can only be used on modules | ||
--> $DIR/doc_keyword.rs:11:7 | ||
| | ||
LL | #[doc(keyword = "hall")] | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: `#[doc(keyword = "...")]` can only be used on modules | ||
--> $DIR/doc_keyword.rs:17:11 | ||
| | ||
LL | #[doc(keyword = "match")] | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
error: `#![doc(keyword = "...")]` isn't allowed as a crate-level attribute | ||
--> $DIR/doc_keyword.rs:4:8 | ||
| | ||
LL | #![doc(keyword = "hello")] | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 4 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/*! //~ ERROR E0758 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
error[E0758]: unterminated block doc-comment | ||
--> $DIR/unterminated-doc-comment.rs:1:1 | ||
| | ||
LL | /*! | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0758`. |