Open
Description
Given the following code:
use std::ffi::CString;
fn main() {
let s = Cstring::new("hello").unwrap();
}
rustc gives me this output:
error[E0433]: failed to resolve: use of undeclared type or module `Cstring`
--> main.rs:4:13
|
4 | let s = Cstring::new("hello").unwrap();
| ^^^^^^^ use of undeclared type or module `Cstring`
warning: unused import: `std::ffi::CString`
--> main.rs:1:5
|
1 | use std::ffi::CString;
| ^^^^^^^^^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default
error: aborting due to previous error
For more information about this error, try `rustc --explain E0433`.
when it should give something like this:
error[E0433]: failed to resolve: use of undeclared type or module `Cstring`
--> main.rs:4:13
|
4 | let s = Cstring::new("hello").unwrap();
| ^^^^^^^ did you mean `CString`?
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: Suggestions generated by the compiler applied by `cargo fix`Category: An issue proposing an enhancement or a PR with one.Diagnostics: An error or lint that needs small tweaks.Relevant to the compiler team, which will review and decide on the PR/issue.