Skip to content

Commit 9b611a3

Browse files
committed
update tests
1 parent 05d0417 commit 9b611a3

File tree

101 files changed

+430
-471
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+430
-471
lines changed

tests/ui/borrowck/opaque-types-patterns-subtyping-ice-104779.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ fn foo() -> impl Sized {
1414
loop {
1515
match foo() {
1616
//~^ ERROR higher-ranked subtype error
17-
//~^^ ERROR higher-ranked subtype error
17+
//~| ERROR higher-ranked subtype error
18+
//~| ERROR higher-ranked subtype error
19+
//~| ERROR higher-ranked subtype error
1820
Subtype::Bar => (),
1921
//~^ ERROR higher-ranked subtype error
20-
//~^^ ERROR higher-ranked subtype error
22+
//~| ERROR higher-ranked subtype error
2123
Supertype::Var(x) => {}
2224
}
2325
}

tests/ui/borrowck/opaque-types-patterns-subtyping-ice-104779.stderr

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,34 @@ LL | match foo() {
2525
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2626

2727
error: higher-ranked subtype error
28-
--> $DIR/opaque-types-patterns-subtyping-ice-104779.rs:18:13
28+
--> $DIR/opaque-types-patterns-subtyping-ice-104779.rs:15:15
29+
|
30+
LL | match foo() {
31+
| ^^^^^
32+
|
33+
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
34+
35+
error: higher-ranked subtype error
36+
--> $DIR/opaque-types-patterns-subtyping-ice-104779.rs:15:15
37+
|
38+
LL | match foo() {
39+
| ^^^^^
40+
|
41+
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
42+
43+
error: higher-ranked subtype error
44+
--> $DIR/opaque-types-patterns-subtyping-ice-104779.rs:20:13
2945
|
3046
LL | Subtype::Bar => (),
3147
| ^^^^^^^^^^^^
3248

3349
error: higher-ranked subtype error
34-
--> $DIR/opaque-types-patterns-subtyping-ice-104779.rs:18:13
50+
--> $DIR/opaque-types-patterns-subtyping-ice-104779.rs:20:13
3551
|
3652
LL | Subtype::Bar => (),
3753
| ^^^^^^^^^^^^
3854
|
3955
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
4056

41-
error: aborting due to 4 previous errors; 1 warning emitted
57+
error: aborting due to 6 previous errors; 1 warning emitted
4258

tests/ui/coroutine/clone-rpit.next.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ note: ...which requires type-checking `foo::{closure#0}`...
3535
LL | move |_: ()| {
3636
| ^^^^^^^^^^^^
3737
= note: ...which again requires type-checking `foo`, completing the cycle
38-
note: cycle used when computing type of opaque `foo::{opaque#0}`
39-
--> $DIR/clone-rpit.rs:13:25
38+
note: cycle used when match-checking `foo`
39+
--> $DIR/clone-rpit.rs:13:1
4040
|
4141
LL | pub fn foo<'a, 'b>() -> impl Clone {
42-
| ^^^^^^^^^^
42+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4343
= 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
4444

4545
error: aborting due to 1 previous error

tests/ui/generic-associated-types/issue-87258_a.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ pub trait Trait2 {
1515

1616
impl<'c, S: Trait2> Trait2 for &'c mut S {
1717
type FooFuture<'a> = impl Trait1;
18-
//~^ ERROR unconstrained opaque type
1918
fn foo<'a>() -> Self::FooFuture<'a> {
19+
//~^ ERROR item does not constrain
2020
Struct(unimplemented!())
2121
}
2222
}
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
error: unconstrained opaque type
1+
error: item does not constrain `<&'c mut S as Trait2>::FooFuture::{opaque#0}`
2+
--> $DIR/issue-87258_a.rs:18:8
3+
|
4+
LL | fn foo<'a>() -> Self::FooFuture<'a> {
5+
| ^^^
6+
|
7+
= note: consider removing `#[define_opaque]` or adding an empty `#[define_opaque()]`
8+
note: this opaque type is supposed to be constrained
29
--> $DIR/issue-87258_a.rs:17:26
310
|
411
LL | type FooFuture<'a> = impl Trait1;
512
| ^^^^^^^^^^^
6-
|
7-
= note: `FooFuture` must be used in combination with a concrete type within the same impl
813

914
error: aborting due to 1 previous error
1015

tests/ui/generic-associated-types/issue-87258_b.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ pub trait Trait2 {
1414
}
1515

1616
type Helper<'xenon, 'yttrium, KABOOM: Trait2> = impl Trait1;
17-
//~^ ERROR unconstrained opaque type
1817

1918
impl<'c, S: Trait2> Trait2 for &'c mut S {
2019
type FooFuture<'a> = Helper<'c, 'a, S>;
2120
#[define_opaque(Helper)]
2221
fn foo<'a>() -> Self::FooFuture<'a> {
22+
//~^ ERROR item does not constrain `Helper::{opaque#0}`
2323
Struct(unimplemented!())
2424
}
2525
}
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
error: unconstrained opaque type
1+
error: item does not constrain `Helper::{opaque#0}`
2+
--> $DIR/issue-87258_b.rs:21:8
3+
|
4+
LL | fn foo<'a>() -> Self::FooFuture<'a> {
5+
| ^^^
6+
|
7+
= note: consider removing `#[define_opaque]` or adding an empty `#[define_opaque()]`
8+
note: this opaque type is supposed to be constrained
29
--> $DIR/issue-87258_b.rs:16:49
310
|
411
LL | type Helper<'xenon, 'yttrium, KABOOM: Trait2> = impl Trait1;
512
| ^^^^^^^^^^^
6-
|
7-
= note: `Helper` must be used in combination with a concrete type within the same crate
813

914
error: aborting due to 1 previous error
1015

Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
1-
error: item does not constrain `Foo::{opaque#0}`
2-
--> $DIR/norm-before-method-resolution-opaque-type.rs:17:4
3-
|
4-
LL | fn weird_bound<X>(x: &<X as Trait<'static>>::Out<Foo>) -> X
5-
| ^^^^^^^^^^^
6-
|
7-
= note: consider removing `#[define_opaque]` or adding an empty `#[define_opaque()]`
8-
note: this opaque type is supposed to be constrained
9-
--> $DIR/norm-before-method-resolution-opaque-type.rs:14:12
10-
|
11-
LL | type Foo = impl Sized;
12-
| ^^^^^^^^^^
13-
141
error[E0507]: cannot move out of `*x` which is behind a shared reference
15-
--> $DIR/norm-before-method-resolution-opaque-type.rs:23:13
2+
--> $DIR/norm-before-method-resolution-opaque-type.rs:22:13
163
|
174
LL | let x = *x;
185
| ^^ move occurs because `*x` has type `<X as Trait<'_>>::Out<Foo>`, which does not implement the `Copy` trait
@@ -23,6 +10,6 @@ LL - let x = *x;
2310
LL + let x = x;
2411
|
2512

26-
error: aborting due to 2 previous errors
13+
error: aborting due to 1 previous error
2714

2815
For more information about this error, try `rustc --explain E0507`.

tests/ui/higher-ranked/trait-bounds/normalize-under-binder/norm-before-method-resolution-opaque-type.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ type Foo = impl Sized;
1515

1616
#[define_opaque(Foo)]
1717
fn weird_bound<X>(x: &<X as Trait<'static>>::Out<Foo>) -> X
18-
//[old]~^ ERROR: item does not constrain
1918
where
2019
for<'a> X: Trait<'a>,
2120
for<'a> <X as Trait<'a>>::Out<()>: Copy,

tests/ui/impl-trait/impl-fn-hrtb-bounds-2.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
use std::fmt::Debug;
33

44
fn a() -> impl Fn(&u8) -> impl Debug {
5-
|x| x //~ ERROR hidden type for `impl Debug` captures lifetime that does not appear in bounds
5+
|x| x
6+
//~^ ERROR hidden type for `impl Debug` captures lifetime that does not appear in bounds
7+
//~| ERROR hidden type for `impl Debug` captures lifetime that does not appear in bounds
68
}
79

810
fn main() {}

0 commit comments

Comments
 (0)