From a6b5f875c1cb3a77200c6f3da3d7df0601f90173 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 20 Feb 2020 14:26:43 +0100 Subject: [PATCH 1/2] clean up E0321 explanation --- src/librustc_error_codes/error_codes/E0321.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/librustc_error_codes/error_codes/E0321.md b/src/librustc_error_codes/error_codes/E0321.md index 49cec94430b..bfcdabfe9de 100644 --- a/src/librustc_error_codes/error_codes/E0321.md +++ b/src/librustc_error_codes/error_codes/E0321.md @@ -1,5 +1,7 @@ A cross-crate opt-out trait was implemented on something which wasn't a struct -or enum type. Erroneous code example: +or enum type. + +Erroneous code example: ```compile_fail,E0321 #![feature(optin_builtin_traits)] From 90ebf93bdfe2acdaeb504a24dea27fbfd74e3218 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 20 Feb 2020 14:26:56 +0100 Subject: [PATCH 2/2] Greatly improve E0322 explanation --- src/librustc_error_codes/error_codes/E0322.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/librustc_error_codes/error_codes/E0322.md b/src/librustc_error_codes/error_codes/E0322.md index d2ee426763e..ccef8681dd6 100644 --- a/src/librustc_error_codes/error_codes/E0322.md +++ b/src/librustc_error_codes/error_codes/E0322.md @@ -1,3 +1,13 @@ +The `Sized` trait was implemented explicitly. + +Erroneous code example: + +```compile_fail,E0322 +struct Foo; + +impl Sized for Foo {} // error! +``` + The `Sized` trait is a special trait built-in to the compiler for types with a constant size known at compile-time. This trait is automatically implemented for types as needed by the compiler, and it is currently disallowed to