Closed
Description
So, I was just chatting a bit with rustc and I was saying:
#![feature(never_type)]
fn a() -> Result<!, i32> {
Err(1)
}
fn b() -> Result<u32, i32> {
a().into()
}
fn main() {
let _ = dbg!(b());
}
And then rustc said:
error[E0277]: the trait bound `Result<u32, i32>: From<Result<!, i32>>` is not satisfied
--> src/main.rs:8:9
|
8 | a().into()
| ^^^^ the trait `From<Result<!, i32>>` is not implemented for `Result<u32, i32>`
|
And I was like, sure, whatever you say.
But then rustc told me:
= help: the following implementations were found:
<Result<miniz_oxide::MZStatus, miniz_oxide::MZError> as From<&miniz_oxide::StreamResult>>
<Result<miniz_oxide::MZStatus, miniz_oxide::MZError> as From<miniz_oxide::StreamResult>>
And I was like, excuse me what??
This crate has no dependencies. (Just an empty cargo new ..
package.)
This happens on at least:
- rustc 1.55.0-nightly (014026d 2021-07-19)
- rustc 1.56.0-nightly (ccffcaf 2021-08-11)
- rustc 1.57.0-nightly (5d2a410 2021-09-04)
(On x86_64-unknown-linux-gnu
and other platforms where backtrace
is enabled in std
, such that miniz_oxide
is pulled in as a dependency of std
.)
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: Trait systemCategory: This is a bug.Diagnostics: Confusing error or lint that should be reworked.Diagnostics: A diagnostic that is giving misleading or incorrect information.Medium priorityRelevant to the compiler team, which will review and decide on the PR/issue.