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
error[E0275]: overflow evaluating the requirement `_: Sized`
help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`playground`)
note: required for`Enc<Vec<_>>` to implement `Encode`
A more verbose example:
If T is explicitly typed, the code will compile. feel free to comment out the line in the playground version to see a working example.
#[test]fncall_write(){write(&1_i8);//ERROR (recursion: overflow evaluating the requirement?)write::<i8>(&1_i8);// OK without the above line}pubstructEnc<T: ?Sized>(pub*constT);pubfnwrite<T>(_:&T)whereEnc<T>:Encode{}pubtraitEncode{}implEncodeforEnc<i8>{}impl<A>EncodeforEnc<Vec<A>>whereEnc<A>:Encode{}
I tried this code:
I expected this to compile.
Instead, this happened:
A more verbose example:
If T is explicitly typed, the code will compile. feel free to comment out the line in the playground version to see a working example.
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=d4352d96adc9ea2b8290c346a38a948e
Meta
This also occurs on stable
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: