Closed
Description
I tried this code:
Note that generic_assert
is not marked as internal
https://github.com/rust-lang/rust/blob/master/compiler/rustc_feature/src/unstable.rs#L201
/// Outputs useful `assert!` messages
(unstable, generic_assert, "1.63.0", None),
/// Allows using the `rust-intrinsic`'s "ABI".
#![feature(generic_assert)]
pub fn main() {
assert!(true);
}
I expected to see this happen:
code compiles
Instead, this happened:
error[E0658]: use of unstable library feature 'core_intrinsics': intrinsics are unlikely to ever be stabilized, instead they should be used through stabilized interfaces in the rest of the standard library
--> assert.rs:4:5
|
4 | assert!(true);
| ^
|
= help: add `#![feature(core_intrinsics)]` to the crate attributes to enable
= note: this compiler was built on 2024-02-01; consider upgrading it if it is out of date
= note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0658`.
Maybe the lint should ignore code from expansions?
Meta
rustc --version --verbose
:
rustc 1.77.0-nightly (bf3c6c5be 2024-02-01)
binary: rustc
commit-hash: bf3c6c5bed498f41ad815641319a1ad9bcecb8e8
commit-date: 2024-02-01
host: x86_64-unknown-linux-gnu
release: 1.77.0-nightly
LLVM version: 17.0.6