Return the first span from Span::join

This commit is contained in:
Jonas Schievink 2022-03-23 15:09:39 +01:00
parent 83b4329c6f
commit 1e2a4c1bdb
5 changed files with 15 additions and 10 deletions

View File

@ -662,8 +662,9 @@ impl server::Span for Rustc {
// FIXME handle span
LineColumn { line: 0, column: 0 }
}
fn join(&mut self, _first: Self::Span, _second: Self::Span) -> Option<Self::Span> {
None
fn join(&mut self, first: Self::Span, _second: Self::Span) -> Option<Self::Span> {
// Just return the first span again, because some macros will unwrap the result.
Some(first)
}
fn resolved_at(&mut self, _span: Self::Span, _at: Self::Span) -> Self::Span {
// FIXME handle span

View File

@ -665,8 +665,9 @@ impl server::Span for Rustc {
// FIXME handle span
LineColumn { line: 0, column: 0 }
}
fn join(&mut self, _first: Self::Span, _second: Self::Span) -> Option<Self::Span> {
None
fn join(&mut self, first: Self::Span, _second: Self::Span) -> Option<Self::Span> {
// Just return the first span again, because some macros will unwrap the result.
Some(first)
}
fn resolved_at(&mut self, _span: Self::Span, _at: Self::Span) -> Self::Span {
// FIXME handle span

View File

@ -677,8 +677,9 @@ impl server::Span for Rustc {
// FIXME handle span
LineColumn { line: 0, column: 0 }
}
fn join(&mut self, _first: Self::Span, _second: Self::Span) -> Option<Self::Span> {
None
fn join(&mut self, first: Self::Span, _second: Self::Span) -> Option<Self::Span> {
// Just return the first span again, because some macros will unwrap the result.
Some(first)
}
fn resolved_at(&mut self, _span: Self::Span, _at: Self::Span) -> Self::Span {
// FIXME handle span

View File

@ -677,8 +677,9 @@ impl server::Span for Rustc {
// FIXME handle span
LineColumn { line: 0, column: 0 }
}
fn join(&mut self, _first: Self::Span, _second: Self::Span) -> Option<Self::Span> {
None
fn join(&mut self, first: Self::Span, _second: Self::Span) -> Option<Self::Span> {
// Just return the first span again, because some macros will unwrap the result.
Some(first)
}
fn resolved_at(&mut self, _span: Self::Span, _at: Self::Span) -> Self::Span {
// FIXME handle span

View File

@ -681,8 +681,9 @@ impl server::Span for Rustc {
// FIXME handle span
LineColumn { line: 0, column: 0 }
}
fn join(&mut self, _first: Self::Span, _second: Self::Span) -> Option<Self::Span> {
None
fn join(&mut self, first: Self::Span, _second: Self::Span) -> Option<Self::Span> {
// Just return the first span again, because some macros will unwrap the result.
Some(first)
}
fn resolved_at(&mut self, _span: Self::Span, _at: Self::Span) -> Self::Span {
// FIXME handle span