Skip to content

Commit d9f15fa

Browse files
committed
Bless ui tests.
1 parent e740c7b commit d9f15fa

37 files changed

+454
-519
lines changed

tests/ui/associated-type-bounds/duplicate.stderr

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -208,17 +208,6 @@ LL | fn FRPIT1() -> impl Iterator<Item: Copy, Item: Send> {
208208
|
209209
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
210210

211-
error[E0282]: type annotations needed
212-
--> $DIR/duplicate.rs:136:5
213-
|
214-
LL | iter::empty()
215-
| ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty`
216-
|
217-
help: consider specifying the generic argument
218-
|
219-
LL | iter::empty::<T>()
220-
| +++++
221-
222211
error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
223212
--> $DIR/duplicate.rs:139:42
224213
|
@@ -237,17 +226,6 @@ LL | fn FRPIT2() -> impl Iterator<Item: Copy, Item: Copy> {
237226
|
238227
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
239228

240-
error[E0282]: type annotations needed
241-
--> $DIR/duplicate.rs:142:5
242-
|
243-
LL | iter::empty()
244-
| ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty`
245-
|
246-
help: consider specifying the generic argument
247-
|
248-
LL | iter::empty::<T>()
249-
| +++++
250-
251229
error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
252230
--> $DIR/duplicate.rs:145:45
253231
|
@@ -266,17 +244,6 @@ LL | fn FRPIT3() -> impl Iterator<Item: 'static, Item: 'static> {
266244
|
267245
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
268246

269-
error[E0282]: type annotations needed
270-
--> $DIR/duplicate.rs:148:5
271-
|
272-
LL | iter::empty()
273-
| ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty`
274-
|
275-
help: consider specifying the generic argument
276-
|
277-
LL | iter::empty::<T>()
278-
| +++++
279-
280247
error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
281248
--> $DIR/duplicate.rs:151:40
282249
|
@@ -697,6 +664,39 @@ LL | type A: Iterator<Item: 'static, Item: 'static>;
697664
|
698665
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
699666

667+
error[E0282]: type annotations needed
668+
--> $DIR/duplicate.rs:136:5
669+
|
670+
LL | iter::empty()
671+
| ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty`
672+
|
673+
help: consider specifying the generic argument
674+
|
675+
LL | iter::empty::<T>()
676+
| +++++
677+
678+
error[E0282]: type annotations needed
679+
--> $DIR/duplicate.rs:142:5
680+
|
681+
LL | iter::empty()
682+
| ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty`
683+
|
684+
help: consider specifying the generic argument
685+
|
686+
LL | iter::empty::<T>()
687+
| +++++
688+
689+
error[E0282]: type annotations needed
690+
--> $DIR/duplicate.rs:148:5
691+
|
692+
LL | iter::empty()
693+
| ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty`
694+
|
695+
help: consider specifying the generic argument
696+
|
697+
LL | iter::empty::<T>()
698+
| +++++
699+
700700
error: aborting due to 81 previous errors
701701

702702
Some errors have detailed explanations: E0282, E0719.

tests/ui/async-await/async-fn/edition-2015.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,20 @@ LL | fn foo(x: impl async Fn()) -> impl async Fn() { x }
3939
= help: to use an async block, remove the `||`: `async {`
4040

4141
error[E0658]: use of unstable library feature 'async_closure'
42-
--> $DIR/edition-2015.rs:1:22
42+
--> $DIR/edition-2015.rs:1:42
4343
|
4444
LL | fn foo(x: impl async Fn()) -> impl async Fn() { x }
45-
| ^^^^
45+
| ^^^^
4646
|
4747
= note: see issue #62290 <https://github.com/rust-lang/rust/issues/62290> for more information
4848
= help: add `#![feature(async_closure)]` to the crate attributes to enable
4949
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
5050

5151
error[E0658]: use of unstable library feature 'async_closure'
52-
--> $DIR/edition-2015.rs:1:42
52+
--> $DIR/edition-2015.rs:1:22
5353
|
5454
LL | fn foo(x: impl async Fn()) -> impl async Fn() { x }
55-
| ^^^^
55+
| ^^^^
5656
|
5757
= note: see issue #62290 <https://github.com/rust-lang/rust/issues/62290> for more information
5858
= help: add `#![feature(async_closure)]` to the crate attributes to enable

tests/ui/async-await/inference_var_self_argument.stderr

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
error[E0307]: invalid `self` parameter type: `&dyn Foo`
2+
--> $DIR/inference_var_self_argument.rs:5:24
3+
|
4+
LL | async fn foo(self: &dyn Foo) {
5+
| ^^^^^^^^
6+
|
7+
= note: type of `self` must be `Self` or a type that dereferences to it
8+
= help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
9+
110
error[E0038]: the trait `Foo` cannot be made into an object
211
--> $DIR/inference_var_self_argument.rs:5:5
312
|
@@ -13,15 +22,6 @@ LL | async fn foo(self: &dyn Foo) {
1322
| ^^^ ...because method `foo` is `async`
1423
= help: consider moving `foo` to another trait
1524

16-
error[E0307]: invalid `self` parameter type: `&dyn Foo`
17-
--> $DIR/inference_var_self_argument.rs:5:24
18-
|
19-
LL | async fn foo(self: &dyn Foo) {
20-
| ^^^^^^^^
21-
|
22-
= note: type of `self` must be `Self` or a type that dereferences to it
23-
= help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
24-
2525
error: aborting due to 2 previous errors
2626

2727
Some errors have detailed explanations: E0038, E0307.

tests/ui/async-await/issue-66312.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
error[E0308]: mismatched types
2-
--> $DIR/issue-66312.rs:9:8
3-
|
4-
LL | if x.is_some() {
5-
| ^^^^^^^^^^^ expected `bool`, found `()`
6-
71
error[E0307]: invalid `self` parameter type: `T`
82
--> $DIR/issue-66312.rs:4:22
93
|
@@ -13,6 +7,12 @@ LL | fn is_some(self: T);
137
= note: type of `self` must be `Self` or a type that dereferences to it
148
= help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
159

10+
error[E0308]: mismatched types
11+
--> $DIR/issue-66312.rs:9:8
12+
|
13+
LL | if x.is_some() {
14+
| ^^^^^^^^^^^ expected `bool`, found `()`
15+
1616
error: aborting due to 2 previous errors
1717

1818
Some errors have detailed explanations: E0307, E0308.

tests/ui/const-generics/opaque_types.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
error: `Foo` is forbidden as the type of a const generic parameter
2+
--> $DIR/opaque_types.rs:7:17
3+
|
4+
LL | fn foo<const C: Foo>() {}
5+
| ^^^
6+
|
7+
= note: the only supported types are integers, `bool`, and `char`
8+
19
error: item does not constrain `Foo::{opaque#0}`, but has it in its signature
210
--> $DIR/opaque_types.rs:7:4
311
|
@@ -68,14 +76,6 @@ LL | type Foo = impl Sized;
6876
| ^^^^^^^^^^
6977
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
7078

71-
error: `Foo` is forbidden as the type of a const generic parameter
72-
--> $DIR/opaque_types.rs:7:17
73-
|
74-
LL | fn foo<const C: Foo>() {}
75-
| ^^^
76-
|
77-
= note: the only supported types are integers, `bool`, and `char`
78-
7979
error[E0391]: cycle detected when computing type of opaque `Foo::{opaque#0}`
8080
--> $DIR/opaque_types.rs:3:12
8181
|

tests/ui/delegation/unsupported.stderr

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,6 @@ error: using `#![feature(effects)]` without enabling next trait solver globally
33
= note: the next trait solver must be enabled globally for the effects feature to work correctly
44
= help: use `-Znext-solver` to enable
55

6-
warning: this function depends on never type fallback being `()`
7-
--> $DIR/unsupported.rs:20:9
8-
|
9-
LL | fn opaque_ret() -> impl Trait { unimplemented!() }
10-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11-
|
12-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
13-
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
14-
= help: specify the types explicitly
15-
note: in edition 2024, the requirement `!: opaque::Trait` will fail
16-
--> $DIR/unsupported.rs:20:28
17-
|
18-
LL | fn opaque_ret() -> impl Trait { unimplemented!() }
19-
| ^^^^^^^^^^
20-
= note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default
21-
226
error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/unsupported.rs:26:5: 26:24>::{synthetic#0}`
237
--> $DIR/unsupported.rs:27:25
248
|
@@ -52,6 +36,22 @@ note: in edition 2024, the requirement `!: opaque::Trait` will fail
5236
|
5337
LL | pub fn opaque_ret() -> impl Trait { unimplemented!() }
5438
| ^^^^^^^^^^
39+
= note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default
40+
41+
warning: this function depends on never type fallback being `()`
42+
--> $DIR/unsupported.rs:20:9
43+
|
44+
LL | fn opaque_ret() -> impl Trait { unimplemented!() }
45+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46+
|
47+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
48+
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
49+
= help: specify the types explicitly
50+
note: in edition 2024, the requirement `!: opaque::Trait` will fail
51+
--> $DIR/unsupported.rs:20:28
52+
|
53+
LL | fn opaque_ret() -> impl Trait { unimplemented!() }
54+
| ^^^^^^^^^^
5555

5656
error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/unsupported.rs:29:5: 29:25>::{synthetic#0}`
5757
--> $DIR/unsupported.rs:30:24

tests/ui/feature-gates/feature-gate-impl_trait_in_assoc_type.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ LL | type Bop = impl std::fmt::Debug;
1818
= help: add `#![feature(impl_trait_in_assoc_type)]` to the crate attributes to enable
1919
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
2020

21-
error: unconstrained opaque type
22-
--> $DIR/feature-gate-impl_trait_in_assoc_type.rs:6:16
23-
|
24-
LL | type Bar = impl std::fmt::Debug;
25-
| ^^^^^^^^^^^^^^^^^^^^
26-
|
27-
= note: `Bar` must be used in combination with a concrete type within the same impl
28-
2921
error[E0658]: inherent associated types are unstable
3022
--> $DIR/feature-gate-impl_trait_in_assoc_type.rs:14:5
3123
|
@@ -36,6 +28,14 @@ LL | type Bop = impl std::fmt::Debug;
3628
= help: add `#![feature(inherent_associated_types)]` to the crate attributes to enable
3729
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
3830

31+
error: unconstrained opaque type
32+
--> $DIR/feature-gate-impl_trait_in_assoc_type.rs:6:16
33+
|
34+
LL | type Bar = impl std::fmt::Debug;
35+
| ^^^^^^^^^^^^^^^^^^^^
36+
|
37+
= note: `Bar` must be used in combination with a concrete type within the same impl
38+
3939
error: unconstrained opaque type
4040
--> $DIR/feature-gate-impl_trait_in_assoc_type.rs:14:16
4141
|

tests/ui/impl-trait/impl-fn-predefined-lifetimes.stderr

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ error[E0720]: cannot resolve opaque type
1919
--> $DIR/impl-fn-predefined-lifetimes.rs:4:35
2020
|
2121
LL | fn a<'a>() -> impl Fn(&'a u8) -> (impl Debug + '_) {
22-
| ^^^^^^^^^^^^^^^ cannot resolve opaque type
22+
| ^^^^^^^^^^^^^^^ recursive opaque type
23+
...
24+
LL | |x| x
25+
| ----- returning here with type `{closure@$DIR/impl-fn-predefined-lifetimes.rs:7:5: 7:8}`
2326

2427
error: aborting due to 2 previous errors; 1 warning emitted
2528

tests/ui/impl-trait/issues/issue-78722-2.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
error[E0271]: expected `{async block@$DIR/issue-78722-2.rs:13:13: 13:18}` to be a future that resolves to `u8`, but it resolves to `()`
2-
--> $DIR/issue-78722-2.rs:11:30
3-
|
4-
LL | fn concrete_use() -> F {
5-
| ^ expected `()`, found `u8`
6-
71
error[E0308]: mismatched types
82
--> $DIR/issue-78722-2.rs:16:20
93
|
@@ -18,6 +12,12 @@ LL | let f: F = async { 1 };
1812
= note: expected opaque type `F`
1913
found `async` block `{async block@$DIR/issue-78722-2.rs:16:20: 16:25}`
2014

15+
error[E0271]: expected `{async block@$DIR/issue-78722-2.rs:13:13: 13:18}` to be a future that resolves to `u8`, but it resolves to `()`
16+
--> $DIR/issue-78722-2.rs:11:30
17+
|
18+
LL | fn concrete_use() -> F {
19+
| ^ expected `()`, found `u8`
20+
2121
error: aborting due to 2 previous errors
2222

2323
Some errors have detailed explanations: E0271, E0308.

tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.stderr

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,3 @@
1-
error: item does not constrain `a::Foo::{opaque#0}`, but has it in its signature
2-
--> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:10:12
3-
|
4-
LL | fn eq(&self, _other: &(Foo, i32)) -> bool {
5-
| ^^
6-
|
7-
= note: consider moving the opaque type's declaration and defining uses into a separate module
8-
note: this opaque type is in the signature
9-
--> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:4:16
10-
|
11-
LL | type Foo = impl PartialEq<(Foo, i32)>;
12-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
13-
14-
error: unconstrained opaque type
15-
--> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:4:16
16-
|
17-
LL | type Foo = impl PartialEq<(Foo, i32)>;
18-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
19-
|
20-
= note: `Foo` must be used in combination with a concrete type within the same module
21-
221
error[E0053]: method `eq` has an incompatible type for trait
232
--> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:10:30
243
|
@@ -35,8 +14,21 @@ help: change the parameter type to match the trait
3514
LL | fn eq(&self, _other: &(a::Bar, i32)) -> bool {
3615
| ~~~~~~~~~~~~~~
3716

17+
error: item does not constrain `a::Foo::{opaque#0}`, but has it in its signature
18+
--> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:10:12
19+
|
20+
LL | fn eq(&self, _other: &(Foo, i32)) -> bool {
21+
| ^^
22+
|
23+
= note: consider moving the opaque type's declaration and defining uses into a separate module
24+
note: this opaque type is in the signature
25+
--> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:4:16
26+
|
27+
LL | type Foo = impl PartialEq<(Foo, i32)>;
28+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
29+
3830
error: unconstrained opaque type
39-
--> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:19:16
31+
--> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:4:16
4032
|
4133
LL | type Foo = impl PartialEq<(Foo, i32)>;
4234
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -64,6 +56,14 @@ help: change the parameter type to match the trait
6456
LL | fn eq(&self, _other: &(b::Foo, i32)) -> bool {
6557
| ~~~~~~~~~~~~~~
6658

59+
error: unconstrained opaque type
60+
--> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:19:16
61+
|
62+
LL | type Foo = impl PartialEq<(Foo, i32)>;
63+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
64+
|
65+
= note: `Foo` must be used in combination with a concrete type within the same module
66+
6767
error: aborting due to 5 previous errors
6868

6969
For more information about this error, try `rustc --explain E0053`.

0 commit comments

Comments
 (0)