Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
TheEnbyperor opened this issue May 9, 2020 · 2 comments
Open
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-lifetimes Area: Lifetimes / regions C-bug Category: This is a bug. D-terse Diagnostics: An error or lint that doesn't give enough information about the problem at hand.

Comments

@TheEnbyperor
Copy link

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
@TheEnbyperor TheEnbyperor added the C-bug Category: This is a bug. label May 9, 2020
@jonas-schievink
Copy link
Contributor

Presumably the same issue as #71723

@TheEnbyperor
Copy link
Author

Appears to be so yes.

@ChrisDenton ChrisDenton added the needs-triage-legacy Old issue that were never triaged. Remove this label once the issue has been sufficiently triaged. label Jul 16, 2023
@fmease fmease added A-diagnostics Area: Messages for errors, warnings, and lints A-lifetimes Area: Lifetimes / regions D-terse Diagnostics: An error or lint that doesn't give enough information about the problem at hand. and removed needs-triage-legacy Old issue that were never triaged. Remove this label once the issue has been sufficiently triaged. labels Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-lifetimes Area: Lifetimes / regions C-bug Category: This is a bug. D-terse Diagnostics: An error or lint that doesn't give enough information about the problem at hand.
Projects
None yet
Development

No branches or pull requests

4 participants