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:
Jieyou Xu 2025-04-19 17:05:05 +08:00
parent a86df238d3
commit 40b73322b9
No known key found for this signature in database
GPG key ID: 045B995028EA6AFC
5 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,5 @@
//! Smoke test for overloaded compound assignments cross-crate.
//@ run-pass //@ run-pass
//@ aux-build:augmented_assignments.rs //@ aux-build:augmented_assignments.rs

View file

@ -1,3 +1,6 @@
//! Check that overloaded compound assignment operators respect usual borrowck rules and emit
//! reasonable diagnostics.
use std::ops::AddAssign; use std::ops::AddAssign;
#[derive(Clone)] #[derive(Clone)]

View file

@ -1,5 +1,5 @@
error[E0505]: cannot move out of `x` because it is borrowed 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); LL | let mut x = Int(1);
| ----- binding `x` declared here | ----- binding `x` declared here
@ -10,7 +10,7 @@ LL | x;
| ^ move out of `x` occurs here | ^ move out of `x` occurs here
error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable 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 LL | y
| ^ cannot borrow as mutable | ^ cannot borrow as mutable