@@ -274,6 +274,37 @@ let x_is_nonzero = x as bool;
274
274
```
275
275
"## ,
276
276
277
+ E0055 : r##"
278
+ During a method call, a value is automatically dereferenced as many times as
279
+ needed to make the value's type match the method's receiver. The catch is that
280
+ the compiler will only attempt to dereference a number of times up to the
281
+ recursion limit (which can be set via the `recursion_limit` attribute).
282
+
283
+ For a somewhat artificial example:
284
+
285
+ ```
286
+ #![recursion_limit="2"]
287
+
288
+ struct Foo;
289
+
290
+ impl Foo {
291
+ fn foo(&self) {}
292
+ }
293
+
294
+ fn main() {
295
+ let foo = Foo;
296
+ let ref_foo = &&Foo;
297
+
298
+ // error, reached the recursion limit while auto-dereferencing &&Foo
299
+ ref_foo.foo();
300
+ }
301
+ ```
302
+
303
+ One fix may be to increase the recursion limit. Note that it is possible to
304
+ create an infinite recursion of dereferencing, in which case the only fix is to
305
+ somehow break the recursion.
306
+ "## ,
307
+
277
308
E0062 : r##"
278
309
This error indicates that during an attempt to build a struct or struct-like
279
310
enum variant, one of the fields was specified more than once. Each field should
@@ -524,6 +555,31 @@ enum Empty {}
524
555
```
525
556
"## ,
526
557
558
+ E0089 : r##"
559
+ Not enough type parameters were supplied for a function. For example:
560
+
561
+ ```
562
+ fn foo<T, U>() {}
563
+
564
+ fn main() {
565
+ foo::<f64>(); // error, expected 2 parameters, found 1 parameter
566
+ }
567
+ ```
568
+
569
+ Note that if a function takes multiple type parameters but you want the compiler
570
+ to infer some of them, you can use type placeholders:
571
+
572
+ ```
573
+ fn foo<T, U>(x: T) {}
574
+
575
+ fn main() {
576
+ let x: bool = true;
577
+ foo::<f64>(x); // error, expected 2 parameters, found 1 parameter
578
+ foo::<_, f64>(x); // same as `foo::<bool, f64>(x)`
579
+ }
580
+ ```
581
+ "## ,
582
+
527
583
E0106 : r##"
528
584
This error indicates that a lifetime is missing from a type. If it is an error
529
585
inside a function signature, the problem may be with failing to adhere to the
@@ -678,6 +734,12 @@ it has been disabled for now.
678
734
[iss20126]: https://github.com/rust-lang/rust/issues/20126
679
735
"## ,
680
736
737
+ E0192 : r##"
738
+ Negative impls are only allowed for traits with default impls. For more
739
+ information see the [opt-in builtin traits RFC](https://github.com/rust-lang/
740
+ rfcs/blob/master/text/0019-opt-in-builtin-traits.md).
741
+ "## ,
742
+
681
743
E0197 : r##"
682
744
Inherent implementations (one that do not implement a trait but provide
683
745
methods associated with a type) are always safe because they are not
@@ -899,6 +961,12 @@ const C: [u32; u8::MAX + f64::EPSILON] = [];
899
961
```
900
962
"## ,
901
963
964
+ E0318 : r##"
965
+ Default impls for a trait must be located in the same crate where the trait was
966
+ defined. For more information see the [opt-in builtin traits RFC](https://github
967
+ .com/rust-lang/rfcs/blob/master/text/0019-opt-in-builtin-traits.md).
968
+ "## ,
969
+
902
970
E0322 : r##"
903
971
The `Sized` trait is a special trait built-in to the compiler for types with a
904
972
constant size known at compile-time. This trait is automatically implemented
@@ -989,7 +1057,6 @@ register_diagnostics! {
989
1057
E0040 , // explicit use of destructor method
990
1058
E0044 , // foreign items may not have type parameters
991
1059
E0045 , // variadic function must have C calling convention
992
- E0055 , // method has an incompatible type for trait
993
1060
E0057 , // method has an incompatible type for trait
994
1061
E0059 ,
995
1062
E0060 ,
@@ -1004,7 +1071,6 @@ register_diagnostics! {
1004
1071
E0086 ,
1005
1072
E0087 ,
1006
1073
E0088 ,
1007
- E0089 ,
1008
1074
E0090 ,
1009
1075
E0091 ,
1010
1076
E0092 ,
@@ -1044,7 +1110,6 @@ register_diagnostics! {
1044
1110
E0189 , // deprecated: can only cast a boxed pointer to a boxed object
1045
1111
E0190 , // deprecated: can only cast a &-pointer to an &-object
1046
1112
E0191 , // value of the associated type must be specified
1047
- E0192 , // negative impls are allowed just for `Send` and `Sync`
1048
1113
E0193 , // cannot bound type where clause bounds may only be attached to types
1049
1114
// involving type parameters
1050
1115
E0194 ,
@@ -1093,7 +1158,6 @@ register_diagnostics! {
1093
1158
E0246 , // illegal recursive type
1094
1159
E0247 , // found module name used as a type
1095
1160
E0248 , // found value name used as a type
1096
- E0318 , // can't create default impls for traits outside their crates
1097
1161
E0319 , // trait impls for defaulted traits allowed just for structs/enums
1098
1162
E0320 , // recursive overflow during dropck
1099
1163
E0321 , // extended coherence rules for defaulted traits violated
0 commit comments