Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Never getting None from proc_macro::Span::join #47148

Closed
dtolnay opened this issue Jan 3, 2018 · 1 comment
Closed

Never getting None from proc_macro::Span::join #47148

dtolnay opened this issue Jan 3, 2018 · 1 comment
Labels
C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@dtolnay
Copy link
Member

dtolnay commented Jan 3, 2018

This doesn't look right -- both sides of the comparison use self.0.lo().

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());
if self_loc.file.name != other_loc.file.name { return None }

Mentioning @abonander, mentioning #38356

@estebank
Copy link
Contributor

estebank commented Jan 4, 2018

the second lookup should probably be other.0.lo() ^_^

@estebank estebank added C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 4, 2018
kennytm added a commit to kennytm/rust that referenced this issue Jan 4, 2018
Return None from Span::join if in different files

Fixes rust-lang#47148. r? @abonander
kennytm added a commit to kennytm/rust that referenced this issue Jan 5, 2018
Return None from Span::join if in different files

Fixes rust-lang#47148. r? @abonander
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants