@@ -348,13 +348,13 @@ impl Span {
348
348
/// Gets the starting line/column in the source file for this span.
349
349
#[ unstable( feature = "proc_macro_span" , issue = "54725" ) ]
350
350
pub fn start ( & self ) -> LineColumn {
351
- self . 0 . start ( )
351
+ self . 0 . start ( ) . add_1_to_column ( )
352
352
}
353
353
354
354
/// Gets the ending line/column in the source file for this span.
355
355
#[ unstable( feature = "proc_macro_span" , issue = "54725" ) ]
356
356
pub fn end ( & self ) -> LineColumn {
357
- self . 0 . end ( )
357
+ self . 0 . end ( ) . add_1_to_column ( )
358
358
}
359
359
360
360
/// Creates a new span encompassing `self` and `other`.
@@ -432,12 +432,18 @@ pub struct LineColumn {
432
432
/// The 1-indexed line in the source file on which the span starts or ends (inclusive).
433
433
#[ unstable( feature = "proc_macro_span" , issue = "54725" ) ]
434
434
pub line : usize ,
435
- /// The 0 -indexed column (in UTF-8 characters) in the source file on which
435
+ /// The 1 -indexed column (in UTF-8 characters) in the source file on which
436
436
/// the span starts or ends (inclusive).
437
437
#[ unstable( feature = "proc_macro_span" , issue = "54725" ) ]
438
438
pub column : usize ,
439
439
}
440
440
441
+ impl LineColumn {
442
+ fn add_1_to_column ( self ) -> Self {
443
+ LineColumn { line : self . line , column : self . column + 1 }
444
+ }
445
+ }
446
+
441
447
#[ unstable( feature = "proc_macro_span" , issue = "54725" ) ]
442
448
impl !Send for LineColumn { }
443
449
#[ unstable( feature = "proc_macro_span" , issue = "54725" ) ]
0 commit comments