Description
The detailed help for compiler error E0117 opens with this summary:
The
Drop
trait was implemented on a non-struct type.
The rest of the help output correctly (and clearly -- thank you!) explains what happened -- namely, that the user tried to violate the orphan rules for trait implementations. However that first line is confusing since it's apparently unrelated and wrong.
Here's a simple chunk of code that generates error E0117 (as expected):
impl From<String> for Result<String, String>
{
fn from(s: String) -> Result<String, String>
{
Ok(s)
}
}
Here it is on the playground:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=427d7c85706b598fa8232108769a8552
The error is expected. It's the help output that's confusing:
$ rustc +nightly --explain E0117
The `Drop` trait was implemented on a non-struct type.
...
The content is also here: https://doc.rust-lang.org/error-index.html#E0117
and I think comes from here: https://github.com/rust-lang/rust/blob/master/src/librustc_error_codes/error_codes/E0117.md