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

[NLL] move-guard-const.rs test use of moved value #47592

Closed
spastorino opened this issue Jan 19, 2018 · 4 comments
Closed

[NLL] move-guard-const.rs test use of moved value #47592

spastorino opened this issue Jan 19, 2018 · 4 comments
Assignees
Labels
A-NLL Area: Non-lexical lifetimes (NLL) C-enhancement Category: An issue proposing an enhancement or a PR with one. NLL-complete Working towards the "valid code works" goal T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@spastorino
Copy link
Member

$ RUST_BACKTRACE=full rustc +stage1 src/test/run-pass/move-guard-const.rs -Znll -Zborrowck=mir -Ztwo-phase-borrows
error[E0382]: use of moved value: `x`
  --> src/test/run-pass/move-guard-const.rs:22:24
   |
21 |         (2, 1) if take(x) => (),
   |                        - value moved here
22 |         (1, 2) if take(x) => (),
   |                        ^ value used here after move
   |
   = note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait

error: aborting due to previous error
@nikomatsakis nikomatsakis added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-NLL Area: Non-lexical lifetimes (NLL) WG-compiler-nll and removed I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Jan 19, 2018
@nikomatsakis nikomatsakis added this to the NLL: Valid code works milestone Jan 19, 2018
@nikomatsakis
Copy link
Contributor

Ah, this is a known issue actually.

@nikomatsakis
Copy link
Contributor

Dup of #47295

@nikomatsakis
Copy link
Contributor

nikomatsakis commented Jan 19, 2018

Well, related to #47295 anyway. I'm going to keep the issue open, but we have to decide if this test is valid or not.

@nikomatsakis nikomatsakis assigned pnkfelix and unassigned pnkfelix Jan 22, 2018
@nikomatsakis nikomatsakis added the NLL-complete Working towards the "valid code works" goal label Mar 14, 2018
@jkordish jkordish added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Apr 23, 2018
@pnkfelix
Copy link
Member

pnkfelix commented Jul 11, 2018

We moved this to a compile-fail test in PR #49447

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-NLL Area: Non-lexical lifetimes (NLL) C-enhancement Category: An issue proposing an enhancement or a PR with one. NLL-complete Working towards the "valid code works" goal T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants