diff options
| author | ljedrz <ljedrz@gmail.com> | 2018-10-02 11:00:11 +0200 |
|---|---|---|
| committer | ljedrz <ljedrz@gmail.com> | 2018-10-03 09:04:02 +0200 |
| commit | db171649d3e2298859740d164f92e99c8bd3cf4b (patch) | |
| tree | 29e95c356fcd800cb7d09c939a5f5dff41df63d1 | |
| parent | 774881d78ef39069df2374586e28d1eb82507fe1 (diff) | |
rustc/ty: calculate span after a possible early continue
| -rw-r--r-- | src/librustc/ty/util.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc/ty/util.rs b/src/librustc/ty/util.rs index 4e2c9cceab6..e4141211a4f 100644 --- a/src/librustc/ty/util.rs +++ b/src/librustc/ty/util.rs @@ -205,11 +205,11 @@ impl<'tcx> ty::ParamEnv<'tcx> { let mut infringing = Vec::new(); for variant in &adt.variants { for field in &variant.fields { - let span = tcx.def_span(field.did); let ty = field.ty(tcx, substs); if ty.references_error() { continue; } + let span = tcx.def_span(field.did); let cause = ObligationCause { span, ..ObligationCause::dummy() }; let ctx = traits::FulfillmentContext::new(); match traits::fully_normalize(&infcx, ctx, cause, self, &ty) { |
