1
Fork 0

Point at coercion source on type errors for fn returning impl Trait

This commit is contained in:
Esteban Küber 2018-12-20 16:52:52 -08:00
parent 59f643fc5f
commit cdbccf50a7
4 changed files with 29 additions and 0 deletions

View file

@ -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,