Skip to content

Prioritise types in prelude over items from a #[doc(hidden)] module #91912

@xd009642

Description

@xd009642

I was passing in a usize instead of an Option<usize> in some of my code and when I ran cargo +nightly check I got this output:

error[E0308]: mismatched types
  --> src/process_handling/linux.rs:59:53
   |
59 |                 execute_test(test, ignored, config, cpus)?;
   |                                                     ^^^^ expected enum `std::option::Option`, found `usize`
   |
   = note: expected enum `std::option::Option<usize>`
              found type `usize`
help: try wrapping the expression in `syn::__private::Some`
   |
59 |                 execute_test(test, ignored, config, syn::__private::Some(cpus))?;
   |                                                     +++++++++++++++++++++    +

For more information about this error, try `rustc --explain E0308`.
error: could not compile `cargo-tarpaulin` due to previous error

I'm on the latest nightly and mentioned it on a rust discord and @memoryruins pointed me to the RA issue rust-lang/rust-analyzer#8511 and then realised there didn't seem to be a rustc issue for it so I'm raising it now 👀

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions