3 ms·
> [...] but I would guess that those cases are less common than than the cases of "seemingly valid" Rust code that is in reality problematic if it were accepted
by estebank 8y ago
> [...] but I would guess that those cases are less common than than the cases of "seemingly valid" Rust code that is in reality problematic if it were accepted.
I would guess that most people starting to try out Rust are hitting the latter more often than the former. "Valid" Rust code that `rustc` rejects is uncommon (and for the most part, a bug), but wanted to acknowledge it happens. A "common" case of it would self-referencing structs, but that is considered a bug to be solved. I've only personally experienced problems with valid code being rejected when expressing complex trees involving associated types with their own independent lifetimes[1][2][3].
[1]: https://github.com/rust-lang/rust/issues/55756 https://github.com/rust-lang/rust/issues/55756
[2]: https://github.com/rust-lang/rust/issues/54378 https://github.com/rust-lang/rust/issues/54378
[3]: https://github.com/rust-lang/rust/issues/54895 https://github.com/rust-lang/rust/issues/54895