When using value after move, point at span of local#57294
Merged
bors merged 6 commits intorust-lang:masterfrom Jan 25, 2019
Merged
When using value after move, point at span of local#57294bors merged 6 commits intorust-lang:masterfrom
bors merged 6 commits intorust-lang:masterfrom
Conversation
Contributor
|
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
19a3c07 to
abbf5a2
Compare
estebank
commented
Jan 7, 2019
Contributor
Author
|
@nikomatsakis, you might also be interested in taking a look at this. |
nikomatsakis
approved these changes
Jan 9, 2019
Contributor
nikomatsakis
left a comment
There was a problem hiding this comment.
I think this looks nice
Contributor
Author
|
Ping @eddyb :) |
Contributor
Author
nikomatsakis
requested changes
Jan 18, 2019
abbf5a2 to
09006d8
Compare
Contributor
Author
|
@bors r=nikomatsakis |
Collaborator
|
📌 Commit 09006d8 has been approved by |
Centril
added a commit
to Centril/rust
that referenced
this pull request
Jan 21, 2019
…sakis
When using value after move, point at span of local
When trying to use a value after move, instead of using a note, point
at the local declaration that has a type that doesn't implement `Copy`
trait.
```
error[E0382]: use of moved value: `x`
--> $DIR/issue-34721.rs:27:9
|
LL | pub fn baz<T: Foo>(x: T) -> T {
| - - move occurs because `x` has type `T`, which does not implement the `Copy` trait
| |
| consider adding a `Copy` constraint to this type argument
LL | if 0 == 1 {
LL | bar::bar(x.zero())
| - value moved here
LL | } else {
LL | x.zero()
| - value moved here
LL | };
LL | x.zero()
| ^ value used here after move
```
Fix rust-lang#34721.
Collaborator
|
⌛ Testing commit 09006d8 with merge 1c661d9fc2c921cbd8f8baae786af49812562ad7... |
Collaborator
|
💔 Test failed - checks-travis |
Contributor
Author
|
@bors r- need to update nll tests. |
When trying to use a value after move, instead of using a note, point at the local declaration that has a type that doesn't implement `Copy` trait.
09006d8 to
baa0828
Compare
Contributor
Author
|
@bors r=nikomatsakis |
Collaborator
|
📌 Commit baa0828 has been approved by |
Contributor
nikomatsakis
approved these changes
Jan 24, 2019
Contributor
|
@bors r+ However, it does seem fine. 😛 |
Collaborator
|
📌 Commit baa0828 has been approved by |
Contributor
Author
|
@nikomatsakis I though I had seen green checkmark gated on fixing feedback, but looking now I must have gotten confused with a different PR, sorry about that 😬 |
Centril
added a commit
to Centril/rust
that referenced
this pull request
Jan 25, 2019
…sakis
When using value after move, point at span of local
When trying to use a value after move, instead of using a note, point
at the local declaration that has a type that doesn't implement `Copy`
trait.
```
error[E0382]: use of moved value: `x`
--> $DIR/issue-34721.rs:27:9
|
LL | pub fn baz<T: Foo>(x: T) -> T {
| - - move occurs because `x` has type `T`, which does not implement the `Copy` trait
| |
| consider adding a `Copy` constraint to this type argument
LL | if 0 == 1 {
LL | bar::bar(x.zero())
| - value moved here
LL | } else {
LL | x.zero()
| - value moved here
LL | };
LL | x.zero()
| ^ value used here after move
```
Fix rust-lang#34721.
bors
added a commit
that referenced
this pull request
Jan 25, 2019
Rollup of 5 pull requests Successful merges: - #56217 (Add grammar in docs for {f32,f64}::from_str, mention known bug.) - #57294 (When using value after move, point at span of local) - #57652 (Update/remove some old readmes) - #57802 (Print visible name for types as well as modules.) - #57865 (Don't ICE when logging unusual types) Failed merges: r? @ghost
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.
When trying to use a value after move, instead of using a note, point
at the local declaration that has a type that doesn't implement
Copytrait.
Fix #34721.