Skip to content

Commit ca3b995

Browse files
authored
Unrolled build for rust-lang#121545
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
2 parents 4c1b9c3 + 8b576d5 commit ca3b995

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

compiler/rustc_ast_passes/src/ast_validation.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1527,6 +1527,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
15271527
generics,
15281528
body.as_deref(),
15291529
);
1530+
walk_list!(self, visit_attribute, &item.attrs);
15301531
self.visit_fn(kind, item.span, item.id);
15311532
}
15321533
AssocItemKind::Type(_) => {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
trait MyTrait {
2+
#[doc = MyTrait]
3+
//~^ ERROR attribute value must be a literal
4+
fn myfun();
5+
}
6+
7+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: attribute value must be a literal
2+
--> $DIR/validation-on-associated-items-issue-121537.rs:2:13
3+
|
4+
LL | #[doc = MyTrait]
5+
| ^^^^^^^
6+
7+
error: aborting due to 1 previous error
8+

0 commit comments

Comments
 (0)