Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAvoid using `include!()` for platform modules #132
Merged
Conversation
Using `include!()` apparently breaks debug info, according to #108 (comment) -- so avoid it by going back to per-backend modules. (Extracted from #108 , since it's unrelated to the actual purpose of that PR.)
It could be argued that the explicit exports of each individual symbol are actually useful here, since in a way they define the common API that the various back-ends need to expose. I don't actually have a clear preference either way; but since this is really orthogonal to the purpose of the original import change, I'd rather keep the original behaviour. (It can be changed in a separate PR if desired.) Using an extra layer of indirection, we can preserve/restore the individual imports, but without the duplication needed in the initial version of #108
Instead of having the same conditions in two different places for `mod` and `use` statements, put the two items for every distinct condition next to each other. This should make it a bit easier to follow.
Rather than defining this helper class directly in the `platform` branch module, wrap it in a separate leaf module. (But keep it in the same file for simplicity.) This seems more elegant; and it avoids redundant conditionals.
This helper class is trivial and has no dependencies -- so I don't see much benefit from excluding it from the build on platforms that don't need it. Removing the conditional should reduce maintenance burden.
|
@bors-servo r+ |
|
|
bors-servo
added a commit
that referenced
this pull request
Jan 16, 2017
Avoid using `include!()` for platform modules Using `include!()` apparently breaks debug info, according to #108 (comment) -- so avoid it by going back to per-backend modules. (Extracted from #108 , since it's unrelated to the actual purpose of that PR.) This PR also contains a couple of more or less related cleanups.
|
|
|
@bors-servo: retry |
bors-servo
added a commit
that referenced
this pull request
Jan 16, 2017
Avoid using `include!()` for platform modules Using `include!()` apparently breaks debug info, according to #108 (comment) -- so avoid it by going back to per-backend modules. (Extracted from #108 , since it's unrelated to the actual purpose of that PR.) This PR also contains a couple of more or less related cleanups.
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
antrik commentedJan 16, 2017
Using
include!()apparently breaks debug info, according to#108 (comment) -- so
avoid it by going back to per-backend modules.
(Extracted from #108 , since
it's unrelated to the actual purpose of that PR.)
This PR also contains a couple of more or less related cleanups.