Skip to content

Commit 7a53508

Browse files
committedDec 10, 2024
Bless tests
Note: this removes warnings, as this breakage was deemed acceptable, see <rust-lang#124108 (comment)>
1 parent a7374b8 commit 7a53508

6 files changed

+18
-131
lines changed
 

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

+2-3
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

+5-14
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
| ^^^^^^^^^
@@ -17,16 +17,7 @@ LL | let _: Iter<'_, i32> = IntoIterator::into_iter(array);
1717
| ++++++++++++++++++++++++ ~
1818

1919
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
20-
--> $DIR/into-iter-on-arrays-2018.rs:18:44
21-
|
22-
LL | let _: Iter<'_, i32> = Box::new(array).into_iter();
23-
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
24-
|
25-
= warning: this changes meaning in Rust 2021
26-
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
27-
28-
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
29-
--> $DIR/into-iter-on-arrays-2018.rs:22:43
20+
--> $DIR/into-iter-on-arrays-2018.rs:21:43
3021
|
3122
LL | let _: Iter<'_, i32> = Rc::new(array).into_iter();
3223
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
@@ -35,7 +26,7 @@ LL | let _: Iter<'_, i32> = Rc::new(array).into_iter();
3526
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
3627

3728
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
38-
--> $DIR/into-iter-on-arrays-2018.rs:25:41
29+
--> $DIR/into-iter-on-arrays-2018.rs:24:41
3930
|
4031
LL | let _: Iter<'_, i32> = Array(array).into_iter();
4132
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
@@ -44,7 +35,7 @@ LL | let _: Iter<'_, i32> = Array(array).into_iter();
4435
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
4536

4637
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
47-
--> $DIR/into-iter-on-arrays-2018.rs:32:24
38+
--> $DIR/into-iter-on-arrays-2018.rs:31:24
4839
|
4940
LL | for _ in [1, 2, 3].into_iter() {}
5041
| ^^^^^^^^^
@@ -61,5 +52,5 @@ LL - for _ in [1, 2, 3].into_iter() {}
6152
LL + for _ in [1, 2, 3] {}
6253
|
6354

64-
warning: 5 warnings emitted
55+
warning: 4 warnings emitted
6556

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

+2-1
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

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

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

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

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

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

-16
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,14 @@ fn main() {
2222
//~| WARNING this changes meaning
2323

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

3729
Box::new(Box::new(small)).into_iter();
38-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
39-
//~| WARNING this changes meaning
4030
Box::new(Box::new([1, 2])).into_iter();
41-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
42-
//~| WARNING this changes meaning
4331
Box::new(Box::new(big)).into_iter();
44-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
45-
//~| WARNING this changes meaning
4632
Box::new(Box::new([0u8; 33])).into_iter();
47-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
48-
//~| WARNING this changes meaning
4933

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

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

+1-73
Original file line numberDiff line numberDiff line change
@@ -67,77 +67,5 @@ help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicit
6767
LL | IntoIterator::into_iter([0u8; 33]);
6868
| ++++++++++++++++++++++++ ~
6969

70-
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
71-
--> $DIR/into-iter-on-arrays-lint.rs:24:21
72-
|
73-
LL | Box::new(small).into_iter();
74-
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
75-
|
76-
= warning: this changes meaning in Rust 2021
77-
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
78-
79-
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
80-
--> $DIR/into-iter-on-arrays-lint.rs:27:22
81-
|
82-
LL | Box::new([1, 2]).into_iter();
83-
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
84-
|
85-
= warning: this changes meaning in Rust 2021
86-
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
87-
88-
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
89-
--> $DIR/into-iter-on-arrays-lint.rs:30:19
90-
|
91-
LL | Box::new(big).into_iter();
92-
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
93-
|
94-
= warning: this changes meaning in Rust 2021
95-
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
96-
97-
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
98-
--> $DIR/into-iter-on-arrays-lint.rs:33:25
99-
|
100-
LL | Box::new([0u8; 33]).into_iter();
101-
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
102-
|
103-
= warning: this changes meaning in Rust 2021
104-
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
105-
106-
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
107-
--> $DIR/into-iter-on-arrays-lint.rs:37:31
108-
|
109-
LL | Box::new(Box::new(small)).into_iter();
110-
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
111-
|
112-
= warning: this changes meaning in Rust 2021
113-
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
114-
115-
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
116-
--> $DIR/into-iter-on-arrays-lint.rs:40:32
117-
|
118-
LL | Box::new(Box::new([1, 2])).into_iter();
119-
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
120-
|
121-
= warning: this changes meaning in Rust 2021
122-
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
123-
124-
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
125-
--> $DIR/into-iter-on-arrays-lint.rs:43:29
126-
|
127-
LL | Box::new(Box::new(big)).into_iter();
128-
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
129-
|
130-
= warning: this changes meaning in Rust 2021
131-
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
132-
133-
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
134-
--> $DIR/into-iter-on-arrays-lint.rs:46:35
135-
|
136-
LL | Box::new(Box::new([0u8; 33])).into_iter();
137-
| ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
138-
|
139-
= warning: this changes meaning in Rust 2021
140-
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
141-
142-
warning: 12 warnings emitted
70+
warning: 4 warnings emitted
14371

0 commit comments

Comments
 (0)
Please sign in to comment.