diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2020-03-09 11:42:37 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2020-03-25 16:45:12 -0700 |
| commit | f18a6dcec0b7e638f228dacc2ab2c5f8ea84cb1f (patch) | |
| tree | d26428195d586a465283aa8c425eed4cb9692b25 /src/librustc | |
| parent | 3c1d9adb3cb3aad4233075fa296fc3c70b42cdb8 (diff) | |
| download | rust-f18a6dcec0b7e638f228dacc2ab2c5f8ea84cb1f.tar.gz rust-f18a6dcec0b7e638f228dacc2ab2c5f8ea84cb1f.zip | |
Rename `def_span` to `guess_head_span`
Diffstat (limited to 'src/librustc')
| -rw-r--r-- | src/librustc/traits/mod.rs | 4 | ||||
| -rw-r--r-- | src/librustc/ty/query/plumbing.rs | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/librustc/traits/mod.rs b/src/librustc/traits/mod.rs index 6ebcc8b0754..c129b574fd3 100644 --- a/src/librustc/traits/mod.rs +++ b/src/librustc/traits/mod.rs @@ -108,7 +108,9 @@ impl<'tcx> ObligationCause<'tcx> { match self.code { ObligationCauseCode::CompareImplMethodObligation { .. } | ObligationCauseCode::MainFunctionType - | ObligationCauseCode::StartFunctionType => tcx.sess.source_map().def_span(self.span), + | ObligationCauseCode::StartFunctionType => { + tcx.sess.source_map().guess_head_span(self.span) + } ObligationCauseCode::MatchExpressionArm(box MatchExpressionArmCause { arm_span, .. diff --git a/src/librustc/ty/query/plumbing.rs b/src/librustc/ty/query/plumbing.rs index 69bcc934155..c0cc119c5a1 100644 --- a/src/librustc/ty/query/plumbing.rs +++ b/src/librustc/ty/query/plumbing.rs @@ -388,7 +388,7 @@ impl<'tcx> TyCtxt<'tcx> { assert!(!stack.is_empty()); let fix_span = |span: Span, query: &Query<'tcx>| { - self.sess.source_map().def_span(query.default_span(self, span)) + self.sess.source_map().guess_head_span(query.default_span(self, span)) }; // Disable naming impls with types in this path, since that @@ -456,7 +456,8 @@ impl<'tcx> TyCtxt<'tcx> { query_info.info.query.describe(icx.tcx) ), ); - diag.span = icx.tcx.sess.source_map().def_span(query_info.info.span).into(); + diag.span = + icx.tcx.sess.source_map().guess_head_span(query_info.info.span).into(); handler.force_print_diagnostic(diag); current_query = query_info.job.parent; |
