Skip to content

Commit 83ad5bf

Browse files
Bless tests, remove tests that don't matter anymore
1 parent fe2473d commit 83ad5bf

7 files changed

+12
-146
lines changed

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

+1-4
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::vec;
89

910
fn main() {
1011
let array = [0; 10];
@@ -15,10 +16,6 @@ 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
21-
2219
let _: Iter<'_, i32> = Rc::new(array).into_iter();
2320
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
2421
//~| WARNING this changes meaning

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:19: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:22: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:29: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

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
use std::array::IntoIter;
55
use std::ops::Deref;
66
use std::rc::Rc;
7+
use std::vec;
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+
// and for `Box<[T; N]>`, we use `vec::IntoIter`, since #124108.
15+
let _: vec::IntoIter<i32> = Box::new(array).into_iter();
1416

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

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

-26
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,6 @@ 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
36-
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
49-
5024
// Expressions that should not
5125
(&[1, 2]).into_iter();
5226
(&small).into_iter();

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

-26
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,6 @@ 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).into_iter();
25-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
26-
//~| WARNING this changes meaning
27-
Box::new([1, 2]).into_iter();
28-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
29-
//~| WARNING this changes meaning
30-
Box::new(big).into_iter();
31-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
32-
//~| WARNING this changes meaning
33-
Box::new([0u8; 33]).into_iter();
34-
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
35-
//~| WARNING this changes meaning
36-
37-
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
40-
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
43-
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
46-
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
49-
5024
// Expressions that should not
5125
(&[1, 2]).into_iter();
5226
(&small).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

tests/ui/traits/method-on-unbounded-type-param.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ LL | x.cmp(&x);
7676
which is required by `&mut dyn T: Iterator`
7777
= help: items from traits can only be used if the trait is implemented and in scope
7878
= note: the following traits define an item `cmp`, perhaps you need to implement one of them:
79-
candidate #1: `Iterator`
80-
candidate #2: `Ord`
79+
candidate #1: `Ord`
80+
= note: the trait `Iterator` defines an item `cmp`, but is explicitly unimplemented
8181

8282
error: aborting due to 4 previous errors
8383

0 commit comments

Comments
 (0)