Skip to content

Upgrade to Rust v1.49.0#11404

Merged
tdyas merged 2 commits into
pantsbuild:masterfrom
tdyas:upgrade_to_rust_v1.49.0
Jan 3, 2021
Merged

Upgrade to Rust v1.49.0#11404
tdyas merged 2 commits into
pantsbuild:masterfrom
tdyas:upgrade_to_rust_v1.49.0

Conversation

@tdyas
Copy link
Copy Markdown
Contributor

@tdyas tdyas commented Jan 3, 2021

Change

Upgrade to Rust v1.49.0.

Includes two clippy-related changes.

Result

Existing tests pass.

Tom Dyas added 2 commits January 2, 2021 16:19
[ci skip-build-wheels]
[ci skip-build-wheels]
}

pub fn type_ids<'a>(&'a self) -> impl Iterator<Item = TypeId> + 'a {
pub fn type_ids(&self) -> impl Iterator<Item = TypeId> + '_ {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The clippy lint that was triggered:

error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
  --> src/core.rs:87:3
   |
87 |   pub fn type_ids<'a>(&'a self) -> impl Iterator<Item = TypeId> + 'a {
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: the lint level is defined here
  --> src/lib.rs:7:3
   |
7  |   clippy::all,
   |   ^^^^^^^^^^^
   = note: `#[deny(clippy::needless_lifetimes)]` implied by `#[deny(clippy::all)]`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes

error: aborting due to previous error

error: could not compile `engine`

To learn more, run the command again with --verbose.

Just removing the lifetime was insufficient to fix:

error[E0759]: `self` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
  --> src/core.rs:88:12
   |
87 |   pub fn type_ids(&self) -> impl Iterator<Item = TypeId> {
   |                   ----- this data with an anonymous lifetime `'_`...
88 |     self.0.iter().map(|k| *k.type_id())
   |     ------ ^^^^
   |     |
   |     ...is captured here...
   |
note: ...and is required to live as long as `'static` here
  --> src/core.rs:87:29
   |
87 |   pub fn type_ids(&self) -> impl Iterator<Item = TypeId> {
   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: to declare that the `impl Trait` captures data from argument `self`, you can add an explicit `'_` lifetime bound
   |
87 |   pub fn type_ids(&self) -> impl Iterator<Item = TypeId> + '_ {
   |                                                          ^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0759`.
error: could not compile `engine`

Copy link
Copy Markdown
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.

Thanks!

@tdyas tdyas merged commit 768b3a3 into pantsbuild:master Jan 3, 2021
@tdyas tdyas deleted the upgrade_to_rust_v1.49.0 branch January 3, 2021 02:16
stuhood added a commit to stuhood/pants that referenced this pull request Jan 4, 2021
This reverts commit 768b3a3.

[ci skip-build-wheels]
tdyas pushed a commit to tdyas/pants that referenced this pull request Jan 4, 2021
This reverts commit 768b3a3.

[ci skip-build-wheels]
tdyas pushed a commit that referenced this pull request Jan 4, 2021
This reverts commit 768b3a3.

### Problem

Tests error on macOS with 1.49 but succeed on 1.48.

### Solution

Revert the upgrade.
Eric-Arellano added a commit to Eric-Arellano/pants that referenced this pull request Jan 12, 2021
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.

2 participants