Closed
Description
Code
fn main() {
{
let mut mutex: libc() = std::mem::zeroed(
file.as_raw_fd(),
0,
0,
libc::SYNC_FILE_RANGE_WAIT_BEFORE,
);
}
}
Current output
error[E0433]: failed to resolve: use of undeclared crate or module `libc`
--> ./p/debug.rs:7:13
|
7 | libc::SYNC_FILE_RANGE_WAIT_BEFORE,
| ^^^^ use of undeclared crate or module `libc`
error[E0412]: cannot find type `libc` in this scope
--> ./p/debug.rs:3:24
|
3 | let mut mutex: libc() = std::mem::zeroed(
| ^^^^ not found in this scope
error[E0423]: expected value, found macro `file`
--> ./p/debug.rs:4:13
|
4 | file.as_raw_fd(),
| ^^^^ not a value
error[E0061]: this function takes 0 arguments but 4 arguments were supplied
--> ./p/debug.rs:3:33
|
3 | let mut mutex: libc() = std::mem::zeroed(
| ^^^^^^^^^^^^^^^^
4 | file.as_raw_fd(),
| ---------------- unexpected argument
5 | 0,
| - unexpected argument of type `{integer}`
6 | 0,
| - unexpected argument of type `{integer}`
7 | libc::SYNC_FILE_RANGE_WAIT_BEFORE,
| --------------------------------- unexpected argument
|
note: function defined here
--> /Users/yukang/rust/library/core/src/mem/mod.rs:643:15
|
643 | pub unsafe fn zeroed<T>() -> T {
| ^^^^^^
help: remove the extra arguments
|
4 - file.as_raw_fd(),
4 + ,
|
error: aborting due to 4 previous errors
Desired output
error[E0433]: failed to resolve: use of undeclared crate or module `libc`
--> ./p/debug.rs:7:13
|
7 | libc::SYNC_FILE_RANGE_WAIT_BEFORE,
| ^^^^ use of undeclared crate or module `libc`
error[E0412]: cannot find type `libc` in this scope
--> ./p/debug.rs:3:24
|
3 | let mut mutex: libc() = std::mem::zeroed(
| ^^^^ not found in this scope
error[E0423]: expected value, found macro `file`
--> ./p/debug.rs:4:13
|
4 | file.as_raw_fd(),
| ^^^^ not a value
error[E0061]: this function takes 0 arguments but 4 arguments were supplied
--> ./p/debug.rs:3:33
|
3 | let mut mutex: libc() = std::mem::zeroed(
| ^^^^^^^^^^^^^^^^
4 | file.as_raw_fd(),
| ---------------- unexpected argument
5 | 0,
| - unexpected argument of type `{integer}`
6 | 0,
| - unexpected argument of type `{integer}`
7 | libc::SYNC_FILE_RANGE_WAIT_BEFORE,
| --------------------------------- unexpected argument
|
note: function defined here
--> /Users/yukang/rust/library/core/src/mem/mod.rs:643:15
|
643 | pub unsafe fn zeroed<T>() -> T {
| ^^^^^^
help: remove the extra arguments
|
4 - file.as_raw_fd(),
4 +
|
error: aborting due to 4 previous errors
Rationale and extra context
From #109403 (comment)
Maybe a possible way is don't suggestion help when there are multiple arguments need to be removed, because we already have error[E0061]
for those details?
Other cases
No response
Anything else?
No response