Skip to content

Commit ed3c483

Browse files
Change error to E0572
1 parent b1dd793 commit ed3c483

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/librustc_typeck/check/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3708,7 +3708,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
37083708
hir::ExprAgain(_) => { tcx.types.never }
37093709
hir::ExprRet(ref expr_opt) => {
37103710
if self.ret_ty.is_none() {
3711-
struct_span_err!(self.tcx.sess, expr.span, E0571,
3711+
struct_span_err!(self.tcx.sess, expr.span, E0572,
37123712
"return statement outside of function body").emit();
37133713
} else if let Some(ref e) = *expr_opt {
37143714
self.check_expr_coercable_to_type(&e, self.ret_ty.unwrap());

src/librustc_typeck/diagnostics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4164,12 +4164,12 @@ target / ABI combination is currently unsupported by llvm.
41644164
If necessary, you can circumvent this check using custom target specifications.
41654165
"##,
41664166

4167-
E0571: r##"
4167+
E0572: r##"
41684168
A return statement was found outside of a function body.
41694169
41704170
Erroneous code example:
41714171
4172-
```compile_fail,E0571
4172+
```compile_fail,E0572
41734173
const FOO: u32 = return 0; // error: return statement outside of function body
41744174
41754175
fn main() {}

src/test/compile-fail/E0571.rs renamed to src/test/compile-fail/E0572.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
const FOO: u32 = return 0; //~ ERROR E0571
11+
const FOO: u32 = return 0; //~ ERROR E0572
1212

1313
fn main() {}

0 commit comments

Comments
 (0)