Closed Bug 1508670 Opened Last year Closed Last year

Prepare code for Rust 2018 edition release

Categories

(Testing :: geckodriver, enhancement, P2)

enhancement

Tracking

(firefox65 fixed)

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

Details

Attachments

(6 files)

The Rust 2018 edition comes closer and as such we should prepare our code for webdriver/geckodriver to be valid in both Rust 2015 and Rust 2018. To do that we can use the `cargo fix --edition` command. It will automatically fix most of the reported warnings, but not everything. So a bit of manual work would still be necessary.

Note that before running this command we should change the code from using the `try!` macro to `?` instead. It would avoid a lot of replacements to `r#try!()`.

This can actually be done automatically via `rerast`:
https://users.rust-lang.org/t/automatically-replace-all-try-with/16873

Any other feedback before I would get started on it?
Also see https://blog.rust-lang.org/2018/10/30/help-test-rust-2018.html for the details, and the final update for the Cargo.toml file.
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Priority: -- → P2
(In reply to Henrik Skupin (:whimboo) from comment #1)
> the details, and the final update for the Cargo.toml file.

We cannot do the final update of the Cargo.toml yet, given that the `edition` keyword is nightly only at the moment.

Here a try build:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=329bed20842e998d00048a0dc3b825b16e17db29
In the last try build I forgot to remove a `+` which came in from c&p a diff. Here an updated try which should succeed now:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=a3bd638e8afe2fb88a817439227dee72b8721179
Attachment #9028610 - Attachment description: Bug 1508670 - [geckodriver] Convert usages of try macro to ?. r?ato → Bug 1508670 - Convert usages of try macro to ? for webdriver and geckodriver. r?ato
In one of the patches I missed a final question mark, which caused a bit of bustage for wdspec jobs. As such here an updated try build with the issue fixed:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=cbc81d2d389d63d68915c41b4930e1b3f6662742
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b8880c9c9151
Convert usages of try macro to ? for webdriver and geckodriver. r=ato
https://hg.mozilla.org/integration/autoland/rev/a359ecc0ef3a
[mozprofile] Fix Rust code to be compatible with Rust 2018 edition. r=ato
https://hg.mozilla.org/integration/autoland/rev/010ddcfda318
[mozversion] Fix Rust code to be compatible with Rust 2018 edition. r=ato
https://hg.mozilla.org/integration/autoland/rev/03b632f92cde
[mozrunner] Fix Rust code to be compatible with Rust 2018 edition. r=ato
https://hg.mozilla.org/integration/autoland/rev/17e5d1f4b36a
[webdriver] Fix Rust code to be compatible with Rust 2018 edition. r=ato
https://hg.mozilla.org/integration/autoland/rev/8c4e43e477e5
[geckodriver] Fix Rust code to be compatible with Rust 2018 edition. r=ato
You need to log in before you can comment on or make changes to this bug.