Skip to content

Weird nonsesnical 'one type is more general than the other' error #72063

@TheEnbyperor

Description

@TheEnbyperor

Getting mismatched types error despite exactly the same types. Works when called from some areas of project, fails from other areas.

I tried this code:
https://github.com/AS207960/whois-email, function send_mail in client.rs, called from sender.rs line 161.

I expected to see this happen: Works as if called from main.rs line 101

Instead, this happened:

error[E0308]: mismatched types
   --> src/main.rs:104:5
    |
104 |     tokio::task::spawn(async {
    |     ^^^^^^^^^^^^^^^^^^ one type is more general than the other
    |
    = note: expected type `std::ops::FnOnce<(&trust_dns_proto::rr::rdata::mx::MX,)>`
               found type `std::ops::FnOnce<(&trust_dns_proto::rr::rdata::mx::MX,)>`

Meta

rustc --version --verbose:

rustc 1.44.0-nightly (dbf8b6bf1 2020-04-19)
binary: rustc
commit-hash: dbf8b6bf116c7bece2987ff4bd2792f008a6ee77
commit-date: 2020-04-19
host: x86_64-unknown-linux-gnu
release: 1.44.0-nightly
LLVM version: 9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-lifetimesArea: Lifetimes / regionsC-bugCategory: This is a bug.D-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions