Skip to content

Suggestions for miniz_oxide included in diagnostics in crate with no dependencies #88696

Closed
@m-ou-se

Description

@m-ou-se

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

A-diagnosticsArea: Messages for errors, warnings, and lintsA-trait-systemArea: Trait systemC-bugCategory: This is a bug.D-confusingDiagnostics: Confusing error or lint that should be reworked.D-incorrectDiagnostics: A diagnostic that is giving misleading or incorrect information.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions