Properties derive macro generates non-compiling code
Author: felixwattsCreated Sep 24, 2026Updated Sep 25, 2026
Labelsbug
Problem Under certain conditions the Properties derive macro generates code that does not compile.
Steps To Reproduce This code breaks:
trait Request{
type Response;
}
trait Form
where
Self::Request: Request,
{
type Request;
}
#[derive(PartialEq)]
struct OnOk<T>(T);
#[derive(PartialEq, Properties)]
struct Props<F>
where
F: Form + PartialEq,
F::Request: PartialEq,
<F::Request as Request>::Response: PartialEq
{
form: F,
on_ok: OnOk<<F::Request as Request>::Response>
}Interestingly this code compiles:
trait Request{
type Response;
}
trait Form {
type Request: Request;
}
#[derive(PartialEq)]
struct OnOk<T>(T);
#[derive(PartialEq, Properties)]
struct Props<F>
where
F: Form + PartialEq,
F::Request: PartialEq,
<F::Request as Request>::Response: PartialEq
{
form: F,
on_ok: OnOk<<F::Request as Request>::Response>
}Expected behavior Both should build and produce equivalent results.
Environment:
- Yew version: 0.23
- Rust version: 1.100.0_nightly
Questionnaire
- I'm interested in fixing this myself but don't know where to start
- I would like to fix and I have a solution
- I don't have time to fix this right now, but maybe later
Source: yewstack/yew