Skip to content

Commit c2bfb9c

Browse files
committed
Auto merge of #24894 - bguiz:diagnostic-E0267, r=alexcrichton
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; ```
2 parents 26c7635 + 1335be3 commit c2bfb9c

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/librustc/diagnostics.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,22 @@ enum Method { GET, POST }
355355
```
356356
"##,
357357

358+
E0265: r##"
359+
This error indicates that a static or constant references itself.
360+
All statics and constants need to resolve to a value in an acyclic manner.
361+
362+
For example, neither of the following can be sensibly compiled:
363+
364+
```
365+
const X: u32 = X;
366+
```
367+
368+
```
369+
const X: u32 = Y;
370+
const Y: u32 = X;
371+
```
372+
"##,
373+
358374
E0267: r##"
359375
This error indicates the use of loop keyword (break or continue) inside a
360376
closure but outside of any loop. Break and continue can be used as normal
@@ -500,7 +516,6 @@ register_diagnostics! {
500516
E0262, // illegal lifetime parameter name
501517
E0263, // lifetime name declared twice in same scope
502518
E0264, // unknown external lang item
503-
E0265, // recursive constant
504519
E0266, // expected item
505520
E0269, // not all control paths return a value
506521
E0270, // computation may converge in a function marked as diverging

0 commit comments

Comments
 (0)