Skip to content

Commit 35aa2e9

Browse files
authored
Unrolled build for #149443
Rollup merge of #149443 - reddevilmidzy:t6, r=Kivooeo Tidying up UI tests [6/N] > [!NOTE] > Intermediate commits are intended to help review, but will be squashed add comment commit prior to merge. part of #133895 removed directory `tests/ui/trait-objects`, `tests/ui/for`, `tests/ui/warnings` `trait-objects` -> `traits/object` `for` -> `for-loop-while` (except `for/issue-20605.rs` test. this relocated to `traits/dyn-iterator-deref-in-for-loop.rs`) `warnings` -> `resolve`, `entry-point` r? Kivooeo
2 parents b33119f + 073f5e2 commit 35aa2e9

30 files changed

+107
-118
lines changed

src/tools/tidy/src/issues.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,6 @@ ui/for-loop-while/issue-1257.rs
10141014
ui/for-loop-while/issue-2216.rs
10151015
ui/for-loop-while/issue-51345.rs
10161016
ui/for-loop-while/issue-69841.rs
1017-
ui/for/issue-20605.rs
10181017
ui/foreign/issue-74120-lowering-of-ffi-block-bodies.rs
10191018
ui/foreign/issue-91370-foreign-fn-block-impl.rs
10201019
ui/foreign/issue-99276-same-type-lifetimes.rs

tests/ui/README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -573,12 +573,6 @@ Exercises the `format!` macro.
573573

574574
A broad category of tests on functions.
575575

576-
## `tests/ui/for/`: `for` keyword
577-
578-
Tests on the `for` keyword and some of its associated errors, such as attempting to write the faulty pattern `for _ in 0..1 {} else {}`.
579-
580-
**FIXME**: Should be merged with `ui/for-loop-while`.
581-
582576
## `tests/ui/force-inlining/`: `#[rustc_force_inline]`
583577

584578
Tests for `#[rustc_force_inline]`, which will force a function to always be labelled as inline by the compiler (it will be inserted at the point of its call instead of being used as a normal function call.) If the compiler is unable to inline the function, an error will be reported. See <https://github.com/rust-lang/rust/pull/134082>.
@@ -1521,10 +1515,6 @@ Tests on `enum` variants.
15211515

15221516
**FIXME**: Contains a single test described as "Check that rustc accepts various version info flags.", should be rehomed.
15231517

1524-
## `tests/ui/warnings/`
1525-
1526-
**FIXME**: Contains a single test on non-explicit paths (`::one()`). Should be rehomed probably to `tests/ui/resolve/`.
1527-
15281518
## `tests/ui/wasm/`
15291519

15301520
These tests target the `wasm32` architecture specifically. They are usually regression tests for WASM-specific bugs which were observed in the past.
File renamed without changes.

tests/ui/for/for-c-in-str.rs renamed to tests/ui/for-loop-while/for-c-in-str.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// E0277 should point exclusively at line 6, not the entire for loop span
1+
//! Tests that the E0277 error span, generated by the `for` loop desugaring,
2+
//! points exclusively to the loop header expression and not the full loop block.
23
34
fn main() {
45
for c in "asdf" {

tests/ui/for/for-c-in-str.stderr renamed to tests/ui/for-loop-while/for-c-in-str.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: `&str` is not an iterator
2-
--> $DIR/for-c-in-str.rs:4:14
2+
--> $DIR/for-c-in-str.rs:5:14
33
|
44
LL | for c in "asdf" {
55
| ^^^^^^ `&str` is not an iterator; try calling `.chars()` or `.bytes()`
File renamed without changes.
File renamed without changes.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//! Tests that a struct with a `next` method but without the `Iterator` trait
2+
//! implementation yields an error in a `for` loop.
3+
4+
struct MyStruct {
5+
x: isize,
6+
y: isize,
7+
}
8+
9+
impl MyStruct {
10+
fn next(&mut self) -> Option<isize> {
11+
Some(self.x)
12+
}
13+
}
14+
15+
pub fn main() {
16+
let mut bogus = MyStruct { x: 1, y: 2 };
17+
for x in bogus {
18+
//~^ ERROR `MyStruct` is not an iterator
19+
drop(x);
20+
}
21+
}

0 commit comments

Comments
 (0)