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
If I have a create a value of type Box<Any> which is an upcasted version of a closure (e.g. Fn()) in one crate and then downcast it with the appropriate type in another crate, it fails. For example, if I have the following library in one crate:
use std::any::Any;pubfnalloc<T:Any>(t:T) -> Box<Any>{Box::new(t)}pubfnunwrap<T:Any>(x:Box<Any>){
x.downcast_ref::<T>().unwrap();}pubfnunwrap_i32(x:Box<Any>){
x.downcast_ref::<i32>().unwrap();}pubfnunwrap_closure(x:Box<Any>){
x.downcast_ref::<Box<Fn()>>().unwrap();}
And then a binary that uses the library in another crate:
Minimal example: https://github.com/willcrichton/issue-34758
If I have a create a value of type
Box<Any>
which is an upcasted version of a closure (e.g.Fn()
) in one crate and then downcast it with the appropriate type in another crate, it fails. For example, if I have the following library in one crate:And then a binary that uses the library in another crate:
Then it fails where noted (i.e. at the unwrap).
The text was updated successfully, but these errors were encountered: