mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Renamed to byte_range and changed Range generics [skip ci]
This commit is contained in:
parent
3a3ecbfae6
commit
c67ae04aca
@ -634,8 +634,8 @@ impl server::Span for Rustc<'_, '_> {
|
||||
span.source_callsite()
|
||||
}
|
||||
|
||||
fn position(&mut self, span: Self::Span) -> Range<u32> {
|
||||
Range { start: span.lo().0, end: span.hi().0 }
|
||||
fn byte_range(&mut self, span: Self::Span) -> Range<usize> {
|
||||
Range { start: span.lo().0 as usize, end: span.hi().0 as usize }
|
||||
}
|
||||
|
||||
fn start(&mut self, span: Self::Span) -> LineColumn {
|
||||
|
@ -94,7 +94,7 @@ macro_rules! with_api {
|
||||
fn source_file($self: $S::Span) -> $S::SourceFile;
|
||||
fn parent($self: $S::Span) -> Option<$S::Span>;
|
||||
fn source($self: $S::Span) -> $S::Span;
|
||||
fn position($self: $S::Span) -> Range<u32>;
|
||||
fn byte_range($self: $S::Span) -> Range<usize>;
|
||||
fn start($self: $S::Span) -> LineColumn;
|
||||
fn end($self: $S::Span) -> LineColumn;
|
||||
fn before($self: $S::Span) -> $S::Span;
|
||||
@ -295,7 +295,6 @@ mark_noop! {
|
||||
&'_ str,
|
||||
String,
|
||||
u8,
|
||||
u32,
|
||||
usize,
|
||||
Delimiter,
|
||||
LitKind,
|
||||
|
@ -490,8 +490,8 @@ impl Span {
|
||||
|
||||
/// Returns the span's byte position range in the source file.
|
||||
#[unstable(feature = "proc_macro_span", issue = "54725")]
|
||||
pub fn position(&self) -> Range<u32> {
|
||||
self.0.position()
|
||||
pub fn byte_range(&self) -> Range<usize> {
|
||||
self.0.byte_range()
|
||||
}
|
||||
|
||||
/// Gets the starting line/column in the source file for this span.
|
||||
|
@ -298,7 +298,7 @@ impl server::Span for RustAnalyzer {
|
||||
// FIXME handle span
|
||||
span
|
||||
}
|
||||
fn position(&mut self, _span: Self::Span) -> Range<u32> {
|
||||
fn byte_range(&mut self, _span: Self::Span) -> Range<usize> {
|
||||
// FIXME handle span
|
||||
Range { start: 0, end: 0 }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user