You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot dyn upcast to target w/ auto traits implied by source's principal's supertraits #119335
Is this expected? I can't find any reference to this limitation, neither explicitly in the RFC text nor in this tracking issue. The RFC text does mention not supporting upcasting to multiple traits, but I'd have expected lifetimes as well as auto traits to not be included in the limitation.
If it is expected that this feature is stabilized without this support, does anyone know where I should watch, to know of the news on that front?
Minimized:
traitSource:Send + Target{}fnupcast(x:&dynSource) -> &(dynTarget + Send){ x }
We should be able to upcast to a dyn type w/ auto-traits that show up in the principal's supertraits too.
Reacted by José Luis Cruz, Noah Biewesch and Tin Švagelj
Activity
compiler-errors commentedon Dec 27, 2023
I'll fix it.
@rustbot claim
Ekleog commentedon Dec 27, 2023
This would be awesome, thank you so much for looking into it! ❤️
crlf0710 commentedon Dec 27, 2023
This includes the previously unsupported
dyn Source=>dyn Source + Sendcoercion, right? I think it's a good enhancement.compiler-errors commentedon Dec 27, 2023
@crlf0710: Yes, if
SourcehasSendas one of its supertraits.PoignardAzur commentedon Jan 25, 2024
A more minimal example:
compiler-errors commentedon Jan 3, 2025
This got fixed.