@@ -194,7 +194,7 @@ a guard.
194
194
```compile_fail,E0029
195
195
let string = "salutations !";
196
196
197
- // The ordering relation for strings can't be evaluated at compile time,
197
+ // The ordering relation for strings cannot be evaluated at compile time,
198
198
// so this doesn't work:
199
199
match string {
200
200
"hello" ..= "world" => {}
@@ -348,7 +348,7 @@ fn main() {
348
348
"## ,
349
349
350
350
E0044 : r##"
351
- You can't use type or const parameters on foreign items.
351
+ You cannot use type or const parameters on foreign items.
352
352
Example of erroneous code:
353
353
354
354
```compile_fail,E0044
@@ -788,7 +788,7 @@ fn some_other_func() {}
788
788
fn some_function() {
789
789
SOME_CONST = 14; // error : a constant value cannot be changed!
790
790
1 = 3; // error : 1 isn't a valid place!
791
- some_other_func() = 4; // error : we can't assign value to a function!
791
+ some_other_func() = 4; // error : we cannot assign value to a function!
792
792
SomeStruct.x = 12; // error : SomeStruct a structure name but it is used
793
793
// like a variable!
794
794
}
@@ -3891,6 +3891,33 @@ details.
3891
3891
[issue #33685]: https://github.com/rust-lang/rust/issues/33685
3892
3892
"## ,
3893
3893
3894
+ E0588 : r##"
3895
+ A type with `packed` representation hint has a field with `align`
3896
+ representation hint.
3897
+
3898
+ Erroneous code example:
3899
+
3900
+ ```compile_fail,E0588
3901
+ #[repr(align(16))]
3902
+ struct Aligned(i32);
3903
+
3904
+ #[repr(packed)] // error!
3905
+ struct Packed(Aligned);
3906
+ ```
3907
+
3908
+ Just like you cannot have both `align` and `packed` representation hints on a
3909
+ same type, a `packed` type cannot contain another type with the `align`
3910
+ representation hint. However, you can do the opposite:
3911
+
3912
+ ```
3913
+ #[repr(packed)]
3914
+ struct Packed(i32);
3915
+
3916
+ #[repr(align(16))] // ok!
3917
+ struct Aligned(Packed);
3918
+ ```
3919
+ "## ,
3920
+
3894
3921
E0592 : r##"
3895
3922
This error occurs when you defined methods or associated functions with same
3896
3923
name.
@@ -4299,7 +4326,7 @@ extern {
4299
4326
4300
4327
unsafe {
4301
4328
printf(::std::ptr::null(), 0f32);
4302
- // error: can't pass an `f32` to variadic function, cast to `c_double`
4329
+ // error: cannot pass an `f32` to variadic function, cast to `c_double`
4303
4330
}
4304
4331
```
4305
4332
@@ -5000,7 +5027,7 @@ the future, [RFC 2091] prohibits their implementation without a follow-up RFC.
5000
5027
// E0174,
5001
5028
// E0182, // merged into E0229
5002
5029
E0183 ,
5003
- // E0187, // can't infer the kind of the closure
5030
+ // E0187, // cannot infer the kind of the closure
5004
5031
// E0188, // can not cast an immutable reference to a mutable pointer
5005
5032
// E0189, // deprecated: can only cast a boxed pointer to a boxed object
5006
5033
// E0190, // deprecated: can only cast a &-pointer to an &-object
@@ -5047,7 +5074,6 @@ the future, [RFC 2091] prohibits their implementation without a follow-up RFC.
5047
5074
// E0564, // only named lifetimes are allowed in `impl Trait`,
5048
5075
// but `{}` was found in the type `{}`
5049
5076
E0587 , // type has conflicting packed and align representation hints
5050
- E0588 , // packed type cannot transitively contain a `[repr(align)]` type
5051
5077
// E0611, // merged into E0616
5052
5078
// E0612, // merged into E0609
5053
5079
// E0613, // Removed (merged with E0609)
0 commit comments