Open
Description
Given the following code: playground
use std::collections::{BTreeSet, HashMap, VecDeque};
use std::sync::{Arc, Mutex};
fn main() {
my_very_long_function_name_with_lots_of_args();
}
fn my_very_long_function_name_with_lots_of_args(
_first_long_param: bool,
_second_long_param: HashMap<Arc<String>, Vec<BTreeSet<usize>>>,
_third_long_param: usize,
_fourth_long_param: String,
_fifth_long_param: Mutex<Option<VecDeque<Arc<String>>>>,
) {
}
The current output is:
error[E0061]: this function takes 5 arguments but 0 arguments were supplied
--> src/main.rs:5:5
|
5 | my_very_long_function_name_with_lots_of_args();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-- multiple arguments are missing
|
note: function defined here
--> src/main.rs:8:4
|
8 | fn my_very_long_function_name_with_lots_of_args(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9 | _first_long_param: bool,
| -----------------------
10 | _second_long_param: HashMap<Arc<String>, Vec<BTreeSet<usize>>>,
| --------------------------------------------------------------
11 | _third_long_param: usize,
| ------------------------
12 | _fourth_long_param: String,
| --------------------------
13 | _fifth_long_param: Mutex<Option<VecDeque<Arc<String>>>>,
| -------------------------------------------------------
help: provide the arguments
|
5 | my_very_long_function_name_with_lots_of_args(/* bool */, /* std::collections::HashMap<std::sync::Arc<std::string::String>, std::vec::Vec<std::collections::BTreeSet<usize>>> */, /* usize */, /* std::string::String */, /* std::sync::Mutex<std::option::Option<std::collections::VecDeque<std::sync::Arc<std::string::String>>>> */);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For more information about this error, try `rustc --explain E0061`.
error: could not compile `pg2` due to previous error
Screenshot:
Ideally this could be like the first part, with one parameter on each line ? This would also improve readability of the types I think
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: Suggestions generated by the compiler applied by `cargo fix`Diagnostics: An error or lint that needs small tweaks.Diagnostics: Too much output caused by a single piece of incorrect code.Relevant to the compiler team, which will review and decide on the PR/issue.