Repository navigation
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-stabilityArea: `#[stable]`, `#[unstable]` etc.Area: `#[stable]`, `#[unstable]` etc.A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
This might well be a duplicate, but I couldn't find an existing bug. I ran into this with c_int.
fn main() {
let _: c_int;
}The output (with no dependencies) is
--> src/main.rs:2:12
|
2 | let _: c_int;
| ^^^^^ not found in this scope
|
help: consider importing one of these items
|
1 | use core::ffi::c_int;
|
1 | use std::os::raw::c_int;
Ideally the output should look like:
--> src/main.rs:2:12
|
2 | let _: c_int;
| ^^^^^ not found in this scope
|
help: consider importing one of these items
|
1 | use std::os::raw::c_int;
as core::ffi::c_int is unstable:
use core::ffi::c_int;
fn main() {
let _: c_int;
}Output:
error[E0658]: use of unstable library feature 'core_ffi_c'
--> src/main.rs:1:5
|
1 | use core::ffi::c_int;
| ^^^^^^^^^^^^^^^^
|
= note: see issue #94501 <https://github.com/rust-lang/rust/issues/94501> for more information
error[E0658]: use of unstable library feature 'core_ffi_c'
--> src/main.rs:3:12
|
3 | let _: c_int;
| ^^^^^
|
= note: see issue #94501 <https://github.com/rust-lang/rust/issues/94501> for more information
For more information about this error, try `rustc --explain E0658`.
Stable compiler version 1.63.0. This particular example works on Beta and Nightly, but presumably there are or will be other things in the standard library with a stable path and an unstable path.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-stabilityArea: `#[stable]`, `#[unstable]` etc.Area: `#[stable]`, `#[unstable]` etc.A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Activity
QuineDot commentedon May 4, 2023
This is indeed still happening with other unstable paths.
+use core::error::Error; fn main() -> Result<(), Box<dyn Error>> { Ok(()) }jakubadamw commentedon Apr 8, 2026
I believe this is a duplicate of #149402 that was fixed in #149440. It can be closed. @estebank, would you mind? 🙂