Skip to content

Commit 72ea626

Browse files
committed
Bless tests
Note: this removes warnings, as this breakage was deemed acceptable, see <#124108 (comment)>
1 parent 94ca877 commit 72ea626

6 files changed

Lines changed: 18 additions & 131 deletions

tests/ui/iterators/into-iter-on-arrays-2018.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use std::array::IntoIter;
55
use std::ops::Deref;
66
use std::rc::Rc;
77
use std::slice::Iter;
8+
use std::boxed::BoxedArrayIntoIter;
89

910
fn main() {
1011
let array = [0; 10];
@@ -15,9 +16,7 @@ fn main() {
1516
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
1617
//~| WARNING this changes meaning
1718

18-
let _: Iter<'_, i32> = Box::new(array).into_iter();
19-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
20-
//~| WARNING this changes meaning
19+
let _: BoxedArrayIntoIter<i32, 10> = Box::new(array).into_iter();
2120

2221
let _: Iter<'_, i32> = Rc::new(array).into_iter();
2322
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`

tests/ui/iterators/into-iter-on-arrays-2018.stderr

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021
2-
--> $DIR/into-iter-on-arrays-2018.rs:14:34
2+
--> $DIR/into-iter-on-arrays-2018.rs:15:34
33
|
44
LL | let _: Iter<'_, i32> = array.into_iter();
55
| ^^^^^^^^^
@@ -19,16 +19,7 @@ LL + let _: Iter<'_, i32> = IntoIterator::into_iter(array);
1919
|
2020

2121
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021
22-
--> $DIR/into-iter-on-arrays-2018.rs:18:44
23-
|
24-
LL | let _: Iter<'_, i32> = Box::new(array).into_iter();
25-
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
26-
|
27-
= warning: this changes meaning in Rust 2021
28-
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html>
29-
30-
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021
31-
--> $DIR/into-iter-on-arrays-2018.rs:22:43
22+
--> $DIR/into-iter-on-arrays-2018.rs:21:43
3223
|
3324
LL | let _: Iter<'_, i32> = Rc::new(array).into_iter();
3425
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
@@ -37,7 +28,7 @@ LL | let _: Iter<'_, i32> = Rc::new(array).into_iter();
3728
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html>
3829

3930
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021
40-
--> $DIR/into-iter-on-arrays-2018.rs:25:41
31+
--> $DIR/into-iter-on-arrays-2018.rs:24:41
4132
|
4233
LL | let _: Iter<'_, i32> = Array(array).into_iter();
4334
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
@@ -46,7 +37,7 @@ LL | let _: Iter<'_, i32> = Array(array).into_iter();
4637
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html>
4738

4839
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021
49-
--> $DIR/into-iter-on-arrays-2018.rs:32:24
40+
--> $DIR/into-iter-on-arrays-2018.rs:31:24
5041
|
5142
LL | for _ in [1, 2, 3].into_iter() {}
5243
| ^^^^^^^^^
@@ -64,5 +55,5 @@ LL - for _ in [1, 2, 3].into_iter() {}
6455
LL + for _ in [1, 2, 3] {}
6556
|
6657

67-
warning: 5 warnings emitted
58+
warning: 4 warnings emitted
6859

tests/ui/iterators/into-iter-on-arrays-2021.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
use std::array::IntoIter;
55
use std::ops::Deref;
66
use std::rc::Rc;
7+
use std::boxed::BoxedArrayIntoIter;
78

89
fn main() {
910
let array = [0; 10];
1011

1112
// In 2021, the method dispatches to `IntoIterator for [T; N]`.
1213
let _: IntoIter<i32, 10> = array.into_iter();
13-
let _: IntoIter<i32, 10> = Box::new(array).into_iter();
14+
let _: BoxedArrayIntoIter<i32, 10> = Box::new(array).into_iter();
1415

1516
// The `array_into_iter` lint doesn't cover other wrappers that deref to an array.
1617
let _: IntoIter<i32, 10> = Rc::new(array).into_iter();

tests/ui/iterators/into-iter-on-arrays-lint.fixed

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,15 @@ fn main() {
2222
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
2323
//~| WARNING this changes meaning
2424

25-
Box::new(small).iter();
26-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
27-
//~| WARNING this changes meaning
28-
Box::new([1, 2]).iter();
29-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
30-
//~| WARNING this changes meaning
31-
Box::new(big).iter();
32-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
33-
//~| WARNING this changes meaning
34-
Box::new([0u8; 33]).iter();
35-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
36-
//~| WARNING this changes meaning
25+
Box::new(small).into_iter();
26+
Box::new([1, 2]).into_iter();
27+
Box::new(big).into_iter();
28+
Box::new([0u8; 33]).into_iter();
3729

38-
Box::new(Box::new(small)).iter();
39-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
40-
//~| WARNING this changes meaning
41-
Box::new(Box::new([1, 2])).iter();
42-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
43-
//~| WARNING this changes meaning
44-
Box::new(Box::new(big)).iter();
45-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
46-
//~| WARNING this changes meaning
47-
Box::new(Box::new([0u8; 33])).iter();
48-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
49-
//~| WARNING this changes meaning
30+
Box::new(Box::new(small)).into_iter();
31+
Box::new(Box::new([1, 2])).into_iter();
32+
Box::new(Box::new(big)).into_iter();
33+
Box::new(Box::new([0u8; 33])).into_iter();
5034

5135
// Expressions that should not
5236
(&[1, 2]).into_iter();

tests/ui/iterators/into-iter-on-arrays-lint.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,14 @@ fn main() {
2323
//~| WARNING this changes meaning
2424

2525
Box::new(small).into_iter();
26-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
27-
//~| WARNING this changes meaning
2826
Box::new([1, 2]).into_iter();
29-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
30-
//~| WARNING this changes meaning
3127
Box::new(big).into_iter();
32-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
33-
//~| WARNING this changes meaning
3428
Box::new([0u8; 33]).into_iter();
35-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
36-
//~| WARNING this changes meaning
3729

3830
Box::new(Box::new(small)).into_iter();
39-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
40-
//~| WARNING this changes meaning
4131
Box::new(Box::new([1, 2])).into_iter();
42-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
43-
//~| WARNING this changes meaning
4432
Box::new(Box::new(big)).into_iter();
45-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
46-
//~| WARNING this changes meaning
4733
Box::new(Box::new([0u8; 33])).into_iter();
48-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
49-
//~| WARNING this changes meaning
5034

5135
// Expressions that should not
5236
(&[1, 2]).into_iter();

tests/ui/iterators/into-iter-on-arrays-lint.stderr

Lines changed: 1 addition & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -75,77 +75,5 @@ LL - [0u8; 33].into_iter();
7575
LL + IntoIterator::into_iter([0u8; 33]);
7676
|
7777

78-
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021
79-
--> $DIR/into-iter-on-arrays-lint.rs:25:21
80-
|
81-
LL | Box::new(small).into_iter();
82-
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
83-
|
84-
= warning: this changes meaning in Rust 2021
85-
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html>
86-
87-
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021
88-
--> $DIR/into-iter-on-arrays-lint.rs:28:22
89-
|
90-
LL | Box::new([1, 2]).into_iter();
91-
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
92-
|
93-
= warning: this changes meaning in Rust 2021
94-
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html>
95-
96-
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021
97-
--> $DIR/into-iter-on-arrays-lint.rs:31:19
98-
|
99-
LL | Box::new(big).into_iter();
100-
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
101-
|
102-
= warning: this changes meaning in Rust 2021
103-
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html>
104-
105-
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021
106-
--> $DIR/into-iter-on-arrays-lint.rs:34:25
107-
|
108-
LL | Box::new([0u8; 33]).into_iter();
109-
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
110-
|
111-
= warning: this changes meaning in Rust 2021
112-
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html>
113-
114-
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021
115-
--> $DIR/into-iter-on-arrays-lint.rs:38:31
116-
|
117-
LL | Box::new(Box::new(small)).into_iter();
118-
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
119-
|
120-
= warning: this changes meaning in Rust 2021
121-
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html>
122-
123-
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021
124-
--> $DIR/into-iter-on-arrays-lint.rs:41:32
125-
|
126-
LL | Box::new(Box::new([1, 2])).into_iter();
127-
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
128-
|
129-
= warning: this changes meaning in Rust 2021
130-
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html>
131-
132-
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021
133-
--> $DIR/into-iter-on-arrays-lint.rs:44:29
134-
|
135-
LL | Box::new(Box::new(big)).into_iter();
136-
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
137-
|
138-
= warning: this changes meaning in Rust 2021
139-
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html>
140-
141-
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021
142-
--> $DIR/into-iter-on-arrays-lint.rs:47:35
143-
|
144-
LL | Box::new(Box::new([0u8; 33])).into_iter();
145-
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
146-
|
147-
= warning: this changes meaning in Rust 2021
148-
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html>
149-
150-
warning: 12 warnings emitted
78+
warning: 4 warnings emitted
15179

0 commit comments

Comments
 (0)