diff --git a/src/meta.rs b/src/meta.rs index 766d5b703..b6bcf9830 100644 --- a/src/meta.rs +++ b/src/meta.rs @@ -401,6 +401,8 @@ fn parse_meta_path(input: ParseStream) -> Result { if input.peek(Ident::peek_any) { let ident = Ident::parse_any(input)?; segments.push_value(PathSegment::from(ident)); + } else if input.is_empty() { + return Err(input.error("expected nested attribute")); } else if input.peek(Lit) { return Err(input.error("unexpected literal in nested attribute, expected ident")); } else {