error: visibility `pub` is not followed by an item
--> /tmp/icemaker_global_tempdir.85Auzek59MzW/rustc_testrunner_tmpdir_reporting.IMYecndfGNap/mvce.rs:1:13
|
1 | fn main() { pub }
| ^^^ the visibility
|
= help: you likely meant to define an item, e.g., `pub fn foo() {}`
error: internal compiler error: don't parse a statement if you see `}`
--> /tmp/icemaker_global_tempdir.85Auzek59MzW/rustc_testrunner_tmpdir_reporting.IMYecndfGNap/mvce.rs:1:17
|
1 | fn main() { pub }
| ^
thread 'rustc' (1821747) panicked at /rustc-dev/d3663963ca08f465d01d283a7199778902623bb9/compiler/rustc_parse/src/parser/stmt.rs:173:24:
Box<dyn Any>
stack backtrace:
0: 0x7fc8384b3046 - <<std[de18a84e87bef96]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[11760cdd6396813d]::fmt::Display>::fmt
1: 0x7fc838c0ad52 - core[11760cdd6396813d]::fmt::write
2: 0x7fc8384c818c - <std[de18a84e87bef96]::sys::stdio::unix::Stderr as core[11760cdd6396813d]::io::write::Write>::write_fmt
3: 0x7fc838484c1a - std[de18a84e87bef96]::panicking::default_hook::{closure#0}
4: 0x7fc8384a5723 - std[de18a84e87bef96]::panicking::default_hook
5: 0x7fc837419e0b - std[de18a84e87bef96]::panicking::update_hook::<alloc[6d2f5dc59fc5ad00]::boxed::Box<rustc_driver_impl[80ca0a791fc64eb4]::install_ice_hook::{closure#1}>>::{closure#0}
6: 0x7fc8384a5bc2 - std[de18a84e87bef96]::panicking::panic_with_hook
7: 0x7fc837447bd4 - std[de18a84e87bef96]::panicking::begin_panic::<rustc_errors[3360ec22066709a2]::ExplicitBug>::{closure#0}
8: 0x7fc837440926 - std[de18a84e87bef96]::sys::backtrace::__rust_end_short_backtrace::<std[de18a84e87bef96]::panicking::begin_panic<rustc_errors[3360ec22066709a2]::ExplicitBug>::{closure#0}, !>
9: 0x7fc83743e967 - std[de18a84e87bef96]::panicking::begin_panic::<rustc_errors[3360ec22066709a2]::ExplicitBug>
10: 0x7fc837453781 - <rustc_errors[3360ec22066709a2]::diagnostic::BugAbort as rustc_errors[3360ec22066709a2]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
11: 0x7fc837c9c175 - <rustc_errors[3360ec22066709a2]::DiagCtxtHandle>::span_bug::<rustc_span[22444b93dc8c3ee6]::span_encoding::Span, &str>
12: 0x7fc838d03070 - <rustc_parse[cfe3938aa4a232f5]::parser::Parser>::parse_stmt_without_recovery
13: 0x7fc838cfa4a6 - <rustc_parse[cfe3938aa4a232f5]::parser::Parser>::parse_block_common
14: 0x7fc838d09c3d - <rustc_parse[cfe3938aa4a232f5]::parser::Parser>::parse_fn
15: 0x7fc838d8e92c - <rustc_parse[cfe3938aa4a232f5]::parser::Parser>::parse_item_kind
16: 0x7fc838d89f5a - <rustc_parse[cfe3938aa4a232f5]::parser::Parser>::parse_item_common
17: 0x7fc838d3ddd4 - <rustc_parse[cfe3938aa4a232f5]::parser::Parser>::parse_mod
18: 0x7fc839d75abd - rustc_interface[2e32ffefb2ac5795]::passes::parse
19: 0x7fc839d87750 - rustc_interface[2e32ffefb2ac5795]::interface::run_compiler::<(), rustc_driver_impl[80ca0a791fc64eb4]::run_compiler::{closure#0}>::{closure#2}
20: 0x7fc839e05f24 - std[de18a84e87bef96]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[2e32ffefb2ac5795]::util::run_in_thread_with_globals<rustc_interface[2e32ffefb2ac5795]::util::run_in_thread_pool_with_globals<rustc_interface[2e32ffefb2ac5795]::interface::run_compiler<(), rustc_driver_impl[80ca0a791fc64eb4]::run_compiler::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
21: 0x7fc839e05ced - <std[de18a84e87bef96]::thread::lifecycle::spawn_unchecked<rustc_interface[2e32ffefb2ac5795]::util::run_in_thread_with_globals<rustc_interface[2e32ffefb2ac5795]::util::run_in_thread_pool_with_globals<rustc_interface[2e32ffefb2ac5795]::interface::run_compiler<(), rustc_driver_impl[80ca0a791fc64eb4]::run_compiler::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[11760cdd6396813d]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
22: 0x7fc839e1207a - <std[de18a84e87bef96]::sys::thread::unix::Thread>::new::thread_start
23: 0x7fc833297739 - <unknown>
24: 0x7fc83331bedc - <unknown>
25: 0x0 - <unknown>
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.99.0-nightly (d3663963c 2026-07-29) running on x86_64-unknown-linux-gnu
query stack during panic:
end of query stack
error: aborting due to 2 previous errors
snippet:
Version information
Possibly related line of code:
rust/compiler/rustc_parse/src/parser/stmt.rs
Lines 167 to 179 in d366396
Command:
/home/matthias/.rustup/toolchains/master/bin/rustcProgram output