From 58be3c7f36ebdbf8563d15cf9144586d22083c97 Mon Sep 17 00:00:00 2001 From: Liigo Zhuang Date: Thu, 25 Jun 2015 17:08:27 +0800 Subject: [PATCH] core: rustc: improve compile message for unsized types --- src/libcore/marker.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs index c0956753c988c..b97ae4862911d 100644 --- a/src/libcore/marker.rs +++ b/src/libcore/marker.rs @@ -47,7 +47,8 @@ impl !Send for *mut T { } /// Types with a constant size known at compile-time. #[stable(feature = "rust1", since = "1.0.0")] #[lang = "sized"] -#[rustc_on_unimplemented = "`{Self}` does not have a constant size known at compile-time"] +#[rustc_on_unimplemented = "`{Self}` does not have a constant size known at compile-time. \ + Try to use `&{Self}` or `Box<{Self}>`?"] #[fundamental] // for Default, for example, which requires that `[T]: !Default` be evaluatable pub trait Sized { // Empty.