-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ICE while building MIR with type errors
Fixes #74047.
- Loading branch information
Showing
3 changed files
with
29 additions
and
5 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
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,17 @@ | ||
// edition:2018 | ||
|
||
use std::convert::{TryFrom, TryInto}; | ||
use std::io; | ||
|
||
pub struct MyStream; | ||
pub struct OtherStream; | ||
|
||
pub async fn connect() -> io::Result<MyStream> { | ||
let stream: MyStream = OtherStream.try_into()?; | ||
Ok(stream) | ||
} | ||
|
||
impl TryFrom<OtherStream> for MyStream {} | ||
//~^ ERROR: missing | ||
|
||
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,12 @@ | ||
error[E0046]: not all trait items implemented, missing: `Error`, `try_from` | ||
--> $DIR/issue-74047.rs:14:1 | ||
| | ||
LL | impl TryFrom<OtherStream> for MyStream {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `Error`, `try_from` in implementation | ||
| | ||
= help: implement the missing item: `type Error = Type;` | ||
= help: implement the missing item: `fn try_from(_: T) -> std::result::Result<Self, <Self as std::convert::TryFrom<T>>::Error> { todo!() }` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0046`. |