Skip to content

Commit

Permalink
Change error to E0572
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Dec 9, 2016
1 parent b1dd793 commit ed3c483
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3708,7 +3708,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
hir::ExprAgain(_) => { tcx.types.never }
hir::ExprRet(ref expr_opt) => {
if self.ret_ty.is_none() {
struct_span_err!(self.tcx.sess, expr.span, E0571,
struct_span_err!(self.tcx.sess, expr.span, E0572,
"return statement outside of function body").emit();
} else if let Some(ref e) = *expr_opt {
self.check_expr_coercable_to_type(&e, self.ret_ty.unwrap());
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_typeck/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4164,12 +4164,12 @@ target / ABI combination is currently unsupported by llvm.
If necessary, you can circumvent this check using custom target specifications.
"##,

E0571: r##"
E0572: r##"
A return statement was found outside of a function body.
Erroneous code example:
```compile_fail,E0571
```compile_fail,E0572
const FOO: u32 = return 0; // error: return statement outside of function body
fn main() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

const FOO: u32 = return 0; //~ ERROR E0571
const FOO: u32 = return 0; //~ ERROR E0572

fn main() {}

0 comments on commit ed3c483

Please sign in to comment.