Skip to content

Attribute macros on enum variants fail #36

@protodeniz

Description

@protodeniz

Something like this utilizing https://facet.rs fails:

error_set::error_set! {
	#[derive(facet::Facet)] #[repr(u8)]
	pub enum FooError {
		A(#[facet(opaque)] extrenal_crate::TypeThatDoesntImplementFacetError),
		B(#[facet(opaque)] extrenal_crate::TypeThatDoesntImplementFacetError),
	}
}

Relevant error message:

error: unexpected token, expected `)`
  --> src/lib.rs:30:16
   |
30 |         A(#[facet(opaque)] extrenal_crate::TypeThatDoesntImplementFacetError),
   |           ^

If the code above is moved outside of error_set! macro, it works as expected. Thus, I think it should work within in as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions