Skip to content

Commit

Permalink
Return None from Span::join if in different files
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jan 3, 2018
1 parent 0f4ebf9 commit 2b9add2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libproc_macro/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down

0 comments on commit 2b9add2

Please sign in to comment.