danielhenrymantilla / ext-trait.rs

Annotation to easily define ad-hoc / one-shot extension traits
Apache License 2.0
9 stars 0 forks source link

No ability to specify `pub trait MyTrait: Sized` #5

Open Niedzwiedzw opened 3 months ago

Niedzwiedzw commented 3 months ago

great library, seriously - deserves more praise. I only found this issue once, so idk if you'd be interested in extentending the macro. manually writing trait with : Sized bound and implementing it on a type makes it compile

danielhenrymantilla commented 3 months ago

Hey, thanks for the feedback. I don't really understand what you're asking for, though:

Niedzwiedzw commented 3 months ago

yeah so for some reason it asks me to specify that it's : Sized when using the macro but when doing it manually it doesn't. I can't really share the macro cause it's for work... I'll try playing with the where clause, but idk what the syntax is, could you provide a minimal example?

danielhenrymantilla commented 3 months ago
#[extension(/* pub */ trait YourTraitName)]
impl<…> …
where
    …,
    Self : Sized, // 👈
{
    …
}
Niedzwiedzw commented 3 months ago

ok I'm sure this will solve it, thank you very much