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

Replace the hidden module for derives with a hidden function #111

Closed
Ogeon opened this issue Jul 10, 2018 · 2 comments · Fixed by #176
Closed

Replace the hidden module for derives with a hidden function #111

Ogeon opened this issue Jul 10, 2018 · 2 comments · Fixed by #176
Labels
defect Something that isn't as or doesn't work as intended

Comments

@Ogeon
Copy link
Owner

Ogeon commented Jul 10, 2018

This allows derives to be used in functions (see workaround from rust-lang/rust#51952). The problem is that extern crate seems to be hard or impossible to use in a function scope, so it will most likely be a breaking change.

@Ogeon Ogeon added the defect Something that isn't as or doesn't work as intended label Jul 10, 2018
@Ogeon Ogeon added this to the 0.4.1 milestone Jul 10, 2018
bors bot added a commit that referenced this issue Aug 1, 2018
113: Import everything from the parent scope in derives r=Ogeon a=Ogeon

This removes the warnings without breaking anything that wasn't broken before. Turns out that `extern crate` in a function scope has some strange behaviors, so I'm not going to do the function change just yet. I will change #111 not be about the hygiene warning, but just un-breaking cases where `#[derive(...)]` is already broken.

Co-authored-by: Erik Hedvall <erikwhedvall@gmail.com>
@Ogeon Ogeon modified the milestones: 0.4.1, 0.5.0 Aug 1, 2018
@Ogeon
Copy link
Owner Author

Ogeon commented Feb 27, 2019

It may be possible to use https://crates.io/crates/find-crate to find a way around the problem. I think it will allow us to refer to the crate via a global path (::#name::thing, provided it works and doesn't print warnings in both Rust editions). Then it's up to the user to write extern crate where/if necessary.

@Ogeon Ogeon removed this from the 0.5.0 milestone Jul 7, 2019
@bors bors bot closed this as completed in #176 Apr 5, 2020
@bors bors bot closed this as completed in dd7645d Apr 5, 2020
@Ogeon
Copy link
Owner Author

Ogeon commented Apr 5, 2020

I removed it completely. It's no longer necessary, especially with find-crate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Something that isn't as or doesn't work as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant