@@ -189,7 +189,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
189189 self ,
190190 region : ty:: Region < ' tcx > ,
191191 ) -> ( String , Option < Span > ) {
192- let cm = self . sess . codemap ( ) ;
192+ let cm = self . sess . source_map ( ) ;
193193
194194 let scope = region. free_region_binding_scope ( self ) ;
195195 let node = self . hir . as_local_node_id ( scope) . unwrap_or ( DUMMY_NODE_ID ) ;
@@ -286,7 +286,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
286286 }
287287
288288 fn explain_span ( self , heading : & str , span : Span ) -> ( String , Option < Span > ) {
289- let lo = self . sess . codemap ( ) . lookup_char_pos_adj ( span. lo ( ) ) ;
289+ let lo = self . sess . source_map ( ) . lookup_char_pos_adj ( span. lo ( ) ) ;
290290 (
291291 format ! ( "the {} at {}:{}" , heading, lo. line, lo. col. to_usize( ) + 1 ) ,
292292 Some ( span) ,
@@ -502,14 +502,14 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
502502 ObligationCauseCode :: MatchExpressionArm { arm_span, source } => match source {
503503 hir:: MatchSource :: IfLetDesugar { .. } => {
504504 let msg = "`if let` arm with an incompatible type" ;
505- if self . tcx . sess . codemap ( ) . is_multiline ( arm_span) {
505+ if self . tcx . sess . source_map ( ) . is_multiline ( arm_span) {
506506 err. span_note ( arm_span, msg) ;
507507 } else {
508508 err. span_label ( arm_span, msg) ;
509509 }
510510 } ,
511511 hir:: MatchSource :: TryDesugar => { // Issue #51632
512- if let Ok ( try_snippet) = self . tcx . sess . codemap ( ) . span_to_snippet ( arm_span) {
512+ if let Ok ( try_snippet) = self . tcx . sess . source_map ( ) . span_to_snippet ( arm_span) {
513513 err. span_suggestion_with_applicability (
514514 arm_span,
515515 "try wrapping with a success variant" ,
@@ -520,7 +520,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
520520 } ,
521521 _ => {
522522 let msg = "match arm with an incompatible type" ;
523- if self . tcx . sess . codemap ( ) . is_multiline ( arm_span) {
523+ if self . tcx . sess . source_map ( ) . is_multiline ( arm_span) {
524524 err. span_note ( arm_span, msg) ;
525525 } else {
526526 err. span_label ( arm_span, msg) ;
@@ -1136,8 +1136,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
11361136 let sp = if has_bounds {
11371137 sp. to ( self . tcx
11381138 . sess
1139- . codemap ( )
1140- . next_point ( self . tcx . sess . codemap ( ) . next_point ( sp) ) )
1139+ . source_map ( )
1140+ . next_point ( self . tcx . sess . source_map ( ) . next_point ( sp) ) )
11411141 } else {
11421142 sp
11431143 } ;
0 commit comments