move E0744 to new error code
This commit is contained in:
parent
27b58edc23
commit
bfa3d599eb
@ -401,6 +401,7 @@
|
|||||||
E0741: include_str!("./error_codes/E0741.md"),
|
E0741: include_str!("./error_codes/E0741.md"),
|
||||||
E0742: include_str!("./error_codes/E0742.md"),
|
E0742: include_str!("./error_codes/E0742.md"),
|
||||||
E0743: include_str!("./error_codes/E0743.md"),
|
E0743: include_str!("./error_codes/E0743.md"),
|
||||||
|
E0744: include_str!("./error_codes/E0744.md"),
|
||||||
;
|
;
|
||||||
// E0006, // merged with E0005
|
// E0006, // merged with E0005
|
||||||
// E0008, // cannot bind by-move into a pattern guard
|
// E0008, // cannot bind by-move into a pattern guard
|
||||||
|
17
src/librustc_error_codes/error_codes/E0744.md
Normal file
17
src/librustc_error_codes/error_codes/E0744.md
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
Control-flow expressions are not allowed inside a const context.
|
||||||
|
|
||||||
|
At the moment, `if` and `match`, as well as the looping constructs `for`,
|
||||||
|
`while`, and `loop`, are forbidden inside a `const`, `static`, or `const fn`.
|
||||||
|
|
||||||
|
```compile_fail,E0744
|
||||||
|
const _: i32 = {
|
||||||
|
let mut x = 0;
|
||||||
|
loop {
|
||||||
|
x += 1;
|
||||||
|
if x == 4 {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
x
|
||||||
|
};
|
||||||
|
```
|
@ -17,6 +17,7 @@
|
|||||||
use syntax::ast::Mutability;
|
use syntax::ast::Mutability;
|
||||||
use syntax::span_err;
|
use syntax::span_err;
|
||||||
use syntax_pos::Span;
|
use syntax_pos::Span;
|
||||||
|
use rustc_error_codes::*;
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user