@@ -170,6 +170,31 @@ Reference:
170
170
http://doc.rust-lang.org/reference.html#trait-objects
171
171
"## ,
172
172
173
+ E0040 : r##"
174
+ It is not allowed to manually call destructors in Rust. It is also not
175
+ necessary to do this since `drop` is called automatically whenever a value goes
176
+ out of scope.
177
+
178
+ Here's an example of this error:
179
+
180
+ ```
181
+ struct Foo {
182
+ x: i32,
183
+ }
184
+
185
+ impl Drop for Foo {
186
+ fn drop(&mut self) {
187
+ println!("kaboom");
188
+ }
189
+ }
190
+
191
+ fn main() {
192
+ let mut x = Foo { x: -7 };
193
+ x.drop(); // error: explicit use of destructor method
194
+ }
195
+ ```
196
+ "## ,
197
+
173
198
E0046 : r##"
174
199
When trying to make some type implement a trait `Foo`, you must, at minimum,
175
200
provide implementations for all of `Foo`'s required methods (meaning the
@@ -241,7 +266,7 @@ impl Foo for Bar {
241
266
fn foo(x: i16) { }
242
267
243
268
// error, values differ in mutability
244
- fn foo (&mut self) { }
269
+ fn bar (&mut self) { }
245
270
}
246
271
```
247
272
"## ,
@@ -542,6 +567,21 @@ enum Empty {}
542
567
```
543
568
"## ,
544
569
570
+ E0087 : r##"
571
+ Too many type parameters were supplied for a function. For example:
572
+
573
+ ```
574
+ fn foo<T>() {}
575
+
576
+ fn main() {
577
+ foo::<f64, bool>(); // error, expected 1 parameter, found 2 parameters
578
+ }
579
+ ```
580
+
581
+ The number of supplied parameters much exactly match the number of defined type
582
+ parameters.
583
+ "## ,
584
+
545
585
E0089 : r##"
546
586
Not enough type parameters were supplied for a function. For example:
547
587
@@ -1098,6 +1138,13 @@ Trait2 { ... }`) does not work if the trait is not object-safe. Please see the
1098
1138
[RFC 255]: https://github.com/rust-lang/rfcs/pull/255
1099
1139
"## ,
1100
1140
1141
+ E0379 : r##"
1142
+ Trait methods cannot be declared `const` by design. For more information, see
1143
+ [RFC 911].
1144
+
1145
+ [RFC 911]: https://github.com/rust-lang/rfcs/pull/911
1146
+ "## ,
1147
+
1101
1148
E0380 : r##"
1102
1149
Default impls are only allowed for traits with no methods or associated items.
1103
1150
For more information see the [opt-in builtin traits RFC](https://github.com/rust
@@ -1113,7 +1160,6 @@ register_diagnostics! {
1113
1160
E0034 , // multiple applicable methods in scope
1114
1161
E0035 , // does not take type parameters
1115
1162
E0036 , // incorrect number of type parameters given for this method
1116
- E0040 , // explicit use of destructor method
1117
1163
E0044 , // foreign items may not have type parameters
1118
1164
E0045 , // variadic function must have C calling convention
1119
1165
E0057 , // method has an incompatible type for trait
@@ -1128,7 +1174,6 @@ register_diagnostics! {
1128
1174
E0077 ,
1129
1175
E0085 ,
1130
1176
E0086 ,
1131
- E0087 ,
1132
1177
E0088 ,
1133
1178
E0090 ,
1134
1179
E0091 ,
@@ -1235,7 +1280,6 @@ register_diagnostics! {
1235
1280
// between structures
1236
1281
E0377 , // the trait `CoerceUnsized` may only be implemented for a coercion
1237
1282
// between structures with the same definition
1238
- E0379 , // trait fns cannot be const
1239
1283
E0390 , // only a single inherent implementation marked with
1240
1284
// `#[lang = \"{}\"]` is allowed for the `{}` primitive
1241
1285
E0391 , // unsupported cyclic reference between types/traits detected
0 commit comments