Closed
Description
auto-reduced (treereduce-rust):
macro_rules! the_macro {
( $foo:stmt ; $bar:stmt ; ) => {
#[cfg()]
$foo
#[cfg(bar)]
$bar
};
}
fn the_function() {
the_macro!( (); (); );
}
original:
macro_rules! the_macro {
( $foo:stmt ; $bar:stmt ; ) => {
#[cfg(incomplete_features)]
$foo
#[cfg(bar)]
$bar
};
}
fn the_function() {
the_macro!( (); (); );
}
Version information
rustc 1.78.0-nightly (b79db437d 2024-02-26)
binary: rustc
commit-hash: b79db437dccd496948bb1819d36ed51598563a98
commit-date: 2024-02-26
host: x86_64-unknown-linux-gnu
release: 1.78.0-nightly
LLVM version: 18.1.0
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc --crate-type=lib
Program output
warning: function `the_function` is never used
--> /tmp/icemaker_global_tempdir.fJLXUZMXByi7/rustc_testrunner_tmpdir_reporting.upzqZTcLzog2/mvce.rs:11:4
|
11 | fn the_function() {
| ^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: 1 warning emitted
note: no errors encountered even though delayed bugs were created
note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: not a tail expression
--> /tmp/icemaker_global_tempdir.fJLXUZMXByi7/rustc_testrunner_tmpdir_reporting.upzqZTcLzog2/mvce.rs:12:17
|
12 | the_macro!( (); (); );
| ^^
|
note: delayed at compiler/rustc_parse/src/parser/diagnostics.rs:818:43
0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
1: <rustc_errors::DiagCtxt>::emit_diagnostic
2: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
3: <rustc_parse::parser::Parser>::attr_on_non_tail_expr
4: <rustc_parse::parser::Parser>::parse_full_stmt
5: <rustc_expand::mbe::macro_rules::ParserAnyMacro>::make
6: <rustc_expand::expand::MacroExpander>::fully_expand_fragment
7: <rustc_expand::expand::MacroExpander>::expand_crate
8: rustc_interface::passes::resolver_for_lowering
9: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::resolver_for_lowering::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
10: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
11: rustc_query_impl::query_impl::resolver_for_lowering::get_query_non_incr::__rust_end_short_backtrace
12: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}
13: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
14: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
15: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
at /rustc/b79db437dccd496948bb1819d36ed51598563a98/library/alloc/src/boxed.rs:2016:9
16: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
at /rustc/b79db437dccd496948bb1819d36ed51598563a98/library/alloc/src/boxed.rs:2016:9
17: std::sys::pal::unix::thread::Thread::new::thread_start
at /rustc/b79db437dccd496948bb1819d36ed51598563a98/library/std/src/sys/pal/unix/thread.rs:108:17
18: <unknown>
19: <unknown>
--> /tmp/icemaker_global_tempdir.fJLXUZMXByi7/rustc_testrunner_tmpdir_reporting.upzqZTcLzog2/mvce.rs:12:17
|
12 | the_macro!( (); (); );
| ^^
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: rustc 1.78.0-nightly (b79db437d 2024-02-26) running on x86_64-unknown-linux-gnu
note: compiler flags: --crate-type lib -Z dump-mir-dir=dir
query stack during panic:
end of query stack
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: The lexing & parsing of Rust source code to an ASTCategory: This is a bug.Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Status: A Minimal Complete and Verifiable Example has been found for this issueRelevant to the compiler team, which will review and decide on the PR/issue.