Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

impl dyn Any for monomorphized dyn Trait #2571

Open
SoniEx2 opened this issue Oct 21, 2018 · 1 comment
Open

impl dyn Any for monomorphized dyn Trait #2571

SoniEx2 opened this issue Oct 21, 2018 · 1 comment
Labels
A-trait-object Proposals relating to trait objects. T-lang Relevant to the language team, which will review and decide on the RFC.

Comments

@SoniEx2
Copy link

SoniEx2 commented Oct 21, 2018

there's no reason why stuff like this shouldn't be made more friendly and optimized (I shouldn't need two boxes for it to work): https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=7281cea78856a6bc6c8693dcb320b9d0

note that I'm talking specifically about fn<T: Foo>(t: T) -> Box<dyn Any> kinda usage. you wouldn't be able to take an arbitrary dyn Foo and turn it into an dyn Any (yet).

@Ixrec
Copy link
Contributor

Ixrec commented Oct 21, 2018

I suspect the hard part of solving this use case is figuring out the general problem of multi-trait objects and trait object up/downcasting: #2035

@jonas-schievink jonas-schievink added A-trait-object Proposals relating to trait objects. T-lang Relevant to the language team, which will review and decide on the RFC. labels Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-trait-object Proposals relating to trait objects. T-lang Relevant to the language team, which will review and decide on the RFC.
Projects
None yet
Development

No branches or pull requests

3 participants