Rollup merge of #86688 - JohnTitor:test-65384, r=jackh726

Add a regression test for issue-65384

Closes #65384
r? `@jackh726`
This commit is contained in:
Yuki Okushi 2021-06-29 00:27:00 +09:00 committed by GitHub
commit c5055b75a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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