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

Bring back __diesel_use_everything #1865

Closed

Conversation

weiznich
Copy link
Member

This allows to rename diesel while importing the crate

This rolls back the breaking change that it was required to import diesel as #[macro_use] extern crate diesel; in your crate root.

Site note:

It seems like it is possible to use items from a mod defined inside of a constant by using the full path without self, but it seems not to be possible to create use statements for those things. Not sure if that should be reported as bug against rustc?

@weiznich weiznich requested a review from a team September 23, 2018 15:39
This allows to rename diesel while importing the crate
@weiznich weiznich force-pushed the bringback_diesel_use_everything branch from dc4b964 to 273cba5 Compare September 23, 2018 17:17
@weiznich weiznich added this to the 1.4 milestone Sep 23, 2018
@weiznich
Copy link
Member Author

It seems like it is possible to use items from a mod defined inside of a constant by using the full path without self, but it seems not to be possible to create use statements for those things. Not sure if that should be reported as bug against rustc?

Opened rust-lang/rust#54525 about that.

@sgrif
Copy link
Member

sgrif commented Sep 24, 2018

I don't think this is worth it. Rust 2018 effectively removes this as an option, since extern crate statements are gone. While it's still technically possible, I don't think we should remove our ability to write use in derives for something that requires writing unidiomatic code to do

@weiznich
Copy link
Member Author

Rust 2018 effectively removes this as an option, since extern crate statements are gone.

a) Not everybody will update to Rust 2018, it is also possible to continue using the 2015 edition.
b) It is also possible to rename the crate on in rust 2018 by changing the name in your Cargo.toml
c) This broke some of our internal code. I can also fix this there, but again, this was a breaking change and if it's possible to avoid such a thing we should do that, because this will probably affect more users.

I don't think we should remove our ability to write use in derives for something that requires writing unidiomatic code to do.

It's quite unfortunate that use statements are broken there, but I consider this a bug in rustc that should be fixed there.

@weiznich weiznich removed this from the 1.4 milestone Nov 13, 2018
@weiznich weiznich closed this Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants