Upgrade to Rust v1.49.0#11404
Merged
Merged
Conversation
added 2 commits
January 2, 2021 16:19
[ci skip-build-wheels]
[ci skip-build-wheels]
tdyas
commented
Jan 3, 2021
| } | ||
|
|
||
| pub fn type_ids<'a>(&'a self) -> impl Iterator<Item = TypeId> + 'a { | ||
| pub fn type_ids(&self) -> impl Iterator<Item = TypeId> + '_ { |
Contributor
Author
There was a problem hiding this comment.
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`
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
Upgrade to Rust v1.49.0.
Includes two clippy-related changes.
Result
Existing tests pass.