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
structN<'a>(&'a());traitBound{typeInner;}impl<'a>BoundforN<'a>{typeInner = ();}structContainer<T:Bound>(T::Inner);fncast<'a>(m:&'aContainer<N<'static>>) -> &'aContainer<N<'a>>{
m // error, Container is invariant over T}
Changing this to below works
structN<'a>(&'a());traitBound{typeInner;}impl<'a>BoundforN<'a>{typeInner = ();}structContainer<T:Bound,D = <TasBound>::Inner>(T,D);fncast<'a>(m:&'aContainer<N<'static>>) -> &'aContainer<N<'a>>{
m
}
Uh oh!
There was an error while loading. Please reload this page.
Consider this code
Changing this to below works
See
rust-lang/rust#115799
rust-ndarray/ndarray#1480
Rust compiler can be smarter to detect that Innver is covariant but it does not
The text was updated successfully, but these errors were encountered: