mirror of
https://github.com/rust-lang/rust
synced 2024-10-14 12:33:57 +00:00
fix attribute validation on associated items in traits
This commit is contained in:
parent
8f359beca4
commit
8b576d5536
|
@ -1519,6 +1519,7 @@ fn visit_assoc_item(&mut self, item: &'a AssocItem, ctxt: AssocCtxt) {
|
|||
generics,
|
||||
body.as_deref(),
|
||||
);
|
||||
walk_list!(self, visit_attribute, &item.attrs);
|
||||
self.visit_fn(kind, item.span, item.id);
|
||||
}
|
||||
AssocItemKind::Type(_) => {
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
trait MyTrait {
|
||||
#[doc = MyTrait]
|
||||
//~^ ERROR attribute value must be a literal
|
||||
fn myfun();
|
||||
}
|
||||
|
||||
fn main() {}
|
|
@ -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
|
||||
|
Loading…
Reference in a new issue