-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Type inference complains about unknown size for dyn Any
#127005
Comments
The type you defined in your struct is |
@Wasabi375 Do you see why this is working as intended? |
Yeah, not sure how I got myself confused here. Thanks for the help anyways. |
Inferring the resulting type of
Box::downcast_unsafe
complains aboutdyn Any
not being sized. However if the type is specified directly, everything works as expected.I tried this code:
This creates the following error message:
However specifying the type directly (
let data: Box<TTarget> = ...
) does not produce an error.I would expect to either get no error message, or an error stating that the type can not be inferred.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: