-
Notifications
You must be signed in to change notification settings - Fork 62
Missing fixes for 2018 #149
Comments
It turns out that the first case is actually implemented, but I’m also hitting https://github.com/rust-lang-nursery/rustfix/issues/150. |
Can you check the top of the output? I think basically everything should be automatically fixed, but if cargo fix hits a bug in one way or another it won't fix anything because some fix along the way causes the crate to stop compiling (or is this rust-lang/cargo#13022?, I haven't read that yet) |
@SimonSapin can you try this out again once rust-lang/cargo#13022 is fixed and see how many issues still remain? |
So, on further discoveries, for the three respective cases in the issue description:
|
Macros defined by 2015 edition crates are supposed to "just work" on 2018 edition with help edition hygiene, which is not completely implemented currently. |
Before we jump to conclusions about whether or not macros work in cross-editions situations, can the supposed bug be reduced to a digestable input? I've found that 90% of the time the bug isn't what you expect, but it's something totally random in the compiler. |
I'm going to close, as I don't think this has a particularly actionable reproduction, and is likely better tracked in rust-lang/rust#55592 or some other related issue. |
https://blog.rust-lang.org/2018/10/30/help-test-rust-2018.html
Indeed, running (roughly) this command with
nightly-2018-11-01
prints some warnings. So many warnings that just transferring them through SSH saturates the 100 Mbps link from my build server.To be fair these numbers are inflated because a lot of the relevant code is generated. But still, I hope this shows that the absolute-path warnings are extremely common. I feel it is essential that rustfix can fix them automatically for the edition migration path to be viable.
These absolute-path warnings seem to be mostly in one of three cases:
An
use
statement for an item in the same crate. The warning message suggests addingcrate::
and even shows what the new import should look like. So it seems like we’re most of the way there to apply this fix automatically.An
use
statement for an item in an external crate, but that crate has been renamed with for exampleextern crate mozjs as js;
. In this case a path starting withjs::
could be considered absolute and referring to an external crate. (Though this is a language change rather than a rustfix change.)An
#[derive(…)]
attribute with a derive defined in a proc-macro crate. (“Built-in” derives like#[derive(Clone)]
are not affected.) The correct fix is probably to adduse crate_name::DeriveName;
near the start of the module? Again, automatically.The text was updated successfully, but these errors were encountered: