diff options
| author | bors <bors@rust-lang.org> | 2016-11-01 23:50:05 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-11-01 23:50:05 -0700 |
| commit | 35a1fefa88849412f493ab941fb33f66c8868e95 (patch) | |
| tree | 1a6802fedf9de0eb395046243b497dfe320fb108 | |
| parent | 3fba503bf50b4a83dbc20e002b1e1e2c00fe1054 (diff) | |
| parent | 1d344cfd9f37e7864f6d50d4fa0a919326d4229d (diff) | |
Auto merge of #36131 - Florob:entry_typeck, r=eddyb
typeck: Fix error reporting of wrong entry function signatures Expected and actual type were switched, this was introduced by refactoring in 8eb12d91aaf95432ca73bda429af04e0710c984d.
| -rw-r--r-- | src/librustc_typeck/lib.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index c16dd788c4e..d636baca248 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -194,12 +194,12 @@ fn require_c_abi_if_variadic(tcx: TyCtxt, fn require_same_types<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, origin: TypeOrigin, - t1: Ty<'tcx>, - t2: Ty<'tcx>) + expected: Ty<'tcx>, + actual: Ty<'tcx>) -> bool { ccx.tcx.infer_ctxt(None, None, Reveal::NotSpecializable).enter(|infcx| { - if let Err(err) = infcx.eq_types(false, origin.clone(), t1, t2) { - infcx.report_mismatched_types(origin, t1, t2, err); + if let Err(err) = infcx.eq_types(false, origin.clone(), expected, actual) { + infcx.report_mismatched_types(origin, expected, actual, err); false } else { true @@ -248,8 +248,8 @@ fn check_main_fn_ty(ccx: &CrateCtxt, require_same_types( ccx, TypeOrigin::MainFunctionType(main_span), - main_t, - se_ty); + se_ty, + main_t); } _ => { span_bug!(main_span, @@ -303,8 +303,8 @@ fn check_start_fn_ty(ccx: &CrateCtxt, require_same_types( ccx, TypeOrigin::StartFunctionType(start_span), - start_t, - se_ty); + se_ty, + start_t); } _ => { span_bug!(start_span, |
