forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#121545 - gvozdvmozgu:fix-attribute-validation-associated-items, r=fmease fix attribute validation on associated items in traits rust-lang#121537, fixed attribute validation on associated items in traits
- Loading branch information
Showing
3 changed files
with
16 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
7 changes: 7 additions & 0 deletions
7
tests/ui/attributes/validation-on-associated-items-issue-121537.rs
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 @@ | ||
trait MyTrait { | ||
#[doc = MyTrait] | ||
//~^ ERROR attribute value must be a literal | ||
fn myfun(); | ||
} | ||
|
||
fn main() {} |
8 changes: 8 additions & 0 deletions
8
tests/ui/attributes/validation-on-associated-items-issue-121537.stderr
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: attribute value must be a literal | ||
--> $DIR/validation-on-associated-items-issue-121537.rs:2:13 | ||
| | ||
LL | #[doc = MyTrait] | ||
| ^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|