Skip to content

Commit

Permalink
Unrolled build for rust-lang#121545
Browse files Browse the repository at this point in the history
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
rust-timer authored Mar 17, 2024
2 parents 4c1b9c3 + 8b576d5 commit ca3b995
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_ast_passes/src/ast_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1527,6 +1527,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
generics,
body.as_deref(),
);
walk_list!(self, visit_attribute, &item.attrs);
self.visit_fn(kind, item.span, item.id);
}
AssocItemKind::Type(_) => {
Expand Down
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() {}
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

0 comments on commit ca3b995

Please sign in to comment.