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
I'm trying to cast a borrowed &str to a dyn SourceCode but I'm receiving the error: error[E0277]: the size for values of type str cannot be known at compilation time
and help: the trait `Sized` is not implemented for `str` note: required for the cast from `&str` to `&dyn SourceCode`
Which leads me to Source Code's definition, where it is said to be implemented by str and &str (as expected), but it is not marked as ?Sized which I suspect is the reason why this cast can't be made.
The text was updated successfully, but these errors were encountered:
I think this is happening because you’re trying to turn &str into &dyn SourceCode… that is, str (which is unsized, and does NOT implement SourceCode), into dyn SourceCode
I'm trying to cast a borrowed
&str
to adyn SourceCode
but I'm receiving the error:error[E0277]: the size for values of type
strcannot be known at compilation time
and
help: the trait `Sized` is not implemented for `str`
note: required for the cast from `&str` to `&dyn SourceCode`
Which leads me to
Source Code
's definition, where it is said to be implemented bystr
and&str
(as expected), but it is not marked as?Sized
which I suspect is the reason why this cast can't be made.The text was updated successfully, but these errors were encountered: