-
Notifications
You must be signed in to change notification settings - Fork 180
rust: track inline module scopes for module file resolution #785
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
Conversation
c93f104
to
aa12e9d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks :D I think the PR needs some tests before it gets merged, I can take a look at the warning thingies
Ah, @mathstuf: You can add the following to the test cases for now to remove (unused) warnings: // { dg-additional-options "-w" }
mod modules;
fn main() {
let twelve = modules::return_12();
} the issues you are seeing are because of name resolution. I faced them too when implementing the little bits for module inclusion |
aa12e9d
to
455f282
Compare
OK, so something isn't quite right with |
ba67c52
to
4b33a83
Compare
Gah. Mutable local variables bite again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, I think it looks good but I would like to see any new classes have private fields if possible its not always the case so let me know.
034f3c4
to
c46eb66
Compare
OK, so I've updated to support I'll also note that it seems that inline modules don't support inner attributes. |
c46eb66
to
44fe4f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
44fe4f2
to
92bde08
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the copied function I think this is all good :D Thanks a lot!
92bde08
to
2a88ef0
Compare
The set of inline modules is required to find the expected location of a module file. Track this information with an RAII object (`InlineModuleStackScope`) and pass it down to any out-of-line modules so that, when requested, the set of inline modules can be added to the search path. Signed-off-by: Ben Boeckel <[email protected]>
2a88ef0
to
1657ee5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM!
bors r+ |
Build succeeded: |
The set of inline modules is required to find the expected location of a
module file. Track this information with an RAII object
(
InlineModuleStackScope
) and pass it down to any out-of-line modulesso that, when requested, the set of inline modules can be added to the
search path.
Signed-off-by: Ben Boeckel [email protected]
Note that this does not include a test case because I have no idea how to mark up this for all the warnings that come out (#676):
Observed warnings:
Fixes: #645
Here is a checklist to help you with your PR.
make check-rust
passes locallyclang-format
(leaving to CI)gcc/testsuite/rust/
(see above)