-
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 equivalent of existing tests in their 2024 edition form
- Loading branch information
1 parent
eaec783
commit 3625f00
Showing
10 changed files
with
138 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,19 @@ | ||
// compile-flags: -Z unstable-options --edition 2024 | ||
|
||
#![crate_type = "lib"] | ||
#![doc(as_ptr)] | ||
//~^ ERROR unknown `doc` attribute | ||
|
||
#[doc(as_ptr)] | ||
//~^ ERROR unknown `doc` attribute | ||
pub fn foo() {} | ||
|
||
#[doc(123)] | ||
//~^ ERROR invalid `doc` attribute | ||
#[doc("hello", "bar")] | ||
//~^ ERROR invalid `doc` attribute | ||
//~| ERROR invalid `doc` attribute | ||
#[doc(foo::bar, crate::bar::baz = "bye")] | ||
//~^ ERROR unknown `doc` attribute | ||
//~| ERROR unknown `doc` attribute | ||
fn bar() {} |
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,44 @@ | ||
error: unknown `doc` attribute `as_ptr` | ||
--> $DIR/doc-attr-2024.rs:7:7 | ||
| | ||
LL | #[doc(as_ptr)] | ||
| ^^^^^^ | ||
|
||
error: invalid `doc` attribute | ||
--> $DIR/doc-attr-2024.rs:11:7 | ||
| | ||
LL | #[doc(123)] | ||
| ^^^ | ||
|
||
error: invalid `doc` attribute | ||
--> $DIR/doc-attr-2024.rs:13:7 | ||
| | ||
LL | #[doc("hello", "bar")] | ||
| ^^^^^^^ | ||
|
||
error: invalid `doc` attribute | ||
--> $DIR/doc-attr-2024.rs:13:16 | ||
| | ||
LL | #[doc("hello", "bar")] | ||
| ^^^^^ | ||
|
||
error: unknown `doc` attribute `foo::bar` | ||
--> $DIR/doc-attr-2024.rs:16:7 | ||
| | ||
LL | #[doc(foo::bar, crate::bar::baz = "bye")] | ||
| ^^^^^^^^ | ||
|
||
error: unknown `doc` attribute `crate::bar::baz` | ||
--> $DIR/doc-attr-2024.rs:16:17 | ||
| | ||
LL | #[doc(foo::bar, crate::bar::baz = "bye")] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: unknown `doc` attribute `as_ptr` | ||
--> $DIR/doc-attr-2024.rs:4:8 | ||
| | ||
LL | #![doc(as_ptr)] | ||
| ^^^^^^ | ||
|
||
error: aborting due to 7 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,6 @@ | ||
// compile-flags: -Z unstable-options --edition 2024 | ||
|
||
#![doc(test(""))] | ||
//~^ ERROR `#![doc(test(...)]` does not take a literal | ||
|
||
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,8 @@ | ||
error: `#![doc(test(...)]` does not take a literal | ||
--> $DIR/doc-test-literal-2024.rs:3:13 | ||
| | ||
LL | #![doc(test(""))] | ||
| ^^ | ||
|
||
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,6 @@ | ||
// compile-flags: -Z unstable-options --edition 2024 | ||
|
||
#![crate_type = "lib"] | ||
|
||
#[doc(owo)] //~ ERROR: unknown `doc` attribute | ||
pub struct Owo5; |
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 @@ | ||
error: unknown `doc` attribute `owo` | ||
--> $DIR/invalid_repr_list_help-2024.rs:5:7 | ||
| | ||
LL | #[doc(owo)] | ||
| ^^^ | ||
|
||
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,7 @@ | ||
// compile-flags: -Z unstable-options --edition 2024 | ||
|
||
#[doc(primitive = "foo")] | ||
//~^ ERROR unknown `doc` attribute `primitive` | ||
mod bar {} | ||
|
||
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,8 @@ | ||
error: unknown `doc` attribute `primitive` | ||
--> $DIR/doc-primitive-2024.rs:3:7 | ||
| | ||
LL | #[doc(primitive = "foo")] | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
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,12 @@ | ||
// compile-flags: -Z unstable-options --edition 2024 | ||
|
||
#![crate_type = "lib"] | ||
|
||
#![doc(test)] | ||
//~^ ERROR `#[doc(test(...)]` takes a list of attributes | ||
#![doc(test = "hello")] | ||
//~^ ERROR `#[doc(test(...)]` takes a list of attributes | ||
#![doc(test(a))] | ||
//~^ ERROR unknown `doc(test)` attribute `a` | ||
|
||
pub fn 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,20 @@ | ||
error: `#[doc(test(...)]` takes a list of attributes | ||
--> $DIR/doc-test-attr-2024.rs:5:8 | ||
| | ||
LL | #![doc(test)] | ||
| ^^^^ | ||
|
||
error: `#[doc(test(...)]` takes a list of attributes | ||
--> $DIR/doc-test-attr-2024.rs:7:8 | ||
| | ||
LL | #![doc(test = "hello")] | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error: unknown `doc(test)` attribute `a` | ||
--> $DIR/doc-test-attr-2024.rs:9:13 | ||
| | ||
LL | #![doc(test(a))] | ||
| ^ | ||
|
||
error: aborting due to 3 previous errors | ||
|