From 5460650eeccb0d8925b36480d0ccd7db31a757d8 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 4 Jul 2015 18:35:21 +0200 Subject: [PATCH] Remove E0134 and E0135 error explanation --- src/librustc/diagnostics.rs | 36 ------------------------------ src/librustc_typeck/diagnostics.rs | 21 +++++++++++------ 2 files changed, 14 insertions(+), 43 deletions(-) diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs index d616b4f90b8..eb504d03209 100644 --- a/src/librustc/diagnostics.rs +++ b/src/librustc/diagnostics.rs @@ -411,42 +411,6 @@ fn main() { See also https://doc.rust-lang.org/book/unsafe.html "##, -E0134: r##" -You tried to modify the str type, which isn't allowed. Erroneous code -example: - -``` -let s = "salut"; -let c = &mut s[0..1]; // error: modification of string types is not - // allowed -``` - -I you want to modify an str, please use the String type. Example: - -``` -let mut s = "salut"; -let mut c = s[0..1].to_owned(); // ok! -``` -"##, - -E0135: r##" -You tried to modify the str type, which isn't allowed. Erroneous code -example: - -``` -let s = "salut"; -let c = &mut (*s)[0..1]; // error: modification of string types is not - // allowed -``` - -If you want to modify an str, please use the String type. Example: - -``` -let mut s = "salut"; -let mut c = s[0..1].to_owned(); // ok! -``` -"##, - E0137: r##" This error indicates that the compiler found multiple functions with the `#[main]` attribute. This is an error because there must be a unique entry diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index 96637058225..a1fa4218e70 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -1369,23 +1369,30 @@ struct Foo { "##, E0128: r##" -You declared a type parameter with a default which has the same identifier as -the type parameter. Erroneous code example: +Type parameter defaults can only use parameters that occur before them. +Erroneous code example: ``` -pub struct Foo; +pub struct Foo { + field1: T, + filed2: U, +} // error: type parameters with a default cannot use forward declared // identifiers ``` -Please verify that a name clash hasn't been accidentally introduced, and rename -the type parameter if so. Example: +Since type parameters are evaluated in-order, you may be able to fix this issue +by doing: ``` -pub struct Foo { - value: T +pub struct Foo { + field1: T, + filed2: U, } ``` + +Please also verify that this wasn't because of a name-clash and rename the type +parameter if so. "##, E0130: r##"