]> git.lizzy.rs Git - rust.git/commitdiff
rollup merge of #24894: bguiz/diagnostic-E0267
authorAlex Crichton <alex@alexcrichton.com>
Wed, 29 Apr 2015 22:45:43 +0000 (15:45 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 29 Apr 2015 22:45:43 +0000 (15:45 -0700)
This error indicates that a constant references itself.
All constants need to resolve to a value in an acyclic manner.

For example, neither of the following can be sensibly compiled:

```
const X: u32 = X;
```

```
const X: u32 = Y;
const Y: u32 = X;
```

src/librustc/diagnostics.rs

index 8b43f9ada9a3385a6d00554019d608675278195c..92be6ac6be54fe707d8a5fa745945b0e73d6730d 100644 (file)
@@ -355,6 +355,22 @@ enum Method { GET, POST }
 ```
 "##,
 
+E0265: r##"
+This error indicates that a static or constant references itself.
+All statics and constants need to resolve to a value in an acyclic manner.
+
+For example, neither of the following can be sensibly compiled:
+
+```
+const X: u32 = X;
+```
+
+```
+const X: u32 = Y;
+const Y: u32 = X;
+```
+"##,
+
 E0267: r##"
 This error indicates the use of loop keyword (break or continue) inside a
 closure but outside of any loop. Break and continue can be used as normal
@@ -500,7 +516,6 @@ enum Method { GET, POST }
     E0262, // illegal lifetime parameter name
     E0263, // lifetime name declared twice in same scope
     E0264, // unknown external lang item
-    E0265, // recursive constant
     E0266, // expected item
     E0269, // not all control paths return a value
     E0270, // computation may converge in a function marked as diverging