-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Switch to purely namespaced enums #18973
Conversation
This is 99% boring reexport additions. There are some interesting changes to resolve that should be looked over. |
0e32aef
to
060dfc3
Compare
To me, this seems like one of these invasive breaking changes where it'd be nice to make sure that diagnostics themselves suggest a solution rather than having the users look for it in the Rust commits. Do you know if it'd be hard to make resolve do that? I'd go as far as say that maybe initially it could be a warning as well and a hard error in a few weeks' time. |
I can't really think of a non-painful way to get that to work off the top of my head, unfortunately. |
So glad to see this on it's way in! Awesome effort, @sfackler. |
7649cfd
to
4dc7504
Compare
4dc7504
to
229cc10
Compare
bdbda0d
to
7a87302
Compare
7a87302
to
6b51262
Compare
6b51262
to
091fe79
Compare
This breaks code that referred to variant names in the same namespace as their enum. Reexport the variants in the old location or alter code to refer to the new locations: ``` pub enum Foo { A, B } fn main() { let a = A; } ``` => ``` pub use self::Foo::{A, B}; pub enum Foo { A, B } fn main() { let a = A; } ``` or ``` pub enum Foo { A, B } fn main() { let a = Foo::A; } ``` [breaking-change]
091fe79
to
3dcd215
Compare
This breaks code that referred to variant names in the same namespace as their enum. Reexport the variants in the old location or alter code to refer to the new locations: ``` pub enum Foo { A, B } fn main() { let a = A; } ``` => ``` pub use self::Foo::{A, B}; pub enum Foo { A, B } fn main() { let a = A; } ``` or ``` pub enum Foo { A, B } fn main() { let a = Foo::A; } ``` [breaking-change]
rust-lang/rust#18973 changed the behavior of enums. Enums are now namespaced.
As per this pull request rust-lang/rust#18973, enum variants require fully qualified path to access them. This commit introduces boring changes to make nix-rust compiles againts new rust.
With rust-lang/rust#18973 merged enum variants are namespaced. They should be reexported or used like Enum::Variant.
See rust-lang/rust#18973 - The `linspace` and `logspace` functions have been moved into their own crate - The `color` module has been removed, the `Color` enum is now in the root of the crate - The following enums have been moved into the root of the crate: `Axis`, `Grid` and `Scale` - Renames: - `HorizontalPosition` -> `Horizontal` - `LeftJustified/RightJustified` -> `Justification::{Left, Right}` - `Vertical::Middle` -> `Vertical::Center` - `VerticalPosition` -> `Vertical` [breaking-change]
As per this pull request rust-lang/rust#18973, enum variants require fully qualified path to access them. This commit introduces boring changes to make nix-rust compiles againts new rust.
See rust-lang/rust#18973 `Tails` variants: `OneTailed` and `TwoTailed` have been renamed to `Tails::{One, Two}` [breaking-change]
See rust-lang/rust#18973 - The `linspace` and `logspace` functions have been moved into their own crate - The `color` module has been removed, the `Color` enum is now in the root of the crate - The following enums have been moved into the root of the crate: `Axis`, `Grid` and `Scale` - Renames: - `HorizontalPosition` -> `Horizontal` - `LeftJustified/RightJustified` -> `Justification::{Left, Right}` - `Vertical::Middle` -> `Vertical::Center` - `VerticalPosition` -> `Vertical` [breaking-change]
This breaks code that referred to variant names in the same namespace as
their enum. Reexport the variants in the old location or alter code to
refer to the new locations:
=>
or
[breaking-change]