Open haraldh opened 4 years ago
Introducing a new trait gets the job done, though and the compiler will pick the right thing. https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=682e14eddb0270a6787ab0259966f2d3
I've been doing a bit of digging in the type checking code and I've found the core problem of this bug:
This piece of code that checks for illegal_sized_bound
, should be checked somewhere in the consider_candidates
(or one of the functions that it calls, such as consider_probe
). It should be done before the Ambiguity
error is returned.
I'm writing this down for two reasons:
Any chance anybody looking into this?
Seems like the compiler tries the trait method for an
dyn Error + 'static
even though it does not work, because of !Sized and does not consider taking theimpl dyn Error + 'static
.Playground: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=a6845b426451f1d7a5105a9bd3a00499
error: