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

.max() flagged as having 0 arguments #18796

Closed
jinschoi opened this issue Dec 30, 2024 · 3 comments
Closed

.max() flagged as having 0 arguments #18796

jinschoi opened this issue Dec 30, 2024 · 3 comments
Labels
C-bug Category: bug

Comments

@jinschoi
Copy link

rust-analyzer version: rust-analyzer 1.83.0 (90b35a62 2024-11-26)
rustc version: rustc 1.83.0 (90b35a623 2024-11-26)
editor or extension: Emacs 29.3, Zed 0.166.1
repository link (if public, optional): example
code snippet to reproduce:

fn test_max<A, B>()
where
    A: IntoIterator<Item = usize>,
    B: IntoIterator<Item = usize>,
{
    let _ = 1.max(2);
}

This has been reported several times, see #11048 and #10673, probably more. It's come up for me now. I was able to cut it way down to the example above. Remove either of the type constraints and it's happy. I also tried other traits, couldn't find one that caused the issue.

It wasn't doing this earlier.

@jinschoi jinschoi added the C-bug Category: bug label Dec 30, 2024
@Tunixer
Copy link

Tunixer commented Jan 1, 2025

fn test_max<A, B>()
where
    A: IntoIterator<Item = usize>,
    B: IntoIterator<Item = usize>,
{
    let _ = 1.max(2);
}
fn main() {
    let vec1 = vec![1, 2, 3];
    let vec2 = vec![4, 5, 6];

    test_max::<Vec<usize>, Vec<usize>>( );

    println!("Hello, world!");
}

I have used this demo on my test enviromment. But the rust-analyzer mark the max() as core::cmp::Ord correctly.

rust-analyzer version: 0.3.2237-standalone (59bc7b4 2024-12-29)

@jinschoi
Copy link
Author

jinschoi commented Jan 1, 2025

I don't understand. Does that mean it is fixed in nightly? Great, but I can't test it myself because only stable provides rust-analyzer.

@flodiebold
Copy link
Member

This is #10653. It'll probably get fixed with the new trait solver.

@flodiebold flodiebold closed this as not planned Won't fix, can't repro, duplicate, stale Jan 1, 2025
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

3 participants