@@ -261,6 +261,37 @@ let x_is_nonzero = x as bool;
261
261
```
262
262
"## ,
263
263
264
+ E0055 : r##"
265
+ During a method call, a value is automatically dereferenced as many times as
266
+ needed to make the value's type match the method's receiver. The catch is that
267
+ the compiler will only attempt to dereference a number of times up to the
268
+ recursion limit (which can be set via the `recursion_limit` attribute).
269
+
270
+ For a somewhat artificial example:
271
+
272
+ ```
273
+ #![recursion_limit="2"]
274
+
275
+ struct Foo;
276
+
277
+ impl Foo {
278
+ fn foo(&self) {}
279
+ }
280
+
281
+ fn main() {
282
+ let foo = Foo;
283
+ let ref_foo = &&Foo;
284
+
285
+ // error, reached the recursion limit while auto-dereferencing &&Foo
286
+ ref_foo.foo();
287
+ }
288
+ ```
289
+
290
+ One fix may be to increase the recursion limit. Note that it is possible to
291
+ create an infinite recursion of dereferencing, in which case the only fix is to
292
+ somehow break the recursion.
293
+ "## ,
294
+
264
295
E0062 : r##"
265
296
This error indicates that during an attempt to build a struct or struct-like
266
297
enum variant, one of the fields was specified more than once. Each field should
@@ -511,6 +542,31 @@ enum Empty {}
511
542
```
512
543
"## ,
513
544
545
+ E0089 : r##"
546
+ Not enough type parameters were supplied for a function. For example:
547
+
548
+ ```
549
+ fn foo<T, U>() {}
550
+
551
+ fn main() {
552
+ foo::<f64>(); // error, expected 2 parameters, found 1 parameter
553
+ }
554
+ ```
555
+
556
+ Note that if a function takes multiple type parameters but you want the compiler
557
+ to infer some of them, you can use type placeholders:
558
+
559
+ ```
560
+ fn foo<T, U>(x: T) {}
561
+
562
+ fn main() {
563
+ let x: bool = true;
564
+ foo::<f64>(x); // error, expected 2 parameters, found 1 parameter
565
+ foo::<_, f64>(x); // same as `foo::<bool, f64>(x)`
566
+ }
567
+ ```
568
+ "## ,
569
+
514
570
E0106 : r##"
515
571
This error indicates that a lifetime is missing from a type. If it is an error
516
572
inside a function signature, the problem may be with failing to adhere to the
@@ -707,6 +763,12 @@ impl Foo for Bar {
707
763
}
708
764
"## ,
709
765
766
+ E0192 : r##"
767
+ Negative impls are only allowed for traits with default impls. For more
768
+ information see the [opt-in builtin traits RFC](https://github.com/rust-lang/
769
+ rfcs/blob/master/text/0019-opt-in-builtin-traits.md).
770
+ "## ,
771
+
710
772
E0197 : r##"
711
773
Inherent implementations (one that do not implement a trait but provide
712
774
methods associated with a type) are always safe because they are not
@@ -936,6 +998,12 @@ const C: [u32; u8::MAX + f64::EPSILON] = [];
936
998
```
937
999
"## ,
938
1000
1001
+ E0318 : r##"
1002
+ Default impls for a trait must be located in the same crate where the trait was
1003
+ defined. For more information see the [opt-in builtin traits RFC](https://github
1004
+ .com/rust-lang/rfcs/blob/master/text/0019-opt-in-builtin-traits.md).
1005
+ "## ,
1006
+
939
1007
E0322 : r##"
940
1008
The `Sized` trait is a special trait built-in to the compiler for types with a
941
1009
constant size known at compile-time. This trait is automatically implemented
@@ -1045,7 +1113,6 @@ register_diagnostics! {
1045
1113
E0040 , // explicit use of destructor method
1046
1114
E0044 , // foreign items may not have type parameters
1047
1115
E0045 , // variadic function must have C calling convention
1048
- E0055 , // method has an incompatible type for trait
1049
1116
E0057 , // method has an incompatible type for trait
1050
1117
E0059 ,
1051
1118
E0060 ,
@@ -1060,7 +1127,6 @@ register_diagnostics! {
1060
1127
E0086 ,
1061
1128
E0087 ,
1062
1129
E0088 ,
1063
- E0089 ,
1064
1130
E0090 ,
1065
1131
E0091 ,
1066
1132
E0092 ,
@@ -1098,7 +1164,6 @@ register_diagnostics! {
1098
1164
E0189 , // deprecated: can only cast a boxed pointer to a boxed object
1099
1165
E0190 , // deprecated: can only cast a &-pointer to an &-object
1100
1166
E0191 , // value of the associated type must be specified
1101
- E0192 , // negative impls are allowed just for `Send` and `Sync`
1102
1167
E0193 , // cannot bound type where clause bounds may only be attached to types
1103
1168
// involving type parameters
1104
1169
E0194 ,
@@ -1146,7 +1211,6 @@ register_diagnostics! {
1146
1211
E0246 , // illegal recursive type
1147
1212
E0247 , // found module name used as a type
1148
1213
E0248 , // found value name used as a type
1149
- E0318 , // can't create default impls for traits outside their crates
1150
1214
E0319 , // trait impls for defaulted traits allowed just for structs/enums
1151
1215
E0320 , // recursive overflow during dropck
1152
1216
E0321 , // extended coherence rules for defaulted traits violated
0 commit comments