提交 5a5b16ad 编写于 作者: K kennytm 提交者: GitHub

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

Return None from Span::join if in different files

Fixes #47148. r? @abonander
......@@ -247,7 +247,7 @@ pub fn end(&self) -> LineColumn {
#[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 }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册