From d1658679caa789f4fec8a87a088e2cc61442472f Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 8 Jul 2015 12:57:48 +0200 Subject: [PATCH 1/3] Add E0191 error explanation --- src/librustc_typeck/diagnostics.rs | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index e2f35983eb411..54d7efdbef948 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -1550,6 +1550,30 @@ impl Foo for Bar { ``` "##, +E0191: r##" +You have to specify all the associated types. Erroneous code example: + +``` +trait Trait { + type Bar; +} + +type Foo = Trait; // error: the value of the associated type `Bar` (from + // the trait `Trait`) must be specified +``` + +Please verify you specified all associated types of the trait or that you +used the good trait. Example: + +``` +trait Trait { + type Bar; +} + +type Foo = Trait; // ok! +``` +"##, + E0192: r##" Negative impls are only allowed for traits with default impls. For more information see the [opt-in builtin traits RFC](https://github.com/rust-lang/ @@ -2074,7 +2098,6 @@ register_diagnostics! { E0188, // can not cast a immutable reference to a mutable pointer E0189, // deprecated: can only cast a boxed pointer to a boxed object E0190, // deprecated: can only cast a &-pointer to an &-object - E0191, // value of the associated type must be specified E0193, // cannot bound type where clause bounds may only be attached to types // involving type parameters E0194, From c01c1fd715bc2a61a250d53f8bc50299078c010c Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 8 Jul 2015 13:04:12 +0200 Subject: [PATCH 2/3] Add E0220 error explanation --- src/librustc_typeck/diagnostics.rs | 31 +++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index 54d7efdbef948..4f0b30bee9e9d 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -1551,7 +1551,8 @@ impl Foo for Bar { "##, E0191: r##" -You have to specify all the associated types. Erroneous code example: +Trait objects need to have all associated types specified. Erroneous code +example: ``` trait Trait { @@ -1563,7 +1564,7 @@ type Foo = Trait; // error: the value of the associated type `Bar` (from ``` Please verify you specified all associated types of the trait or that you -used the good trait. Example: +used the right trait. Example: ``` trait Trait { @@ -1855,6 +1856,31 @@ extern "rust-intrinsic" { ``` "##, +E0220: r##" +You used an associated type which isn't defined in the trait. +Erroneous code example: + +``` +trait Trait { + type Bar; +} + +type Foo = Trait; // error: associated type `F` not found for + // `Trait` +``` + +Please verify you used the good trait or you didn't mispelled the +associated type name. Example: + +``` +trait Trait { + type Bar; +} + +type Foo = Trait; // ok! +``` +"##, + E0243: r##" This error indicates that not enough type parameters were found in a type or trait. @@ -2115,7 +2141,6 @@ register_diagnostics! { E0217, // ambiguous associated type, defined in multiple supertraits E0218, // no associated type defined E0219, // associated type defined in higher-ranked supertrait - E0220, // associated type not found for type parameter E0221, // ambiguous associated type in bounds //E0222, // Error code E0045 (variadic function must have C calling // convention) duplicate From 6f01aa0fc8c7d74fb51e20444d9c51ce707a1de4 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 8 Jul 2015 14:28:14 +0200 Subject: [PATCH 3/3] Add E0232 error explanation --- src/librustc_typeck/diagnostics.rs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index 4f0b30bee9e9d..5027be5fb62a3 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -1563,7 +1563,7 @@ type Foo = Trait; // error: the value of the associated type `Bar` (from // the trait `Trait`) must be specified ``` -Please verify you specified all associated types of the trait or that you +Please verify you specified all associated types of the trait and that you used the right trait. Example: ``` @@ -1869,7 +1869,7 @@ type Foo = Trait; // error: associated type `F` not found for // `Trait` ``` -Please verify you used the good trait or you didn't mispelled the +Please verify you used the right trait or you didn't misspell the associated type name. Example: ``` @@ -1881,6 +1881,22 @@ type Foo = Trait; // ok! ``` "##, +E0232: r##" +The attribute must have a value. Erroneous code example: + +``` +#[rustc_on_unimplemented] // error: this attribute must have a value +trait Bar {} +``` + +Please supply the missing value of the attribute. Example: + +``` +#[rustc_on_unimplemented = "foo"] // ok! +trait Bar {} +``` +"##, + E0243: r##" This error indicates that not enough type parameters were found in a type or trait. @@ -2153,7 +2169,6 @@ register_diagnostics! { E0229, // associated type bindings are not allowed here E0230, // there is no type parameter on trait E0231, // only named substitution parameters are allowed - E0232, // this attribute must have a value E0233, E0234, E0235, // structure constructor specifies a structure of type but