Add a regression test for issue-65384

This commit is contained in:
Yuki Okushi 2021-06-28 18:39:51 +09:00
parent 451e98e7b0
commit 16201597da
No known key found for this signature in database
GPG key ID: DABA5B072961C18A
2 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1,16 @@
#![feature(min_type_alias_impl_trait)]
#![feature(type_alias_impl_trait)]
#![allow(incomplete_features)]
trait MyTrait {}
impl MyTrait for () {}
type Bar = impl MyTrait;
impl MyTrait for Bar {}
//~^ ERROR: cannot implement trait on type alias impl trait
fn bazr() -> Bar { }
fn main() {}

View file

@ -0,0 +1,14 @@
error: cannot implement trait on type alias impl trait
--> $DIR/issue-65384.rs:11:1
|
LL | impl MyTrait for Bar {}
| ^^^^^^^^^^^^^^^^^^^^
|
note: type alias impl trait defined here
--> $DIR/issue-65384.rs:9:12
|
LL | type Bar = impl MyTrait;
| ^^^^^^^^^^^^
error: aborting due to previous error