Skip to content

Commit 6278e0f

Browse files
committed
Promote crash tests to ui.
1 parent 6ec58a4 commit 6278e0f

11 files changed

+124
-35
lines changed

tests/crashes/119716-2.rs

-4
This file was deleted.

tests/crashes/119716.rs

-4
This file was deleted.

tests/crashes/121422.rs

-8
This file was deleted.

tests/crashes/125843.rs

-4
This file was deleted.

tests/crashes/129099.rs

-15
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#![feature(type_alias_impl_trait)]
2+
3+
trait Captures<'a> {}
4+
impl<T> Captures<'_> for T {}
5+
6+
fn dyn_hoops<T: Sized>() -> dyn for<'a> Iterator<Item = impl Captures<'a>> {
7+
//~^ ERROR `impl Trait` cannot capture higher-ranked lifetime from `dyn` type
8+
loop {}
9+
}
10+
11+
pub fn main() {
12+
//~^ ERROR item does not constrain `Opaque::{opaque#0}`, but has it in its signature
13+
type Opaque = impl Sized;
14+
fn define() -> Opaque {
15+
let x: Opaque = dyn_hoops::<()>();
16+
x
17+
}
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
error[E0657]: `impl Trait` cannot capture higher-ranked lifetime from `dyn` type
2+
--> $DIR/bound-lifetime-through-dyn-trait.rs:6:71
3+
|
4+
LL | fn dyn_hoops<T: Sized>() -> dyn for<'a> Iterator<Item = impl Captures<'a>> {
5+
| ^^
6+
|
7+
note: lifetime declared here
8+
--> $DIR/bound-lifetime-through-dyn-trait.rs:6:37
9+
|
10+
LL | fn dyn_hoops<T: Sized>() -> dyn for<'a> Iterator<Item = impl Captures<'a>> {
11+
| ^^
12+
13+
error: item does not constrain `Opaque::{opaque#0}`, but has it in its signature
14+
--> $DIR/bound-lifetime-through-dyn-trait.rs:11:8
15+
|
16+
LL | pub fn main() {
17+
| ^^^^
18+
|
19+
= note: consider moving the opaque type's declaration and defining uses into a separate module
20+
note: this opaque type is in the signature
21+
--> $DIR/bound-lifetime-through-dyn-trait.rs:13:19
22+
|
23+
LL | type Opaque = impl Sized;
24+
| ^^^^^^^^^^
25+
26+
error: aborting due to 2 previous errors
27+
28+
For more information about this error, try `rustc --explain E0657`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#![allow(incomplete_features)]
2+
#![feature(non_lifetime_binders)]
3+
4+
trait Trait<T: ?Sized> {}
5+
6+
fn produce() -> impl for<T> Trait<(), Assoc = impl Trait<T>> {
7+
//~^ ERROR associated type `Assoc` not found for `Trait`
8+
//~| ERROR associated type `Assoc` not found for `Trait`
9+
//~| the trait bound `{integer}: Trait<()>` is not satisfied
10+
16
11+
}
12+
13+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
error[E0220]: associated type `Assoc` not found for `Trait`
2+
--> $DIR/non-lifetime-binder-in-constraint.rs:6:39
3+
|
4+
LL | fn produce() -> impl for<T> Trait<(), Assoc = impl Trait<T>> {
5+
| ^^^^^ associated type `Assoc` not found
6+
7+
error[E0220]: associated type `Assoc` not found for `Trait`
8+
--> $DIR/non-lifetime-binder-in-constraint.rs:6:39
9+
|
10+
LL | fn produce() -> impl for<T> Trait<(), Assoc = impl Trait<T>> {
11+
| ^^^^^ associated type `Assoc` not found
12+
|
13+
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
14+
15+
error[E0277]: the trait bound `{integer}: Trait<()>` is not satisfied
16+
--> $DIR/non-lifetime-binder-in-constraint.rs:6:17
17+
|
18+
LL | fn produce() -> impl for<T> Trait<(), Assoc = impl Trait<T>> {
19+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait<()>` is not implemented for `{integer}`
20+
|
21+
help: this trait has no implementations, consider adding one
22+
--> $DIR/non-lifetime-binder-in-constraint.rs:4:1
23+
|
24+
LL | trait Trait<T: ?Sized> {}
25+
| ^^^^^^^^^^^^^^^^^^^^^^
26+
27+
error: aborting due to 3 previous errors
28+
29+
Some errors have detailed explanations: E0220, E0277.
30+
For more information about an error, try `rustc --explain E0220`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#![allow(incomplete_features)]
2+
#![feature(non_lifetime_binders)]
3+
4+
trait Trait<T> {}
5+
6+
fn f() -> impl for<T> Trait<impl Trait<T>> {}
7+
//~^ ERROR nested `impl Trait` is not allowed
8+
//~| ERROR the trait bound `(): Trait<impl Trait<T>>` is not satisfied
9+
10+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
error[E0666]: nested `impl Trait` is not allowed
2+
--> $DIR/non-lifetime-binder.rs:6:29
3+
|
4+
LL | fn f() -> impl for<T> Trait<impl Trait<T>> {}
5+
| ------------------^^^^^^^^^^^^^-
6+
| | |
7+
| | nested `impl Trait` here
8+
| outer `impl Trait`
9+
10+
error[E0277]: the trait bound `(): Trait<impl Trait<T>>` is not satisfied
11+
--> $DIR/non-lifetime-binder.rs:6:11
12+
|
13+
LL | fn f() -> impl for<T> Trait<impl Trait<T>> {}
14+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait<impl Trait<T>>` is not implemented for `()`
15+
|
16+
help: this trait has no implementations, consider adding one
17+
--> $DIR/non-lifetime-binder.rs:4:1
18+
|
19+
LL | trait Trait<T> {}
20+
| ^^^^^^^^^^^^^^
21+
22+
error: aborting due to 2 previous errors
23+
24+
Some errors have detailed explanations: E0277, E0666.
25+
For more information about an error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)