-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #86688 - JohnTitor:test-65384, r=jackh726
Add a regression test for issue-65384 Closes #65384 r? `@jackh726`
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|