move E0744 to new error code

This commit is contained in:
Guillaume Gomez 2019-11-14 00:26:16 +01:00
parent 27b58edc23
commit bfa3d599eb
3 changed files with 19 additions and 0 deletions

View File

@ -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

View 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
};
```

View File

@ -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;