-
Notifications
You must be signed in to change notification settings - Fork 13.5k
suggest declaring modules when file found but module not defined #142730
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
base: master
Are you sure you want to change the base?
suggest declaring modules when file found but module not defined #142730
Conversation
@rustbot label A-diagnostics |
This comment has been minimized.
This comment has been minimized.
rustbot has assigned @petrochenkov. Use |
This comment has been minimized.
This comment has been minimized.
7174cb4
to
397c51b
Compare
c1a4a41
to
18ca511
Compare
let map = self.tcx.sess.source_map(); | ||
let sp = map | ||
.span_extend_to_prev_char( | ||
map.span_extend_to_prev_char(ident.span, '\n', true), |
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.
Could you add a comment explaining what are you trying to do here?
(Also format this on a separate line to improve readability let sp = map.span_extend_to_prev_char(ident.span, '\n', true);
)
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.
Ah, wait, I think this can actually use current_crate_outer_attr_insert_span
instead of UsePlacementFinder
.
(The newly added comment tells that the current logic is clearly incorrect.)
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.
oh yeah that seems like what i wanted i was wondering what the extern crate
thing was spawned from
18ca511
to
184ef96
Compare
Could you also add a new test exercising the various naming schemes (like |
184ef96
to
2f55dce
Compare
2f55dce
to
3583423
Compare
im not sure how to make a test with a normal directory structure? everything seems to use #[path = auxiliary/]... |
Well, |
suggests declaring modules when a module is found but not defined, i.e
or
which currently is just
but now would have this nice help: