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

Projects
None yet
2 participants
@phansch
Collaborator

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

This comment has been minimized.

Collaborator

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

@phansch phansch force-pushed the phansch:fix_2707 branch from 60accbc to 12d82d3 May 1, 2018

@oli-obk

This comment has been minimized.

Collaborator

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

Prevent crash when macro is in different file
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 phansch force-pushed the phansch:fix_2707 branch from 12d82d3 to 5d36edc May 1, 2018

@phansch

This comment has been minimized.

Collaborator

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

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@phansch phansch deleted the phansch:fix_2707 branch May 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment