-
Notifications
You must be signed in to change notification settings - Fork 657
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
Rust 2018 #161
Comments
Oh this is good idea, we need to prepare to Rust 2018. I'd say it would be better to do all imports change before next major version change to avoid problems, but I'd prefer to have |
It seems they are aware in rustfmt. So |
I made it work by using the |
I'm guessing the reason why the But, since this causes problems with Rust 2018, why not move the #[macro_use]
extern crate actix as actix_inner;
// ...
pub mod actix {
// You could even delete this and just use `actix_inner::` everywhere
extern crate actix;
pub use self::actix::actors::resolver;
pub use self::actix::actors::signal;
pub use self::actix::fut;
pub use self::actix::msgs;
// prelude no longer has an actix module
pub use self::actix::prelude::*;
pub use self::actix::{run, spawn};
// Instead, we create it here
pub mod actix {
pub use actix_inner::actors;
pub use actix_inner::dev;
pub use actix_inner::fut;
pub use actix_inner::io;
pub use actix_inner::msgs;
pub use actix_inner::prelude::*;
pub use actix_inner::registry::SystemService;
pub use actix_inner::utils::{Condition, IntervalFunc, TimerFunc};
}
} (We need to use This would fix the Rust 2018 error while letting users of |
@DoumanAsh do you have time for this? |
@fafhrd91 To be honest I think it would be better if we re-export I'll look into it, if you're still against re-exporting whole |
I don’t think we need reexport at all, 2018 edition simplify extern crates |
Act of re-exporting is only convenience for users not to add Personally I only see it as either full re-export, or let user to manually add |
We should remove actix reexport. Question is in what form to do this for current releases. For sure next release should switch to 2018 but not current one |
We cannot really do anything with current state, removing For 0.8 in both |
I agree, but 0.8 will take some time. |
Removing |
While it is technically breaking change, it should not significantly affect people as 2018 edition is going to be prevalent |
I was experimenting yesterday, upgrading my little project to the 2018 edition. One of the changes there is about crates and imports. To cut it short, following the guide, I should remove
extern crate actix
and the rest should just work. However there is a problem.The problem is
actix::prelude
has a module namedactix
and it causes a conflict with the crate name itself. I was able to fix the error in 2 ways:prelude
with specific imports. This obviously works, but defeats the purpose ofprelude
.::
prefix:use ::actix::prelude::*;
. I would make a peace importing it this way, howeverrustfmt
rewrites it removing the prefix.It's a minor issue, but it would be nice to have it fixed (if possible at all) for 2018 edition release, for smoother migration.
The text was updated successfully, but these errors were encountered: