From 1e5450d4cb7bb951bbdb9bc2b09a984b132c4280 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 4 Dec 2019 13:31:40 +0100 Subject: [PATCH] Clean up E0117 error code long explanation --- src/librustc_error_codes/error_codes/E0117.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/librustc_error_codes/error_codes/E0117.md b/src/librustc_error_codes/error_codes/E0117.md index bd3623056626..7fa211d4a27d 100644 --- a/src/librustc_error_codes/error_codes/E0117.md +++ b/src/librustc_error_codes/error_codes/E0117.md @@ -1,3 +1,11 @@ +The `Drop` trait was implemented on a non-struct type. + +Erroneous code example: + +```compile_fail,E0117 +impl Drop for u32 {} +``` + This error indicates a violation of one of Rust's orphan rules for trait implementations. The rule prohibits any implementation of a foreign trait (a trait defined in another crate) where @@ -6,12 +14,6 @@ trait defined in another crate) where - all of the parameters being passed to the trait (if there are any) are also foreign. -Here's one example of this error: - -```compile_fail,E0117 -impl Drop for u32 {} -``` - To avoid this kind of error, ensure that at least one local type is referenced by the `impl`: