2 ms·
> Those things the compiler is angry about? Those are things that would be runtime errors in C. > There is a subset of "valid" Rust code that `rustc` rejects b
by mehrdadn 8y ago
> Those things the compiler is angry about? Those are things that would be runtime errors in C.
> There is a subset of "valid" Rust code that `rustc` rejects because it isn't smart enough to understand it would be safe
Way to tell him he's wrong only to then proceed to directly contradict yourself...
- 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