Closed
Description
auto-reduced (treereduce-rust):
#[test]
#[test]
extern "C" fn test_naked_should_panic() {}
#[ignore]
#[std::arch::naked_asm]
#[unsafe(naked)]
extern "C" fn std() {}
#[bench]
extern "C" fn bench_naked() {}
original:
//@ needs-asm-support
//@ compile-flags: --test
#![feature(naked_functions)]
#![feature(test)]
#![crate_type = "lib"]
use std::arch::naked_asm;
#[test]
#[unsafe(std)]
//~^ ERROR [E0736]
extern "C" fn test_naked() {
naked_asm!("")
}
#[should_panic]
#[test]
#[unsafe(ignore)]
//~^ ERROR [E0736]
extern "C" fn test_naked_should_panic() {
naked_asm!("")
}
#[ignore]
#[std::arch::naked_asm]
#[unsafe(naked)]
//~^ ERROR [E0736]
extern "C" fn std() {
naked_asm!("")
}
#[bench]
#[unsafe(naked)]
//~^ ERROR [E0736]
extern "C" fn bench_naked() {
naked_asm!("")
}
Version information
rustc 1.88.0-nightly (49e5e4e3a 2025-04-20)
binary: rustc
commit-hash: 49e5e4e3a5610c240a717cb99003a5d5d3356679
commit-date: 2025-04-20
host: x86_64-unknown-linux-gnu
release: 1.88.0-nightly
LLVM version: 20.1.2
Possibly related line of code:
rust/compiler/rustc_passes/src/check_attr.rs
Lines 680 to 692 in 49e5e4e
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc
Program output
error[E0658]: use of unstable library feature `naked_functions`
--> /tmp/icemaker_global_tempdir.oVdDLeOpLyuJ/rustc_testrunner_tmpdir_reporting.eeV2LA472drX/mvce.rs:7:3
|
7 | #[std::arch::naked_asm]
| ^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #90957 <https://github.com/rust-lang/rust/issues/90957> for more information
= help: add `#![feature(naked_functions)]` to the crate attributes to enable
= note: this compiler was built on 2025-04-20; consider upgrading it if it is out of date
error: expected attribute, found macro `std::arch::naked_asm`
--> /tmp/icemaker_global_tempdir.oVdDLeOpLyuJ/rustc_testrunner_tmpdir_reporting.eeV2LA472drX/mvce.rs:7:3
|
7 | #[std::arch::naked_asm]
| ^^^^^^^^^^^^^^^^^^^^ not an attribute
error[E0658]: the `#[naked]` attribute is an experimental feature
--> /tmp/icemaker_global_tempdir.oVdDLeOpLyuJ/rustc_testrunner_tmpdir_reporting.eeV2LA472drX/mvce.rs:8:1
|
8 | #[unsafe(naked)]
| ^^^^^^^^^^^^^^^^
|
= note: see issue #90957 <https://github.com/rust-lang/rust/issues/90957> for more information
= help: add `#![feature(naked_functions)]` to the crate attributes to enable
= note: this compiler was built on 2025-04-20; consider upgrading it if it is out of date
error: use of unstable library feature `test`: `bench` is a part of custom test frameworks which are unstable
--> /tmp/icemaker_global_tempdir.oVdDLeOpLyuJ/rustc_testrunner_tmpdir_reporting.eeV2LA472drX/mvce.rs:12:3
|
12 | #[bench]
| ^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #64266 <https://github.com/rust-lang/rust/issues/64266>
= note: `#[deny(soft_unstable)]` on by default
warning: duplicated attribute
--> /tmp/icemaker_global_tempdir.oVdDLeOpLyuJ/rustc_testrunner_tmpdir_reporting.eeV2LA472drX/mvce.rs:2:1
|
2 | #[test]
| ^^^^^^^
|
= note: `#[warn(duplicate_macro_attributes)]` on by default
error[E0601]: `main` function not found in crate `mvce`
--> /tmp/icemaker_global_tempdir.oVdDLeOpLyuJ/rustc_testrunner_tmpdir_reporting.eeV2LA472drX/mvce.rs:14:31
|
14 | extern "C" fn bench_naked() {}
| ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.oVdDLeOpLyuJ/rustc_testrunner_tmpdir_reporting.eeV2LA472drX/mvce.rs`
thread 'rustc' panicked at compiler/rustc_passes/src/check_attr.rs:686:53:
called `Option::unwrap()` on a `None` value
stack backtrace:
0: 0x7e0088ac32d3 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h324f34dce7b2678f
1: 0x7e0089205b07 - core::fmt::write::hd22cc1648ac42b07
2: 0x7e008a6a6511 - std::io::Write::write_fmt::hc470158a4a4962c8
3: 0x7e0088ac3132 - std::sys::backtrace::BacktraceLock::print::h5f10e1c32fb9f0d9
4: 0x7e0088ac6aaa - std::panicking::default_hook::{{closure}}::h87ad2c084cfb04f1
5: 0x7e0088ac662f - std::panicking::default_hook::hae69840f003f1069
6: 0x7e0087b446d3 - std[5051174048ba1e53]::panicking::update_hook::<alloc[2dd4acf2a1d1fb9e]::boxed::Box<rustc_driver_impl[172a1192a053ca1c]::install_ice_hook::{closure#1}>>::{closure#0}
7: 0x7e0088ac7323 - std::panicking::rust_panic_with_hook::ha0b55d31886b1816
8: 0x7e0088ac6fe6 - std::panicking::begin_panic_handler::{{closure}}::h48cd034d049fda10
9: 0x7e0088ac37a9 - std::sys::backtrace::__rust_end_short_backtrace::h8005f72fc5074b26
10: 0x7e0088ac6cdd - __rustc[210e004a726585c1]::rust_begin_unwind
11: 0x7e0085487700 - core::panicking::panic_fmt::hc81b46136717229e
12: 0x7e008548c4ec - core::panicking::panic::hdd03dcc5e0c4de0d
13: 0x7e0085487fd9 - core::option::unwrap_failed::h16c0a781e25fc4f7
14: 0x7e00898425c5 - <rustc_passes[4dae12b40a366c77]::check_attr::CheckAttrVisitor>::check_attributes
15: 0x7e008983df9d - <rustc_passes[4dae12b40a366c77]::check_attr::CheckAttrVisitor as rustc_hir[207455759082caa]::intravisit::Visitor>::visit_item
16: 0x7e008983d589 - rustc_passes[4dae12b40a366c77]::check_attr::check_mod_attrs
17: 0x7e008983d427 - rustc_query_impl[b588695e9224002f]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b588695e9224002f]::query_impl::check_mod_attrs::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c7fff74e8bbca93d]::query::erase::Erased<[u8; 0usize]>>
18: 0x7e0089e09cde - rustc_query_system[4dde7f73b3d9753d]::query::plumbing::try_execute_query::<rustc_query_impl[b588695e9224002f]::DynamicConfig<rustc_query_system[4dde7f73b3d9753d]::query::caches::DefaultCache<rustc_span[faf2fb1a2af8cdd]::def_id::LocalModDefId, rustc_middle[c7fff74e8bbca93d]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[b588695e9224002f]::plumbing::QueryCtxt, false>
19: 0x7e0089e099fe - rustc_query_impl[b588695e9224002f]::query_impl::check_mod_attrs::get_query_non_incr::__rust_end_short_backtrace
20: 0x7e0089e095f6 - <rustc_middle[c7fff74e8bbca93d]::ty::context::TyCtxt>::par_hir_for_each_module::<rustc_interface[46964d2ec32a8c90]::passes::run_required_analyses::{closure#0}::{closure#0}::{closure#1}::{closure#0}>::{closure#0}
21: 0x7e0089bc8ced - rustc_interface[46964d2ec32a8c90]::passes::run_required_analyses
22: 0x7e0089e0661e - rustc_interface[46964d2ec32a8c90]::passes::analysis
23: 0x7e0089e065f3 - rustc_query_impl[b588695e9224002f]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b588695e9224002f]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c7fff74e8bbca93d]::query::erase::Erased<[u8; 0usize]>>
24: 0x7e008a2101bd - rustc_query_system[4dde7f73b3d9753d]::query::plumbing::try_execute_query::<rustc_query_impl[b588695e9224002f]::DynamicConfig<rustc_query_system[4dde7f73b3d9753d]::query::caches::SingleCache<rustc_middle[c7fff74e8bbca93d]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[b588695e9224002f]::plumbing::QueryCtxt, false>
25: 0x7e008a20feb8 - rustc_query_impl[b588695e9224002f]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
26: 0x7e008a0e3b7e - rustc_interface[46964d2ec32a8c90]::passes::create_and_enter_global_ctxt::<core[566b60421a094c97]::option::Option<rustc_interface[46964d2ec32a8c90]::queries::Linker>, rustc_driver_impl[172a1192a053ca1c]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
27: 0x7e008a34e704 - rustc_interface[46964d2ec32a8c90]::interface::run_compiler::<(), rustc_driver_impl[172a1192a053ca1c]::run_compiler::{closure#0}>::{closure#1}
28: 0x7e008a30af74 - std[5051174048ba1e53]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[46964d2ec32a8c90]::util::run_in_thread_with_globals<rustc_interface[46964d2ec32a8c90]::util::run_in_thread_pool_with_globals<rustc_interface[46964d2ec32a8c90]::interface::run_compiler<(), rustc_driver_impl[172a1192a053ca1c]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
29: 0x7e008a30b3b4 - <<std[5051174048ba1e53]::thread::Builder>::spawn_unchecked_<rustc_interface[46964d2ec32a8c90]::util::run_in_thread_with_globals<rustc_interface[46964d2ec32a8c90]::util::run_in_thread_pool_with_globals<rustc_interface[46964d2ec32a8c90]::interface::run_compiler<(), rustc_driver_impl[172a1192a053ca1c]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[566b60421a094c97]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
30: 0x7e008a30c7ab - std::sys::pal::unix::thread::Thread::new::thread_start::h60ec121024bdcb08
31: 0x7e008405d70a - <unknown>
32: 0x7e00840e1aac - <unknown>
33: 0x0 - <unknown>
error: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: please make sure that you have updated to the latest nightly
note: rustc 1.88.0-nightly (49e5e4e3a 2025-04-20) running on x86_64-unknown-linux-gnu
query stack during panic:
#0 [check_mod_attrs] checking attributes in top-level module
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 5 previous errors; 1 warning emitted
Some errors have detailed explanations: E0601, E0658.
For more information about an error, try `rustc --explain E0601`.
@rustbot label +F-naked_functions +F-test