Skip to content

Commit e2aad3f

Browse files
committed
fix the relevant tests
1 parent 0661c2d commit e2aad3f

File tree

2 files changed

+36
-20
lines changed

2 files changed

+36
-20
lines changed

src/test/ui/suggestions/slice-issue-87994.stderr

+28-16
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ error[E0277]: the size for values of type `[i32]` cannot be known at compilation
22
--> $DIR/slice-issue-87994.rs:3:12
33
|
44
LL | for _ in v[1..] {
5-
| ^^^^^^
6-
| |
7-
| expected an implementor of trait `IntoIterator`
8-
| help: consider borrowing here: `&v[1..]`
5+
| ^^^^^^ expected an implementor of trait `IntoIterator`
96
|
107
= note: the trait bound `[i32]: IntoIterator` is not satisfied
118
= note: required because of the requirements on the impl of `IntoIterator` for `[i32]`
@@ -14,15 +11,18 @@ note: required by `into_iter`
1411
|
1512
LL | fn into_iter(self) -> Self::IntoIter;
1613
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14+
help: consider borrowing here
15+
|
16+
LL | for _ in &v[1..] {
17+
| ~~~~~~~
18+
LL | for _ in &mut v[1..] {
19+
| ~~~~~~~~~~~
1720

1821
error[E0277]: `[i32]` is not an iterator
1922
--> $DIR/slice-issue-87994.rs:3:12
2023
|
2124
LL | for _ in v[1..] {
22-
| ^^^^^^
23-
| |
24-
| expected an implementor of trait `IntoIterator`
25-
| help: consider borrowing here: `&v[1..]`
25+
| ^^^^^^ expected an implementor of trait `IntoIterator`
2626
|
2727
= note: the trait bound `[i32]: IntoIterator` is not satisfied
2828
= note: required because of the requirements on the impl of `IntoIterator` for `[i32]`
@@ -31,15 +31,18 @@ note: required by `into_iter`
3131
|
3232
LL | fn into_iter(self) -> Self::IntoIter;
3333
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
34+
help: consider borrowing here
35+
|
36+
LL | for _ in &v[1..] {
37+
| ~~~~~~~
38+
LL | for _ in &mut v[1..] {
39+
| ~~~~~~~~~~~
3440

3541
error[E0277]: the size for values of type `[K]` cannot be known at compilation time
3642
--> $DIR/slice-issue-87994.rs:11:13
3743
|
3844
LL | for i2 in v2[1..] {
39-
| ^^^^^^^
40-
| |
41-
| expected an implementor of trait `IntoIterator`
42-
| help: consider borrowing here: `&v2[1..]`
45+
| ^^^^^^^ expected an implementor of trait `IntoIterator`
4346
|
4447
= note: the trait bound `[K]: IntoIterator` is not satisfied
4548
= note: required because of the requirements on the impl of `IntoIterator` for `[K]`
@@ -48,15 +51,18 @@ note: required by `into_iter`
4851
|
4952
LL | fn into_iter(self) -> Self::IntoIter;
5053
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
54+
help: consider borrowing here
55+
|
56+
LL | for i2 in &v2[1..] {
57+
| ~~~~~~~~
58+
LL | for i2 in &mut v2[1..] {
59+
| ~~~~~~~~~~~~
5160

5261
error[E0277]: `[K]` is not an iterator
5362
--> $DIR/slice-issue-87994.rs:11:13
5463
|
5564
LL | for i2 in v2[1..] {
56-
| ^^^^^^^
57-
| |
58-
| expected an implementor of trait `IntoIterator`
59-
| help: consider borrowing here: `&v2[1..]`
65+
| ^^^^^^^ expected an implementor of trait `IntoIterator`
6066
|
6167
= note: the trait bound `[K]: IntoIterator` is not satisfied
6268
= note: required because of the requirements on the impl of `IntoIterator` for `[K]`
@@ -65,6 +71,12 @@ note: required by `into_iter`
6571
|
6672
LL | fn into_iter(self) -> Self::IntoIter;
6773
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
74+
help: consider borrowing here
75+
|
76+
LL | for i2 in &v2[1..] {
77+
| ~~~~~~~~
78+
LL | for i2 in &mut v2[1..] {
79+
| ~~~~~~~~~~~~
6880

6981
error: aborting due to 4 previous errors
7082

src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr

+8-4
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,8 @@ error[E0277]: `main::TestType` cannot be sent between threads safely
102102
--> $DIR/negated-auto-traits-error.rs:66:13
103103
|
104104
LL | is_sync(Outer2(TestType));
105-
| ------- ^^^^^^^^^^^^^^^^
106-
| | |
107-
| | expected an implementor of trait `Sync`
108-
| | help: consider borrowing here: `&Outer2(TestType)`
105+
| ------- ^^^^^^^^^^^^^^^^ expected an implementor of trait `Sync`
106+
| |
109107
| required by a bound introduced by this call
110108
|
111109
= note: the trait bound `main::TestType: Sync` is not satisfied
@@ -119,6 +117,12 @@ note: required by a bound in `is_sync`
119117
|
120118
LL | fn is_sync<T: Sync>(_: T) {}
121119
| ^^^^ required by this bound in `is_sync`
120+
help: consider borrowing here
121+
|
122+
LL | is_sync(&Outer2(TestType));
123+
| ~~~~~~~~~~~~~~~~~
124+
LL | is_sync(&mut Outer2(TestType));
125+
| ~~~~~~~~~~~~~~~~~~~~~
122126

123127
error: aborting due to 7 previous errors
124128

0 commit comments

Comments
 (0)