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

False Positive E0107 #16992

Closed
Easyoakland opened this issue Apr 1, 2024 · 1 comment
Closed

False Positive E0107 #16992

Easyoakland opened this issue Apr 1, 2024 · 1 comment
Labels
C-bug Category: bug

Comments

@Easyoakland
Copy link

rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)

0.3.1906-standalone (e4a405f 2024-03-31)

rustc version: (eg. output of rustc -V)

rustc 1.76.0 (07dca489a 2024-02-04)

editor or extension: (eg. VSCode, Vim, Emacs, etc. For VSCode users, specify your extension version; for users of other editors, provide the distribution if applicable)

VSCode; rust-analyzer v0.3.1906

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)

N/A

repository link (if public, optional): (eg. rust-analyzer)

code snippet to reproduce:

#[allow(unused)]
fn fun<T, I1, I2>(a: I1)
where
    I1: IntoIterator<Item = T>,
    I1::IntoIter: ExactSizeIterator,
    I2: IntoIterator,
{
    let _ = a.into_iter().len().min(0); // expected 0 arguments, found 1 (E0107)
}

The above #[allow(unused)] is not actually necessary but removes all warnings except the incorrect warning.
The above code builds correctly with cargo build and has no error with cargo check.
Whatever check reports the error seems to come from "on-the-fly diagnostics" as it occurs/goes away without saving if the problem line or any of the where bounds is commented out .

@Easyoakland Easyoakland added the C-bug Category: bug label Apr 1, 2024
@lnicola
Copy link
Member

lnicola commented Apr 2, 2024

Duplicate of #10653.

@lnicola lnicola closed this as completed Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants