Skip to content

Commit

Permalink
=BG= Add detailed error message for E0265
Browse files Browse the repository at this point in the history
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;
```
  • Loading branch information
bguiz committed Apr 28, 2015
1 parent da2276e commit 8933253
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/librustc/diagnostics.rs
Expand Up @@ -336,6 +336,22 @@ enum Method { GET, POST }
```
"##,

E0265: r##"
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;
```
"##,

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
Expand Down Expand Up @@ -482,7 +498,6 @@ register_diagnostics! {
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
Expand Down

0 comments on commit 8933253

Please sign in to comment.