-
Couldn't load subscription status.
- Fork 13.9k
When using value after move, point at span of local #57294
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
Conversation
|
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
|
@nikomatsakis, you might also be interested in taking a look at this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks nice
|
Ping @eddyb :) |
abbf5a2 to
09006d8
Compare
|
@bors r=nikomatsakis |
|
📌 Commit 09006d8 has been approved by |
…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.
|
⌛ Testing commit 09006d8 with merge 1c661d9fc2c921cbd8f8baae786af49812562ad7... |
|
💔 Test failed - checks-travis |
|
@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
|
@bors r=nikomatsakis |
|
📌 Commit baa0828 has been approved by |
|
@bors r+ However, it does seem fine. 😛 |
|
📌 Commit baa0828 has been approved by |
|
@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 😬 |
…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.
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
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.