File tree Expand file tree Collapse file tree 3 files changed +38
-4
lines changed Expand file tree Collapse file tree 3 files changed +38
-4
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
8
8
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
9
9
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
10
10
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11
- refs/heads/auto: b7e41d9aeaade8a42ee9e71de34fdf2d982c664f
11
+ refs/heads/auto: 7b4eb1aa90e49f6d068052b6e2baa5f59336ee13
12
12
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
13
13
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
14
14
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1
Original file line number Diff line number Diff line change @@ -1018,7 +1018,7 @@ const foo: i32 = 42;
1018
1018
const baz: *const i32 = (&foo as *const i32);
1019
1019
1020
1020
const deref: i32 = *baz;
1021
- // error: raw pointers cannot be dereferenced in constants!
1021
+ // error: raw pointers cannot be dereferenced in constants
1022
1022
```
1023
1023
1024
1024
To fix this error, please do not assign this value to a constant expression.
Original file line number Diff line number Diff line change @@ -1457,6 +1457,42 @@ impl Foo for Bar {
1457
1457
```
1458
1458
"## ,
1459
1459
1460
+ E0327 : r##"
1461
+ You cannot use associated items other than constant items as patterns. This
1462
+ includes method items. Example of erroneous code:
1463
+
1464
+ ```
1465
+ enum B {}
1466
+
1467
+ impl B {
1468
+ fn bb() -> i32 { 0 }
1469
+ }
1470
+
1471
+ fn main() {
1472
+ match 0 {
1473
+ B::bb => {} // error: associated items in match patterns must
1474
+ // be constants
1475
+ }
1476
+ }
1477
+ ```
1478
+
1479
+ Please check that you're not using a method as a pattern. Example:
1480
+
1481
+ ```
1482
+ enum B {
1483
+ ba,
1484
+ bb
1485
+ }
1486
+
1487
+ fn main() {
1488
+ match B::ba {
1489
+ B::bb => {} // ok!
1490
+ _ => {}
1491
+ }
1492
+ }
1493
+ ```
1494
+ "## ,
1495
+
1460
1496
E0368 : r##"
1461
1497
This error indicates that a binary assignment operator like `+=` or `^=` was
1462
1498
applied to the wrong types. For example:
@@ -1540,7 +1576,6 @@ For more information see the [opt-in builtin traits RFC](https://github.com/rust
1540
1576
1541
1577
}
1542
1578
1543
-
1544
1579
register_diagnostics ! {
1545
1580
E0068 ,
1546
1581
E0074 ,
@@ -1640,7 +1675,6 @@ register_diagnostics! {
1640
1675
E0323 , // implemented an associated const when another trait item expected
1641
1676
E0324 , // implemented a method when another trait item expected
1642
1677
E0325 , // implemented an associated type when another trait item expected
1643
- E0327 , // referred to method instead of constant in match pattern
1644
1678
E0328 , // cannot implement Unsize explicitly
1645
1679
E0329 , // associated const depends on type parameter or Self.
1646
1680
E0366 , // dropck forbid specialization to concrete type or region
You can’t perform that action at this time.
0 commit comments