track: Migrated the existing exercises to the Rust 2018 edition#769
track: Migrated the existing exercises to the Rust 2018 edition#769petertseng merged 4 commits intoexercism:masterfrom
Conversation
petertseng
left a comment
There was a problem hiding this comment.
I imagine students will appreciate being able to use 2018. I seem to recall there was an example solution I wrote recently where I would have benefited from a non-lexical lifetime.
I would like to see the cargo fmt results in a different commit, because they are not related to moving editions. I'd like to also take this opportunity to remind interested individuals who might have an opinion on #659 .
cargo fix probably can go in the same commit as addition edition however.
5277fbc to
6daabe1
Compare
|
Done |
coriolinus
left a comment
There was a problem hiding this comment.
Approved pending getting Travis to pass. Haven't looked yet into what's causing that failure.
One interesting exercise which I have not yet performed: with a pre-rust-2018 compiler, attempt to independently compile all stubs and examples. I intuit that all stubs should compile, but that several examples will not. However, I assert that it is acceptable to impose a minimum rustc version for this track, given the ease of upgrading with rustup.
|
The build failed for several reasons:
|
Actually that raises a question - should deprecated exercises be present on the track? Maybe they could be removed, so not to complicate Travis scripts? |
|
Agree that deprecated exercises could be removed.
…On Mon, Dec 10, 2018 at 11:01 AM Zapolsky Anton ***@***.***> wrote:
Some deprecated exercises (namely nucleotide-codons and hexadecimal) were
modified and included in the Travis check.
Actually that raises a question - should deprecated exercises be present
on the track? Maybe they could be removed, so not to complicate Travis
scripts?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#769 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHdeTmTCgcJ1FdytZXla34X87MzOQLh1ks5u3jDjgaJpZM4ZKSjG>
.
|
6daabe1 to
2eb6ddb
Compare
|
OK, now Travis has failed only because of the deprecated exercises. To make it pass I would have to rebase against #773 |
75e43fe to
35a42c5
Compare
ba2a443 to
6752176
Compare
|
Note: dfdb48f should be good |
|
Trying with just the edition and |
6752176 to
63bdbe4
Compare
|
Okay, that build succeeded, so only the |
For the sake of making this more easily reviewable, this limits the changes to only the Cargo*.toml files. However, a `use` change will be required to compile: https://rust-lang-nursery.github.io/edition-guide/rust-2018/module-system/path-clarity.html Thus, we intentionally break bisectability for the sake of reviewability.
b988195 to
065ceff
Compare
petertseng
left a comment
There was a problem hiding this comment.
I decided that the cargo fix does instead go in a separate commit, since I discovered it is not required for compilation
|
Other changes I made to support this PR:
|
In Rust 2018, paths in `use` declarations must begin with a crate name, `crate`, `self`, or `super`. Required for the affected exercises to compile under Rust 2018 https://rust-lang-nursery.github.io/edition-guide/rust-2018/module-system/path-clarity.html
None of these are required to compile any exercise, but it's useful to be in line with 2018 idioms. Most changes are of the form: `extern crate` becomes `use`. Note an addition of an unnamed lifetime in roman-numeral.
065ceff to
c0afe38
Compare
This PR shows what simple migration to the 2018 edition would look, when
cargo fixis applied to every exercise on the track.Since the changes were nor discussed nor approved by the maintainers , this PR serves as a demonstration of the migration, and should be closed, if the changes are not desirable.
A script, that was used for the migration: