Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 204e9a0

Browse files
authored
Rollup merge of rust-lang#140036 - jieyouxu:ui-cleanup-4, r=compiler-errors
Advent of `tests/ui` (misc cleanups and improvements) [4/N] Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang#133895. ### Review advice - Best reviewed commit-by-commit. - I can squash commits before merge, commits are separate to make it easier to review.
2 parents cac8bc3 + b47fe51 commit 204e9a0

11 files changed

+76
-33
lines changed

tests/ui/amdgpu-require-explicit-cpu.rs

Lines changed: 0 additions & 18 deletions
This file was deleted.

tests/ui/auto-instantiate.rs

Lines changed: 0 additions & 13 deletions
This file was deleted.

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

Lines changed: 2 additions & 0 deletions
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

tests/ui/augmented-assignments.rs renamed to tests/ui/borrowck/augmented-assignments.rs

Lines changed: 3 additions & 0 deletions
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)]

tests/ui/augmented-assignments.stderr renamed to tests/ui/borrowck/augmented-assignments.stderr

Lines changed: 2 additions & 2 deletions
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
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//! Check that type parameters in generic function arg position and in "nested" return type position
2+
//! can be inferred on an invocation of the generic function.
3+
//!
4+
//! See <https://github.com/rust-lang/rust/issues/45>.
5+
6+
//@ run-pass
7+
8+
#![allow(dead_code)]
9+
#[derive(Debug)]
10+
struct Pair<T, U> {
11+
a: T,
12+
b: U,
13+
}
14+
15+
struct Triple {
16+
x: isize,
17+
y: isize,
18+
z: isize,
19+
}
20+
21+
fn f<T, U>(x: T, y: U) -> Pair<T, U> {
22+
return Pair { a: x, b: y };
23+
}
24+
25+
pub fn main() {
26+
println!("{}", f(Triple {x: 3, y: 4, z: 5}, 4).a.x);
27+
println!("{}", f(5, 6).a);
28+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
error: target requires explicitly specifying a cpu with `-C target-cpu`
2+
3+
error: aborting due to 1 previous error
4+

0 commit comments

Comments
 (0)