mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Span::{before, after}
→ Span::{start, end}
This commit is contained in:
parent
dc76991d2f
commit
87ec0738ab
@ -648,11 +648,11 @@ impl server::Span for Rustc<'_, '_> {
|
|||||||
|
|
||||||
Range { start: relative_start_pos.0 as usize, end: relative_end_pos.0 as usize }
|
Range { start: relative_start_pos.0 as usize, end: relative_end_pos.0 as usize }
|
||||||
}
|
}
|
||||||
fn before(&mut self, span: Self::Span) -> Self::Span {
|
fn start(&mut self, span: Self::Span) -> Self::Span {
|
||||||
span.shrink_to_lo()
|
span.shrink_to_lo()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn after(&mut self, span: Self::Span) -> Self::Span {
|
fn end(&mut self, span: Self::Span) -> Self::Span {
|
||||||
span.shrink_to_hi()
|
span.shrink_to_hi()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,8 +95,8 @@ macro_rules! with_api {
|
|||||||
fn parent($self: $S::Span) -> Option<$S::Span>;
|
fn parent($self: $S::Span) -> Option<$S::Span>;
|
||||||
fn source($self: $S::Span) -> $S::Span;
|
fn source($self: $S::Span) -> $S::Span;
|
||||||
fn byte_range($self: $S::Span) -> Range<usize>;
|
fn byte_range($self: $S::Span) -> Range<usize>;
|
||||||
fn before($self: $S::Span) -> $S::Span;
|
fn start($self: $S::Span) -> $S::Span;
|
||||||
fn after($self: $S::Span) -> $S::Span;
|
fn end($self: $S::Span) -> $S::Span;
|
||||||
fn join($self: $S::Span, other: $S::Span) -> Option<$S::Span>;
|
fn join($self: $S::Span, other: $S::Span) -> Option<$S::Span>;
|
||||||
fn subspan($self: $S::Span, start: Bound<usize>, end: Bound<usize>) -> Option<$S::Span>;
|
fn subspan($self: $S::Span, start: Bound<usize>, end: Bound<usize>) -> Option<$S::Span>;
|
||||||
fn resolved_at($self: $S::Span, at: $S::Span) -> $S::Span;
|
fn resolved_at($self: $S::Span, at: $S::Span) -> $S::Span;
|
||||||
|
@ -495,14 +495,14 @@ impl Span {
|
|||||||
|
|
||||||
/// Creates an empty span pointing to directly before this span.
|
/// Creates an empty span pointing to directly before this span.
|
||||||
#[unstable(feature = "proc_macro_span_shrink", issue = "87552")]
|
#[unstable(feature = "proc_macro_span_shrink", issue = "87552")]
|
||||||
pub fn before(&self) -> Span {
|
pub fn start(&self) -> Span {
|
||||||
Span(self.0.before())
|
Span(self.0.start())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates an empty span pointing to directly after this span.
|
/// Creates an empty span pointing to directly after this span.
|
||||||
#[unstable(feature = "proc_macro_span_shrink", issue = "87552")]
|
#[unstable(feature = "proc_macro_span_shrink", issue = "87552")]
|
||||||
pub fn after(&self) -> Span {
|
pub fn end(&self) -> Span {
|
||||||
Span(self.0.after())
|
Span(self.0.end())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates a new span encompassing `self` and `other`.
|
/// Creates a new span encompassing `self` and `other`.
|
||||||
|
@ -322,11 +322,11 @@ impl server::Span for RustAnalyzer {
|
|||||||
tt::TokenId::unspecified()
|
tt::TokenId::unspecified()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn after(&mut self, _self_: Self::Span) -> Self::Span {
|
fn end(&mut self, _self_: Self::Span) -> Self::Span {
|
||||||
tt::TokenId::unspecified()
|
tt::TokenId::unspecified()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn before(&mut self, _self_: Self::Span) -> Self::Span {
|
fn start(&mut self, _self_: Self::Span) -> Self::Span {
|
||||||
tt::TokenId::unspecified()
|
tt::TokenId::unspecified()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user