-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Parameter cardinality error has a terrible span. #13684
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
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
Comments
edwardw
added a commit
to edwardw/rust
that referenced
this issue
Apr 23, 2014
Specifically, the method parameter cardinality mismatch or missing method error message span now gets method itself exactly. It was the whole expression. Closes rust-lang#9390 Closes rust-lang#13684 Closes rust-lang#13709
arcnmx
pushed a commit
to arcnmx/rust
that referenced
this issue
Jan 9, 2023
…mat-string, r=Veykril feat: extract_expressions_from_format_string closes rust-lang#13640 - rename to `extract_expressions_from_format_string` - leave identifier from format string - but this is from rustc version 1.65.0 - Should I add flag or something? Note: the assist behaves below cases for now. I'll create an issue for these. ```rs let var = 1 + 1; // ok format!("{var} {1+1}"); // → format!("{var} {}", 1+1); format!("{var:?} {1+1}"); // → format!("{var:?} {}", 1 + 1); format!("{var} {var} {1+1}"); // → format!("{var} {var} {}", 1 + 1); // breaks (need to handle minimum width by postfix`$`) format!("{var:width$} {1+1}"); // → format!("{var:width\$} {}", 1+1); format!("{var:.prec$} {1+1}"); // → format!("{var:.prec\$} {}", 1+1); format!("Hello {:1$}! {1+1}", "x" 5); // → format("Hello {:1\$}! {}", "x", 1+1); format!("Hello {:width$}! {1+1}", "x", width = 5); // → println!("Hello {:width\$}! {}", "x", 1+1); ``` https://user-images.githubusercontent.com/38400669/204344911-f1f8fbd2-706d-414e-b1ab-d309376efb9b.mov
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Dec 15, 2024
changelog: ``` changelog: [`needless_option_take`]: now lints for all temporary expressions of type Option<T>. ``` fixes rust-lang#13671 In general, needless_option_take should report whenever take() is called on a temporary value, not just when the temporary value is created by as_ref(). Also, we stop emitting machine applicable fixes in these cases, since sometimes the intention of the user is to actually clear the original option, in cases such as `option.as_mut().take()`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
E.g.:
Gives this error:
Both are quite terrible and require going through each function to figure out which one has the wrong number of arguments.
The text was updated successfully, but these errors were encountered: