From 90ebf93bdfe2acdaeb504a24dea27fbfd74e3218 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 20 Feb 2020 14:26:56 +0100 Subject: [PATCH] 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 d2ee426763e7..ccef8681dd60 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