4 ms·
Rust will complain about a recursion limit being reached during instantiation[1]. The solution in Rust is to use &dyn Trait or Box<dyn Trait> instead.[2] [1]:
by estebank 4y ago
Rust will complain about a recursion limit being reached during instantiation[1]. The solution in Rust is to use &dyn Trait or Box<dyn Trait> instead.[2]
[1]: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=7bfb188bc741d69ee2bd5ce68982c049 https://play.rust-lang.org/?version=stable&mode=debug&editio...
[2]: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=b5a03fafeda6ec964c47aca41ccd997e https://play.rust-lang.org/?version=stable&mode=debug&editio...
^ This blows the stack because it keeps calling itself with no break condition, but shows how the type system accepted the code.