Skip to content

Commit 40b7332

Browse files
committed
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/`.
1 parent a86df23 commit 40b7332

5 files changed

+7
-2
lines changed
File renamed without changes.

Diff for: tests/ui/augmented-assignments-feature-gate-cross.rs renamed to tests/ui/binop/augmented-assignments-cross-crate.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Smoke test for overloaded compound assignments cross-crate.
2+
13
//@ run-pass
24
//@ aux-build:augmented_assignments.rs
35

Diff for: tests/ui/augmented-assignments.rs renamed to tests/ui/borrowck/augmented-assignments.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//! Check that overloaded compound assignment operators respect usual borrowck rules and emit
2+
//! reasonable diagnostics.
3+
14
use std::ops::AddAssign;
25

36
#[derive(Clone)]

Diff for: tests/ui/augmented-assignments.stderr renamed to tests/ui/borrowck/augmented-assignments.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0505]: cannot move out of `x` because it is borrowed
2-
--> $DIR/augmented-assignments.rs:17:5
2+
--> $DIR/augmented-assignments.rs:20:5
33
|
44
LL | let mut x = Int(1);
55
| ----- binding `x` declared here
@@ -10,7 +10,7 @@ LL | x;
1010
| ^ move out of `x` occurs here
1111

1212
error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
13-
--> $DIR/augmented-assignments.rs:24:5
13+
--> $DIR/augmented-assignments.rs:27:5
1414
|
1515
LL | y
1616
| ^ cannot borrow as mutable

0 commit comments

Comments
 (0)