Skip to content

Commit 922249c

Browse files
committed
Update tests
1 parent a152770 commit 922249c

File tree

4 files changed

+9
-56
lines changed

4 files changed

+9
-56
lines changed

src/test/ui/error-codes/E0657.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn free_fn_capture_hrtb_in_impl_trait()
1919
-> Box<for<'a> Id<impl Lt<'a>>>
2020
//~^ ERROR `impl Trait` can only capture lifetimes bound at the fn or impl level [E0657]
2121
{
22-
() //~ ERROR mismatched types
22+
()
2323
}
2424

2525
struct Foo;
@@ -28,7 +28,7 @@ impl Foo {
2828
-> Box<for<'a> Id<impl Lt<'a>>>
2929
//~^ ERROR `impl Trait` can only capture lifetimes bound at the fn or impl level
3030
{
31-
() //~ ERROR mismatched types
31+
()
3232
}
3333
}
3434

src/test/ui/error-codes/E0657.stderr

+2-21
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,6 @@ error[E0657]: `impl Trait` can only capture lifetimes bound at the fn or impl le
1010
LL | -> Box<for<'a> Id<impl Lt<'a>>>
1111
| ^^
1212

13-
error[E0308]: mismatched types
14-
--> $DIR/E0657.rs:22:5
15-
|
16-
LL | () //~ ERROR mismatched types
17-
| ^^ expected struct `std::boxed::Box`, found ()
18-
|
19-
= note: expected type `std::boxed::Box<Id<_> + 'static>`
20-
found type `()`
21-
22-
error[E0308]: mismatched types
23-
--> $DIR/E0657.rs:31:9
24-
|
25-
LL | () //~ ERROR mismatched types
26-
| ^^ expected struct `std::boxed::Box`, found ()
27-
|
28-
= note: expected type `std::boxed::Box<Id<_> + 'static>`
29-
found type `()`
30-
31-
error: aborting due to 4 previous errors
13+
error: aborting due to 2 previous errors
3214

33-
Some errors occurred: E0308, E0657.
34-
For more information about an error, try `rustc --explain E0308`.
15+
For more information about this error, try `rustc --explain E0657`.

src/test/ui/impl_trait_projections.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ fn projection_with_named_trait_is_disallowed(x: impl Iterator)
3434
fn projection_with_named_trait_inside_path_is_disallowed()
3535
-> <::std::ops::Range<impl Debug> as Iterator>::Item
3636
//~^ ERROR `impl Trait` is not allowed in path parameters
37-
//~| ERROR trait bound `impl std::fmt::Debug: std::iter::Step` is not satisfied
38-
{ //~ ERROR trait bound `impl std::fmt::Debug: std::iter::Step` is not satisfied
39-
(1i32..100).next().unwrap() //~ ERROR mismatched types
37+
{
38+
(1i32..100).next().unwrap()
4039
}
4140

4241
fn projection_from_impl_trait_inside_dyn_trait_is_disallowed()

src/test/ui/impl_trait_projections.stderr

+3-30
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ LL | -> <::std::ops::Range<impl Debug> as Iterator>::Item
1717
| ^^^^^^^^^^
1818

1919
error[E0667]: `impl Trait` is not allowed in path parameters
20-
--> $DIR/impl_trait_projections.rs:43:29
20+
--> $DIR/impl_trait_projections.rs:42:29
2121
|
2222
LL | -> <dyn Iterator<Item = impl Debug> as Iterator>::Item
2323
| ^^^^^^^^^^
@@ -30,34 +30,7 @@ LL | fn projection_is_disallowed(x: impl Iterator) -> <impl Iterator>::Item {
3030
|
3131
= note: specify the type using the syntax `<impl std::iter::Iterator as Trait>::Item`
3232

33-
error[E0277]: the trait bound `impl std::fmt::Debug: std::iter::Step` is not satisfied
34-
--> $DIR/impl_trait_projections.rs:38:1
35-
|
36-
LL | / { //~ ERROR trait bound `impl std::fmt::Debug: std::iter::Step` is not satisfied
37-
LL | | (1i32..100).next().unwrap() //~ ERROR mismatched types
38-
LL | | }
39-
| |_^ the trait `std::iter::Step` is not implemented for `impl std::fmt::Debug`
40-
|
41-
= note: required because of the requirements on the impl of `std::iter::Iterator` for `std::ops::Range<impl std::fmt::Debug>`
42-
43-
error[E0308]: mismatched types
44-
--> $DIR/impl_trait_projections.rs:39:5
45-
|
46-
LL | (1i32..100).next().unwrap() //~ ERROR mismatched types
47-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected anonymized type, found i32
48-
|
49-
= note: expected type `impl std::fmt::Debug`
50-
found type `i32`
51-
52-
error[E0277]: the trait bound `impl std::fmt::Debug: std::iter::Step` is not satisfied
53-
--> $DIR/impl_trait_projections.rs:35:8
54-
|
55-
LL | -> <::std::ops::Range<impl Debug> as Iterator>::Item
56-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::iter::Step` is not implemented for `impl std::fmt::Debug`
57-
|
58-
= note: required because of the requirements on the impl of `std::iter::Iterator` for `std::ops::Range<impl std::fmt::Debug>`
59-
60-
error: aborting due to 8 previous errors
33+
error: aborting due to 5 previous errors
6134

62-
Some errors occurred: E0223, E0277, E0308, E0667.
35+
Some errors occurred: E0223, E0667.
6336
For more information about an error, try `rustc --explain E0223`.

0 commit comments

Comments
 (0)