Skip to content
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

upgrade to rust v1.54.0 #12459

Merged
merged 7 commits into from
Jul 30, 2021
Merged

upgrade to rust v1.54.0 #12459

merged 7 commits into from
Jul 30, 2021

Conversation

tdyas
Copy link
Contributor

@tdyas tdyas commented Jul 29, 2021

Upgrade to Rust v1.54.0. Announcement

Changes to satisfy Clippy:

  • Avoid borrows with an immediate implicit dereference.
  • Allow needless_collect in two places since making the suggested change resulted in a borrow checker error.
  • Rename two fields that are stored to allow execution of a non-trivial Drop impl later that would otherwise be dead code and need '#[allow(dead_code)]`.

Copy link
Contributor

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I love the new needless-borrow check, that's so helpful for reasoning about memory usage.

Copy link
Member

@stuhood stuhood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

Tom Dyas added 7 commits July 29, 2021 21:31
# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
error: this expression borrows a reference (`&std::collections::BTreeSet<<R as rules::Rule>::TypeId>`) that is immediately dereferenced by the compiler
   --> rule_graph/src/builder.rs:619:35
    |
619 |         .map(|out_set| params_str(&out_set))
    |                                   ^^^^^^^^ help: change this to: `out_set`
    |
note: the lint level is defined here
   --> rule_graph/src/builder.rs:7:3
    |
7   |   clippy::all,
    |   ^^^^^^^^^^^
    = note: `#[deny(clippy::needless_borrow)]` implied by `#[deny(clippy::all)]`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

error: this expression borrows a reference (`&Workunit`) that is immediately dereferenced by the compiler
   --> workunit_store/src/lib.rs:456:56
    |
456 |           let maybe_duration = Self::duration_for(now, &workunit);
    |                                                        ^^^^^^^^^ help: change this to: `workunit`
    |
note: the lint level is defined here
   --> workunit_store/src/lib.rs:7:3
    |
7   |   clippy::all,
    |   ^^^^^^^^^^^
    = note: `#[deny(clippy::needless_borrow)]` implied by `#[deny(clippy::all)]`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

error: this pattern creates a reference to a reference
   --> workunit_store/src/lib.rs:537:17
    |
537 |     if let Some(ref workunit) = workunit {
    |                 ^^^^^^^^^^^^ help: try this: `workunit`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

[ci skip-build-wheels]

more deref stuff
fmt
[ci skip-build-wheels]
[ci skip-build-wheels]
@tdyas tdyas force-pushed the upgrade_to_rust_v1.54.0 branch from 4c9b310 to 1611224 Compare July 30, 2021 01:34
@tdyas tdyas merged commit 258a44a into pantsbuild:main Jul 30, 2021
@tdyas tdyas deleted the upgrade_to_rust_v1.54.0 branch July 30, 2021 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants