Add a regression test for issue-65384
This commit is contained in:
parent
451e98e7b0
commit
16201597da
2 changed files with 30 additions and 0 deletions
16
src/test/ui/type-alias-impl-trait/issue-65384.rs
Normal file
16
src/test/ui/type-alias-impl-trait/issue-65384.rs
Normal 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() {}
|
14
src/test/ui/type-alias-impl-trait/issue-65384.stderr
Normal file
14
src/test/ui/type-alias-impl-trait/issue-65384.stderr
Normal 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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue