-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not ICE when closure is involved in TAIT
Fix #83613.
- Loading branch information
Showing
3 changed files
with
42 additions
and
1 deletion.
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
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,13 @@ | ||
#![feature(min_type_alias_impl_trait)] | ||
trait OpaqueTrait {} | ||
impl<T> OpaqueTrait for T {} | ||
type OpaqueType = impl OpaqueTrait; | ||
fn mk_opaque() -> OpaqueType { | ||
|| 0 | ||
} | ||
trait AnotherTrait {} | ||
impl<T: Send> AnotherTrait for T {} | ||
impl AnotherTrait for OpaqueType {} | ||
//~^ ERROR conflicting implementations of trait `AnotherTrait` for type `impl OpaqueTrait` | ||
//~| ERROR cannot implement trait on type alias impl trait | ||
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,23 @@ | ||
error[E0119]: conflicting implementations of trait `AnotherTrait` for type `impl OpaqueTrait` | ||
--> $DIR/issue-83613.rs:10:1 | ||
| | ||
LL | impl<T: Send> AnotherTrait for T {} | ||
| -------------------------------- first implementation here | ||
LL | impl AnotherTrait for OpaqueType {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `impl OpaqueTrait` | ||
|
||
error: cannot implement trait on type alias impl trait | ||
--> $DIR/issue-83613.rs:10:1 | ||
| | ||
LL | impl AnotherTrait for OpaqueType {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: type alias impl trait defined here | ||
--> $DIR/issue-83613.rs:4:19 | ||
| | ||
LL | type OpaqueType = impl OpaqueTrait; | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0119`. |