Return None from Span::join if in different files

This commit is contained in:
David Tolnay 2018-01-02 23:37:36 -08:00
parent 0f4ebf9f0a
commit 2b9add2c16
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82

View file

@ -247,7 +247,7 @@ impl Span {
#[unstable(feature = "proc_macro", issue = "38356")]
pub fn join(&self, other: Span) -> Option<Span> {
let self_loc = __internal::lookup_char_pos(self.0.lo());
let other_loc = __internal::lookup_char_pos(self.0.lo());
let other_loc = __internal::lookup_char_pos(other.0.lo());
if self_loc.file.name != other_loc.file.name { return None }