tests: adjust some augmented-assignment*
tests
- `tests/ui/augmented-assignment-feature-gate-cross.rs`: - This was *originally* to feature-gate overloaded OpAssign cross-crate, but now let's keep it as a smoke test. - Renamed as `augmented-assignment-cross-crate.rs`. - Relocated under `tests/ui/binop/`. - `tests/ui/augmented-assignments.rs`: - Documented test intent. - Moved under `tests/ui/borrowck/`. - `tests/ui/augmented-assignment-rpass.rs`: - Renamed to drop the `-rpass` suffix, since this was leftover from when `run-pass` test suite was a thing. - Moved under `tests/ui/binop/`.
This commit is contained in:
parent
a86df238d3
commit
40b73322b9
5 changed files with 7 additions and 2 deletions
|
@ -1,3 +1,5 @@
|
|||
//! Smoke test for overloaded compound assignments cross-crate.
|
||||
|
||||
//@ run-pass
|
||||
//@ aux-build:augmented_assignments.rs
|
||||
|
|
@ -1,3 +1,6 @@
|
|||
//! Check that overloaded compound assignment operators respect usual borrowck rules and emit
|
||||
//! reasonable diagnostics.
|
||||
|
||||
use std::ops::AddAssign;
|
||||
|
||||
#[derive(Clone)]
|
|
@ -1,5 +1,5 @@
|
|||
error[E0505]: cannot move out of `x` because it is borrowed
|
||||
--> $DIR/augmented-assignments.rs:17:5
|
||||
--> $DIR/augmented-assignments.rs:20:5
|
||||
|
|
||||
LL | let mut x = Int(1);
|
||||
| ----- binding `x` declared here
|
||||
|
@ -10,7 +10,7 @@ LL | x;
|
|||
| ^ move out of `x` occurs here
|
||||
|
||||
error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
|
||||
--> $DIR/augmented-assignments.rs:24:5
|
||||
--> $DIR/augmented-assignments.rs:27:5
|
||||
|
|
||||
LL | y
|
||||
| ^ cannot borrow as mutable
|
Loading…
Add table
Add a link
Reference in a new issue