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

Prevent crash when macro was in different file #2711

Merged
merged 1 commit into from
May 1, 2018

Conversation

phansch
Copy link
Member

@phansch phansch commented May 1, 2018

This was caused by a macro in a different file.
The target.span was be in the file of the macro definition and the
item.span in the file of the calling code.

Closes #2707

@phansch
Copy link
Member Author

phansch commented May 1, 2018

I'm not really sure how to add a test for this because the macro has to be in a different file.

It was caused by using this macro in this line

@oli-obk
Copy link
Contributor

oli-obk commented May 1, 2018

You should be able to create a file in the auxiliary directory and then use a module with a custom path attribute

This was caused by a macro in a different file.
The `target.span` was be in the file of the macro definition and the
`item.span` in the file of the calling code.
@phansch
Copy link
Member Author

phansch commented May 1, 2018

Rebased with the test. For some reason it only was causing the multi-file span if it is a pub mod. Just mod works fine.

@oli-obk oli-obk merged commit ee57446 into rust-lang:master May 1, 2018
@phansch phansch deleted the fix_2707 branch May 3, 2018 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants