Rollup merge of #47150 - dtolnay:join, r=jseyfried

Return None from Span::join if in different files

Fixes #47148. r? @abonander
This commit is contained in:
kennytm 2018-01-05 17:22:08 +08:00 committed by GitHub
commit 5a5b16ad06
1 changed files with 1 additions and 1 deletions

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 }