3 ms·
The problem is that it would be possible for a Rust 2015 module to encounter an Error defined in Rust 202X, so what would happen if that Rust 2015 called `descr
by irishsultan 7y ago
The problem is that it would be possible for a Rust 2015 module to encounter an Error defined in Rust 202X, so what would happen if that Rust 2015 called `description` on that error if Rust 202X didn't require/allow defining the method `description`?
- est31 7y ago> what would happen if that Rust 2015 called `description` on that error if Rust 202X didn't require/allow defining the method `description`? It's already not required to be defined. Since 1.27.0 there is a default implementation that contains a "description is deprecated" msg. https://doc.rust-lang.org/1.42.0/src/std/error.rs.html#139 https://doc.rust-lang.org/1.42.0/src/std/error.rs.html#139
- GolDDranks 7y ago`description` is still a default method, so the default implementation provided by the Error trait would be called.
- pas 7y agoIf your main crate is edition 202X, then it could warn if you link it with anything that depends on Error.description. Too drastic (and would be dog slow)? Yes, but it's easily possible.