Skip to content

Commit c60814a

Browse files
Renamed to byte_range and changed Range generics [skip ci]
1 parent 4f8e85e commit c60814a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

proc_macro/src/bridge/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ macro_rules! with_api {
9494
fn source_file($self: $S::Span) -> $S::SourceFile;
9595
fn parent($self: $S::Span) -> Option<$S::Span>;
9696
fn source($self: $S::Span) -> $S::Span;
97-
fn position($self: $S::Span) -> Range<u32>;
97+
fn byte_range($self: $S::Span) -> Range<usize>;
9898
fn start($self: $S::Span) -> LineColumn;
9999
fn end($self: $S::Span) -> LineColumn;
100100
fn before($self: $S::Span) -> $S::Span;
@@ -295,7 +295,6 @@ mark_noop! {
295295
&'_ str,
296296
String,
297297
u8,
298-
u32,
299298
usize,
300299
Delimiter,
301300
LitKind,

proc_macro/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,8 @@ impl Span {
490490

491491
/// Returns the span's byte position range in the source file.
492492
#[unstable(feature = "proc_macro_span", issue = "54725")]
493-
pub fn position(&self) -> Range<u32> {
494-
self.0.position()
493+
pub fn byte_range(&self) -> Range<usize> {
494+
self.0.byte_range()
495495
}
496496

497497
/// Gets the starting line/column in the source file for this span.

0 commit comments

Comments
 (0)