Skip to content

Commit 327cc62

Browse files
committed
Add reproduction test
1 parent 7a7bbdb commit 327cc62

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// check-pass
2+
// compile-flags: --crate-type=rlib
3+
4+
// Regression test for https://github.com/rust-lang/rust/issues/78450
5+
6+
#![feature(type_alias_impl_trait)]
7+
#![no_std]
8+
9+
pub trait AssociatedImpl {
10+
type ImplTrait;
11+
12+
fn f() -> Self::ImplTrait;
13+
}
14+
15+
struct S<T>(T);
16+
17+
trait Associated {
18+
type A;
19+
}
20+
21+
// ICE
22+
impl<'a, T: Associated<A = &'a ()>> AssociatedImpl for S<T> {
23+
type ImplTrait = impl core::fmt::Debug;
24+
25+
fn f() -> Self::ImplTrait {
26+
()
27+
}
28+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0601]: `main` function not found in crate `associated_type_lifetime_ice`
2+
--> $DIR/associated-type-lifetime-ice.rs:1:1
3+
|
4+
LL | / #![feature(type_alias_impl_trait)]
5+
LL | | #![no_std]
6+
LL | |
7+
LL | | pub trait AssociatedImpl {
8+
... |
9+
LL | | }
10+
LL | | }
11+
| |_^ consider adding a `main` function to `$DIR/associated-type-lifetime-ice.rs`
12+
13+
error: language item required, but not found: `eh_personality`
14+
15+
error: `#[panic_handler]` function required, but not found
16+
17+
error: aborting due to 3 previous errors
18+
19+
For more information about this error, try `rustc --explain E0601`.

0 commit comments

Comments
 (0)