Skip to content

Commit c652d9d

Browse files
committed
remove 120033 crash test
1 parent 50a296f commit c652d9d

3 files changed

Lines changed: 81 additions & 16 deletions

File tree

tests/crashes/120033.rs

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//@ compile-flags: --crate-type=lib
2+
3+
// Regression test for <https://github.com/rust-lang/rust/issues/120033>
4+
5+
#![feature(non_lifetime_binders)] //~ WARN the feature `non_lifetime_binders` is incomplete
6+
#![allow(sized_hierarchy_migration)] //~ WARN unknown lint: `sized_hierarchy_migration`
7+
#![feature(sized_hierarchy)] // added to keep parameters unconstrained
8+
9+
pub trait Foo<T: std::marker::PointeeSized> {
10+
type Bar<K: std::marker::PointeeSized>;
11+
}
12+
13+
pub struct Bar<T: ?AutoTrait> {} //~ ERROR cannot find trait `AutoTrait`
14+
15+
pub fn f<T1, T2>()
16+
where
17+
T1: for<T> Foo<usize, Bar = Bar<T>>, //~ ERROR missing generics for associated type `Foo::Bar`
18+
//~| ERROR missing generics for associated type `Foo::Bar`
19+
T2: for<L, T> Foo<usize, Bar<T> = T1::Bar<T>>,
20+
{
21+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
error[E0405]: cannot find trait `AutoTrait` in this scope
2+
--> $DIR/normalized-param-env-unconstrained-type-120033.rs:13:20
3+
|
4+
LL | pub struct Bar<T: ?AutoTrait> {}
5+
| ^^^^^^^^^ not found in this scope
6+
7+
warning: unknown lint: `sized_hierarchy_migration`
8+
--> $DIR/normalized-param-env-unconstrained-type-120033.rs:6:10
9+
|
10+
LL | #![allow(sized_hierarchy_migration)]
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^
12+
|
13+
= note: `#[warn(unknown_lints)]` on by default
14+
15+
warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
16+
--> $DIR/normalized-param-env-unconstrained-type-120033.rs:5:12
17+
|
18+
LL | #![feature(non_lifetime_binders)]
19+
| ^^^^^^^^^^^^^^^^^^^^
20+
|
21+
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
22+
= note: `#[warn(incomplete_features)]` on by default
23+
24+
error[E0107]: missing generics for associated type `Foo::Bar`
25+
--> $DIR/normalized-param-env-unconstrained-type-120033.rs:17:27
26+
|
27+
LL | T1: for<T> Foo<usize, Bar = Bar<T>>,
28+
| ^^^ expected 1 generic argument
29+
|
30+
note: associated type defined here, with 1 generic parameter: `K`
31+
--> $DIR/normalized-param-env-unconstrained-type-120033.rs:10:10
32+
|
33+
LL | type Bar<K: std::marker::PointeeSized>;
34+
| ^^^ -
35+
help: add missing generic argument
36+
|
37+
LL | T1: for<T> Foo<usize, Bar<K> = Bar<T>>,
38+
| +++
39+
40+
error[E0107]: missing generics for associated type `Foo::Bar`
41+
--> $DIR/normalized-param-env-unconstrained-type-120033.rs:17:27
42+
|
43+
LL | T1: for<T> Foo<usize, Bar = Bar<T>>,
44+
| ^^^ expected 1 generic argument
45+
|
46+
note: associated type defined here, with 1 generic parameter: `K`
47+
--> $DIR/normalized-param-env-unconstrained-type-120033.rs:10:10
48+
|
49+
LL | type Bar<K: std::marker::PointeeSized>;
50+
| ^^^ -
51+
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
52+
help: add missing generic argument
53+
|
54+
LL | T1: for<T> Foo<usize, Bar<K> = Bar<T>>,
55+
| +++
56+
57+
error: aborting due to 3 previous errors; 2 warnings emitted
58+
59+
Some errors have detailed explanations: E0107, E0405.
60+
For more information about an error, try `rustc --explain E0107`.

0 commit comments

Comments
 (0)