Skip to content

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

@spastorino

Description

@spastorino
$ 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

Metadata

Metadata

Assignees

Labels

A-NLLArea: Non-lexical lifetimes (NLL)C-enhancementCategory: An issue proposing an enhancement or a PR with one.NLL-completeWorking towards the "valid code works" goalT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions