Point at coercion source on type errors for fn returning impl Trait
This commit is contained in:
parent
59f643fc5f
commit
cdbccf50a7
4 changed files with 29 additions and 0 deletions
|
@ -331,6 +331,13 @@ impl Span {
|
|||
span.lo <= other.lo && other.hi <= span.hi
|
||||
}
|
||||
|
||||
/// Return `true` if `self` touches `other`.
|
||||
pub fn overlaps(self, other: Span) -> bool {
|
||||
let span = self.data();
|
||||
let other = other.data();
|
||||
span.lo < other.hi && other.lo < span.hi
|
||||
}
|
||||
|
||||
/// Return true if the spans are equal with regards to the source text.
|
||||
///
|
||||
/// Use this instead of `==` when either span could be generated code,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue