-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Update to rust master #1085
Update to rust master #1085
Conversation
rust-lang/rust#19253 and rust-lang/rust@25f8051 have introduced changes to the namespacing within the std::collections::hash_map, breaking some of Cargo code which imported these. rust-lang/rust@cf350ea, implementing changes proposed by RFC rust-lang#344, have also broken some code which relies on hash_set::SetItems (now renamed to hash_set::Iter). This commit fixes the incompatibilities: imports of std::collections::hash_map::{Occupied, Vacant} have been replaced by imports of std::collections::hash_map::Entry::{Occupied, Vacant} and one instance where the SetItems has been used was replaced by the proper usage of Iter.
Cargo actually builds with a pinned version of the rust compiler, so you'll also have to update the date listed in |
@alexcrichton My rustc reports |
Latest changes require that we build with a later Rust nightly
Yep, that should do it! |
Okay, bumping the version triggered errors in Cargo's dependencies caused by the same breaking change. I fixed these locally, so I will submit pull requests to these libraries and we have to wait for them to be merged in order for this to build. Also, this triggers a compiler bug, further preventing the build in rustc that seems to be fixed by rust-lang/rust@c5aaa8c but is not yet in the 2014-12-22 nightly. So in any case we have to wait. |
If you add this to [profile.dev]
debug = false I wouldn't commit that to this PR, but it should help out working locally! |
It seems that the issues in docopt/docopt.rs and servo/rust-url that prevented them from building on the latest rustc have been resolved. Fixing |
Today's nightly has fixed the debuginfo ICE and I think a number of crates have all been updated, perhaps today's nightly could work? |
Updated to use the latest 2014-12-23 nightly and newest versions of crates url and docopt.rs
What does this mean?
On my machine it fetches the right version of that library but I bomb against an error in docopt.rs:
Fixing this (it was caused by rust-lang/rust@9b99436) I am greeted with:
I'm not sure which change causes this, I'm not very fluent with Rust, so any help would be appreciated. |
As per rust-lang/rust@b04bc5c, move all Encodable and Decodable deriving modes to RustcEncodable and RustcDecodable, and also extern the rustc-serialize crate instead of the former serialize one.
As per rust-lang/rust@f8cfd24, rename references to slice::Items to slice::Iter and slice::MutItems to slice::IterMut
As per rust-lang/rust@9b99436, the return type of from_utf8 has been changed from Option to Result. Consequently, update code which relied on this return type to work with Ok(...) and Err(...) instead of Some(...) and None
rustc complains that we cannot assign two different fn's to a single object within an if-else block. I was not able to figure out what causes this; so deferring the execution of the particular function is a reasonable fallback. Not very elegant and should be changed to something with less boilerplate
Bump to newest versions of several libraries
Copy lev_distance.rs verbatim from Rust since str::lev_distance has been deprecated by rust-lang/rust@9b99436 with no replacement and change code to use it instead of the deprecated function
Apparently .repeat() for str and .into_string() have been deprecated, replace them with suggested alternatives
I have updated the code so it now works with all the new breaking changes in Rust, with no deprecation warnings. However, some tests fail on the CI server. If you have any clue as to why this could have happened, assistance would be welcome. |
@@ -201,7 +201,6 @@ fn compile<'a, 'b>(targets: &[&'a Target], pkg: &'a Package, | |||
// a real job. Packages which are *not* compiled still have their jobs | |||
// executed, but only if the work is fresh. This is to preserve their | |||
// artifacts if any exist. | |||
let job = if compiled {Job::new} else {Job::noop}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to keep this up here if possible (keep the logic duplication to a minimum). You should be able to keep it up here with something like:
let job = if compiled {
Job::new as fn(Work, Work) -> Job
} else {
Job::noop as fn(Work, Work) -> Job
};
Thanks, will fix tomorrow, it's 6AM here now so kinda time to go to bed. What concerns me more are these two failed tests. I'm not sure if it's a regression caused by using a newer rustc or I screwed up something. |
It looks like these tests are failing because of a bug in rustdoc. Feel free to update the expected output to what rustdoc currently outputs, I'll just be sure to update it back once rustdoc is fixed! And again, thanks so much for this! |
As suggested by @alexcrichton, reverted back to the old way of handling both Job::new and Job::noop that avoids ugly constructs and code duplication
Two tests (test_with_deep_lib_dep and lib_with_standard_name) fail due to a bug in rustdoc (see rust-lang/rust#20183) so temporarily changing these so they pass. Be sure to change it back when the fix lands in the current rust nightly
All done. The CI builds pass. You may want to perform some more review to ensure that I didn't do anything erroneous (I am again saying that the stuff in these commits is the first Rust code I've ever written so be extra careful), but oh well, it compiles fine, the tests pass, the changes were pretty much heavylifting with no much thought involved, so I guess it can be merged. The commits are a bit of a clusterfuck so some rebasing and renaming has to be done. If anything needs to be fixed still just let me know. |
Awesome work, thanks so much! |
rust-lang/rust#19253 and rust-lang/rust@25f8051 have introduced changes to the namespacing within the std::collections::hash_map, breaking some of Cargo code which imported these. rust-lang/rust@cf350ea, implementing changes proposed by RFC #344, have also broken some code which relies on hash_set::SetItems (now renamed to hash_set::Iter). This PR fixes the incompatibilities: imports of std::collections::hash_map::{Occupied, Vacant} have been replaced by imports of std::collections::hash_map::Entry::{Occupied, Vacant} and one instance where the SetItems has been used was replaced by the proper usage of Iter.
Great! My first pull request ever - merged! :) Happy holidays @alexcrichton and everyone else, thank you for the wonderful work you did on Rust and related projects! |
rust-lang/rust#19253 and rust-lang/rust@25f8051 have introduced changes
to the namespacing within the std::collections::hash_map, breaking some
of Cargo code which imported these.
rust-lang/rust@cf350ea, implementing changes proposed by RFC #344, have
also broken some code which relies on hash_set::SetItems (now renamed to
hash_set::Iter).
This PR fixes the incompatibilities: imports of
std::collections::hash_map::{Occupied, Vacant} have been replaced by
imports of std::collections::hash_map::Entry::{Occupied, Vacant} and one
instance where the SetItems has been used was replaced by the proper
usage of Iter.