]> git.proxmox.com Git - rustc.git/blame - src/test/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / type-alias-impl-trait / issue-76202-trait-impl-for-tait.rs
CommitLineData
1b1a35ee
XL
1// Regression test for issue #76202
2// Tests that we don't ICE when we have a trait impl on a TAIT.
3
487cf647
FG
4// check-pass
5
94222f64 6#![feature(type_alias_impl_trait)]
1b1a35ee
XL
7
8trait Dummy {}
9impl Dummy for () {}
10
11type F = impl Dummy;
12fn f() -> F {}
13
14trait Test {
15 fn test(self);
16}
17
94222f64 18impl Test for F {
487cf647
FG
19 fn test(self) {}
20}
21
22// Ok because `i32` does not implement `Dummy`,
23// so it can't possibly be the hidden type of `F`.
24impl Test for i32 {
1b1a35ee
XL
25 fn test(self) {}
26}
27
28fn main() {
29 let x: F = f();
30 x.test();
31}