@@ -39,7 +39,7 @@ use syn::{
3939 parse_macro_input,
4040 punctuated:: Punctuated ,
4141 spanned:: Spanned ,
42- Attribute , GenericParam , Generics , Ident , Lit , Meta , MetaNameValue , Result , Token ,
42+ Attribute , Expr , GenericParam , Generics , Ident , Lit , Meta , MetaNameValue , Result , Token ,
4343 TypeTraitObject , Visibility ,
4444} ;
4545
@@ -64,10 +64,15 @@ impl TraitSet {
6464
6565 for attr in attrs {
6666 // Check whether current attribute is `#[doc = "..."]`.
67- if let Meta :: NameValue ( MetaNameValue { path, lit, .. } ) = attr. parse_meta ( ) ? {
67+ if let Meta :: NameValue ( MetaNameValue {
68+ path,
69+ value : Expr :: Lit ( lit) ,
70+ ..
71+ } ) = & attr. meta
72+ {
6873 if let Some ( path_ident) = path. get_ident ( ) {
6974 if path_ident == "doc" {
70- if let Lit :: Str ( doc_comment) = lit {
75+ if let Lit :: Str ( doc_comment) = & lit . lit {
7176 out += & doc_comment. value ( ) ;
7277 // Newlines are not included in the literal value,
7378 // so we have to add them manually.
@@ -172,7 +177,7 @@ struct ManyTraitSet {
172177impl Parse for ManyTraitSet {
173178 fn parse ( input : ParseStream ) -> Result < Self > {
174179 Ok ( ManyTraitSet {
175- entries : input. parse_terminated ( TraitSet :: parse) ?,
180+ entries : input. parse_terminated ( TraitSet :: parse, Token ! [ ; ] ) ?,
176181 } )
177182 }
178183}
0 commit comments