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

edition 2018 support for mod #[path=] attribute #59345

Open
burrbull opened this issue Mar 21, 2019 · 7 comments
Labels

Comments

@burrbull
Copy link

@burrbull burrbull commented Mar 21, 2019

If module files have edition 2018 style file structure and try to import one of them by path attribute:

#[path=modname.rs] 
mod modname;

compiler tries to find submodules in submodname.rs or submodname/mod.rs, but not in
modname/submodname.rs where it is really located.

@crlf0710

This comment has been minimized.

Copy link
Contributor

@crlf0710 crlf0710 commented Jun 18, 2019

Just run into this issue with winit 2018 migration. cc #61924 rust-windowing/winit#912

@crlf0710

This comment has been minimized.

Copy link
Contributor

@crlf0710 crlf0710 commented Jun 18, 2019

@petrochenkov do you think this is a C-bug or C-enhancement?

@petrochenkov

This comment has been minimized.

Copy link
Contributor

@petrochenkov petrochenkov commented Jun 18, 2019

do you think this is a C-bug or C-enhancement?

¯_(ツ)_/¯
I always forget how exactly #[path] works, I only remember that it doesn't work consistently, but changing that is a breaking change.

@crlf0710

This comment has been minimized.

Copy link
Contributor

@crlf0710 crlf0710 commented Jun 18, 2019

Is it a breaking change adding an extra candidate?

@petrochenkov

This comment has been minimized.

Copy link
Contributor

@petrochenkov petrochenkov commented Jun 18, 2019

cc @cramertj (perhaps you remember the details?)

@cramertj

This comment has been minimized.

Copy link
Member

@cramertj cramertj commented Jun 18, 2019

Yeah, it's a totally confusing mess. The reference's section on this should be correct, though (it isn't, it's missing some things).

@ehuss

This comment has been minimized.

Copy link
Contributor

@ehuss ehuss commented Jun 18, 2019

The reference is incomplete. See rust-lang/reference#573, which I believe is exactly this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.