Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clippy panic: broken MIR in Item #13840

Open
vaivaswatha opened this issue Dec 16, 2024 · 0 comments
Open

clippy panic: broken MIR in Item #13840

vaivaswatha opened this issue Dec 16, 2024 · 0 comments
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@vaivaswatha
Copy link

vaivaswatha commented Dec 16, 2024

Summary

Here are the steps to repro (I don't have a minimal repro yet - I will update back if I can get one):

git clone https://github.com/vaivaswatha/pliron.git
cd pliron/
git checkout b323bb9ef16f2f42021bfa3703a150d689781080
cargo clippy --workspace

Notes:

  1. This problem is new, after I upgraded to 1.83.0
  2. cargo build --workspace and cargo build --release --workspace both succeed. It's just clippy that fails.

Version

rustc 1.83.0 (90b35a623 2024-11-26)
binary: rustc
commit-hash: 90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf
commit-date: 2024-11-26
host: x86_64-unknown-linux-gnu
release: 1.83.0
LLVM version: 19.1.1

Error output

Backtrace

stack backtrace:
 0:     0x70bd6d84012a - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h5b6bd5631a6d1f6b
 1:     0x70bd6e0218f8 - core::fmt::write::h7550c97b06c86515
 2:     0x70bd6f258b91 - std::io::Write::write_fmt::h7b09c64fe0be9c84
 3:     0x70bd6d83ff82 - std::sys::backtrace::BacktraceLock::print::h2395ccd2c84ba3aa
 4:     0x70bd6d842456 - std::panicking::default_hook::{{closure}}::he19d4c7230e07961
 5:     0x70bd6d8422a0 - std::panicking::default_hook::hf614597d3c67bbdb
 6:     0x70bd6c904556 - std[c6eb78587944e35c]::panicking::update_hook::<alloc[148a978a4a62f5d]::boxed::Box<rustc_driver_impl[4c2d2ad79fb810ac]::install_ice_hook::{closure#0}>>::{closure#0}
 7:     0x70bd6d842b68 - std::panicking::rust_panic_with_hook::h8942133a8b252070
 8:     0x70bd6d84293a - std::panicking::begin_panic_handler::{{closure}}::hb5f5963570096b29
 9:     0x70bd6d8405d9 - std::sys::backtrace::__rust_end_short_backtrace::h6208cedc1922feda
10:     0x70bd6d8425fc - rust_begin_unwind
11:     0x70bd6b2bb160 - core::panicking::panic_fmt::h0c3082644d1bf418
12:     0x70bd6b6223e3 - <rustc_mir_transform[b36c87ceb4bb9a8e]::validate::CfgChecker>::fail::<alloc[148a978a4a62f5d]::string::String>
13:     0x70bd6b621752 - <rustc_mir_transform[b36c87ceb4bb9a8e]::validate::Validator as rustc_mir_transform[b36c87ceb4bb9a8e]::pass_manager::MirPass>::run_pass
14:     0x70bd6e00b674 - rustc_mir_transform[b36c87ceb4bb9a8e]::pass_manager::run_passes_inner
15:     0x70bd6e50a9fa - rustc_mir_transform[b36c87ceb4bb9a8e]::optimized_mir
16:     0x70bd6e508369 - rustc_query_impl[db795c774d495014]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[db795c774d495014]::query_impl::optimized_mir::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 8usize]>>
thread 'rustc' panicked at compiler/rustc_mir_transform/src/validate.rs:95:25:
17:     0x70bd6e45449a - rustc_query_system[b2bb6e43dd6b7fda]::query::plumbing::try_execute_query::<rustc_query_impl[db795c774d495014]::DynamicConfig<rustc_query_system[b2bb6e43dd6b7fda]::query::caches::DefIdCache<rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[db795c774d495014]::plumbing::QueryCtxt, true>
18:     0x70bd6e452aa3 - rustc_query_impl[db795c774d495014]::query_impl::optimized_mir::get_query_incr::__rust_end_short_backtrace
broken MIR in Item(DefId(0:393 ~ pliron_derive[5315]::irfmt::parser::{impl#0}::add_error)) (after phase change to runtime-optimized) at bb1[6]:
Unsize coercion, but `&mut combine::parser::sequence::Skip<combine::parser::sequence::With<combine::parser::error::Expected<combine::parser::repeat::SkipMany<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>, fn(char) -> bool>, &str>>, &str>, combine::parser::choice::Choice<(combine::parser::combinator::Map<(combine::parser::token::Position<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>>, combine::parser::sequence::Between<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>, combine::parser::token::Token<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>>, combine::parser::token::Token<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>>, combine::parser::range::Recognize<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>, combine::parser::repeat::Escaped<combine::parser::range::TakeWhile1<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>, {closure@pliron-derive/src/irfmt/parser.rs:60:21: 60:24}>, combine::parser::token::OneOf<std::str::Chars<'_>, combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>>, char>>>), {closure@pliron-derive/src/irfmt/parser.rs:65:27: 65:37}>, combine::parser::combinator::Map<(combine::parser::token::Position<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>>, combine::parser::sequence::With<combine::parser::token::Token<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>>, combine::parser::range::TakeWhile1<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>, {closure@pliron-derive/src/irfmt/parser.rs:69:43: 69:52}>>), {closure@pliron-derive/src/irfmt/parser.rs:70:27: 70:48}>, combine::parser::combinator::Map<(combine::parser::token::Position<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>>, combine::parser::sequence::Skip<combine::parser::range::TakeWhile1<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>, {closure@pliron-derive/src/irfmt/parser.rs:77:28: 77:37}>, combine::parser::error::Expected<combine::parser::repeat::SkipMany<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>, fn(char) -> bool>, &str>>, &str>>, combine::parser::choice::Optional<combine::parser::sequence::Between<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>, combine::parser::token::Token<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>>, combine::parser::token::Token<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>>, combine::parser::repeat::SepBy<std::vec::Vec<irfmt::Elem>, irfmt::parser::parse_fmt_elem<'_>, combine::parser::token::Token<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>>>>>), {closure@pliron-derive/src/irfmt/parser.rs:79:44: 79:63}>)>>, combine::parser::error::Expected<combine::parser::repeat::SkipMany<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>, fn(char) -> bool>, &str>>, &str>>` isn't coercible to `&mut dyn combine::Parser<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>, Output = irfmt::Elem, PartialState = <impl combine::Parser<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>, Output = irfmt::Elem> as combine::Parser<combine::stream::position::Stream<&str, combine::stream::position::IndexPositioner>>>::PartialState>`
stack backtrace:
19:     0x5ed8cf090f89 - <clippy_lints[3905b9192512dd7f]::redundant_clone::RedundantClone as rustc_lint[81f7d26bc10db165]::passes::LateLintPass>::check_fn
20:     0x70bd6ce3e4f5 - <rustc_lint[81f7d26bc10db165]::late::LateContextAndPass<rustc_lint[81f7d26bc10db165]::late::RuntimeCombinedLateLintPass> as rustc_hir[275953cc48a047ea]::intravisit::Visitor>::visit_fn
21:     0x70bd6ce278e5 - <rustc_lint[81f7d26bc10db165]::late::LateContextAndPass<rustc_lint[81f7d26bc10db165]::late::RuntimeCombinedLateLintPass> as rustc_hir[275953cc48a047ea]::intravisit::Visitor>::visit_nested_item
22:     0x70bd6ce26925 - <rustc_lint[81f7d26bc10db165]::late::LateContextAndPass<rustc_lint[81f7d26bc10db165]::late::RuntimeCombinedLateLintPass> as rustc_hir[275953cc48a047ea]::intravisit::Visitor>::visit_nested_item
23:     0x70bd6ce26925 - <rustc_lint[81f7d26bc10db165]::late::LateContextAndPass<rustc_lint[81f7d26bc10db165]::late::RuntimeCombinedLateLintPass> as rustc_hir[275953cc48a047ea]::intravisit::Visitor>::visit_nested_item
24:     0x70bd6e8e6a8e - rustc_lint[81f7d26bc10db165]::late::check_crate
25:     0x70bd6e8e754e - rustc_interface[88a02114bbdb2383]::passes::analysis
26:     0x70bd6e8e72c9 - rustc_query_impl[db795c774d495014]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[db795c774d495014]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 1usize]>>
27:     0x70bd6effe46e - rustc_query_system[b2bb6e43dd6b7fda]::query::plumbing::try_execute_query::<rustc_query_impl[db795c774d495014]::DynamicConfig<rustc_query_system[b2bb6e43dd6b7fda]::query::caches::SingleCache<rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[db795c774d495014]::plumbing::QueryCtxt, true>
28:     0x70bd6effdfb8 - rustc_query_impl[db795c774d495014]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
29:     0x70bd6ed620bb - rustc_interface[88a02114bbdb2383]::interface::run_compiler::<core[c06ff78fa456ca03]::result::Result<(), rustc_span[3e5cf3424d44936d]::ErrorGuaranteed>, rustc_driver_impl[4c2d2ad79fb810ac]::run_compiler::{closure#0}>::{closure#1}
30:     0x70bd6ed533d9 - std[c6eb78587944e35c]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[88a02114bbdb2383]::util::run_in_thread_with_globals<rustc_interface[88a02114bbdb2383]::interface::run_compiler<core[c06ff78fa456ca03]::result::Result<(), rustc_span[3e5cf3424d44936d]::ErrorGuaranteed>, rustc_driver_impl[4c2d2ad79fb810ac]::run_compiler::{closure#0}>::{closure#1}, core[c06ff78fa456ca03]::result::Result<(), rustc_span[3e5cf3424d44936d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[c06ff78fa456ca03]::result::Result<(), rustc_span[3e5cf3424d44936d]::ErrorGuaranteed>>
31:     0x70bd6ee22fac - <<std[c6eb78587944e35c]::thread::Builder>::spawn_unchecked_<rustc_interface[88a02114bbdb2383]::util::run_in_thread_with_globals<rustc_interface[88a02114bbdb2383]::interface::run_compiler<core[c06ff78fa456ca03]::result::Result<(), rustc_span[3e5cf3424d44936d]::ErrorGuaranteed>, rustc_driver_impl[4c2d2ad79fb810ac]::run_compiler::{closure#0}>::{closure#1}, core[c06ff78fa456ca03]::result::Result<(), rustc_span[3e5cf3424d44936d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[c06ff78fa456ca03]::result::Result<(), rustc_span[3e5cf3424d44936d]::ErrorGuaranteed>>::{closure#1} as core[c06ff78fa456ca03]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
32:     0x70bd6ee23a6b - std::sys::pal::unix::thread::Thread::new::thread_start::hcc78f3943333fa94
 0:     0x718bf584012a - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h5b6bd5631a6d1f6b
 1:     0x718bf60218f8 - core::fmt::write::h7550c97b06c86515
 2:     0x718bf7258b91 - std::io::Write::write_fmt::h7b09c64fe0be9c84
 3:     0x718bf583ff82 - std::sys::backtrace::BacktraceLock::print::h2395ccd2c84ba3aa
 4:     0x718bf5842456 - std::panicking::default_hook::{{closure}}::he19d4c7230e07961
 5:     0x718bf58422a0 - std::panicking::default_hook::hf614597d3c67bbdb
 6:     0x718bf4904556 - std[c6eb78587944e35c]::panicking::update_hook::<alloc[148a978a4a62f5d]::boxed::Box<rustc_driver_impl[4c2d2ad79fb810ac]::install_ice_hook::{closure#0}>>::{closure#0}
 7:     0x718bf5842b68 - std::panicking::rust_panic_with_hook::h8942133a8b252070
 8:     0x718bf584293a - std::panicking::begin_panic_handler::{{closure}}::hb5f5963570096b29
 9:     0x718bf58405d9 - std::sys::backtrace::__rust_end_short_backtrace::h6208cedc1922feda
10:     0x718bf58425fc - rust_begin_unwind
11:     0x718bf32bb160 - core::panicking::panic_fmt::h0c3082644d1bf418
12:     0x718bf36223e3 - <rustc_mir_transform[b36c87ceb4bb9a8e]::validate::CfgChecker>::fail::<alloc[148a978a4a62f5d]::string::String>
13:     0x718bf3621752 - <rustc_mir_transform[b36c87ceb4bb9a8e]::validate::Validator as rustc_mir_transform[b36c87ceb4bb9a8e]::pass_manager::MirPass>::run_pass
14:     0x718bf600b674 - rustc_mir_transform[b36c87ceb4bb9a8e]::pass_manager::run_passes_inner
15:     0x718bf650a9fa - rustc_mir_transform[b36c87ceb4bb9a8e]::optimized_mir
16:     0x718bf6508369 - rustc_query_impl[db795c774d495014]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[db795c774d495014]::query_impl::optimized_mir::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 8usize]>>
17:     0x718bf645449a - rustc_query_system[b2bb6e43dd6b7fda]::query::plumbing::try_execute_query::<rustc_query_impl[db795c774d495014]::DynamicConfig<rustc_query_system[b2bb6e43dd6b7fda]::query::caches::DefIdCache<rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[db795c774d495014]::plumbing::QueryCtxt, true>
18:     0x718bf6452aa3 - rustc_query_impl[db795c774d495014]::query_impl::optimized_mir::get_query_incr::__rust_end_short_backtrace
19:     0x651aa2287f89 - <clippy_lints[3905b9192512dd7f]::redundant_clone::RedundantClone as rustc_lint[81f7d26bc10db165]::passes::LateLintPass>::check_fn
20:     0x718bf4e3e4f5 - <rustc_lint[81f7d26bc10db165]::late::LateContextAndPass<rustc_lint[81f7d26bc10db165]::late::RuntimeCombinedLateLintPass> as rustc_hir[275953cc48a047ea]::intravisit::Visitor>::visit_fn
21:     0x718bf4e278e5 - <rustc_lint[81f7d26bc10db165]::late::LateContextAndPass<rustc_lint[81f7d26bc10db165]::late::RuntimeCombinedLateLintPass> as rustc_hir[275953cc48a047ea]::intravisit::Visitor>::visit_nested_item
22:     0x718bf4e26925 - <rustc_lint[81f7d26bc10db165]::late::LateContextAndPass<rustc_lint[81f7d26bc10db165]::late::RuntimeCombinedLateLintPass> as rustc_hir[275953cc48a047ea]::intravisit::Visitor>::visit_nested_item
23:     0x718bf4e26925 - <rustc_lint[81f7d26bc10db165]::late::LateContextAndPass<rustc_lint[81f7d26bc10db165]::late::RuntimeCombinedLateLintPass> as rustc_hir[275953cc48a047ea]::intravisit::Visitor>::visit_nested_item
24:     0x718bf68e6a8e - rustc_lint[81f7d26bc10db165]::late::check_crate
25:     0x718bf68e754e - rustc_interface[88a02114bbdb2383]::passes::analysis
26:     0x718bf68e72c9 - rustc_query_impl[db795c774d495014]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[db795c774d495014]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 1usize]>>
27:     0x718bf6ffe46e - rustc_query_system[b2bb6e43dd6b7fda]::query::plumbing::try_execute_query::<rustc_query_impl[db795c774d495014]::DynamicConfig<rustc_query_system[b2bb6e43dd6b7fda]::query::caches::SingleCache<rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[db795c774d495014]::plumbing::QueryCtxt, true>
28:     0x718bf6ffdfb8 - rustc_query_impl[db795c774d495014]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
29:     0x718bf6d620bb - rustc_interface[88a02114bbdb2383]::interface::run_compiler::<core[c06ff78fa456ca03]::result::Result<(), rustc_span[3e5cf3424d44936d]::ErrorGuaranteed>, rustc_driver_impl[4c2d2ad79fb810ac]::run_compiler::{closure#0}>::{closure#1}
30:     0x718bf6d533d9 - std[c6eb78587944e35c]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[88a02114bbdb2383]::util::run_in_thread_with_globals<rustc_interface[88a02114bbdb2383]::interface::run_compiler<core[c06ff78fa456ca03]::result::Result<(), rustc_span[3e5cf3424d44936d]::ErrorGuaranteed>, rustc_driver_impl[4c2d2ad79fb810ac]::run_compiler::{closure#0}>::{closure#1}, core[c06ff78fa456ca03]::result::Result<(), rustc_span[3e5cf3424d44936d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[c06ff78fa456ca03]::result::Result<(), rustc_span[3e5cf3424d44936d]::ErrorGuaranteed>>
31:     0x718bf6e22fac - <<std[c6eb78587944e35c]::thread::Builder>::spawn_unchecked_<rustc_interface[88a02114bbdb2383]::util::run_in_thread_with_globals<rustc_interface[88a02114bbdb2383]::interface::run_compiler<core[c06ff78fa456ca03]::result::Result<(), rustc_span[3e5cf3424d44936d]::ErrorGuaranteed>, rustc_driver_impl[4c2d2ad79fb810ac]::run_compiler::{closure#0}>::{closure#1}, core[c06ff78fa456ca03]::result::Result<(), rustc_span[3e5cf3424d44936d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[c06ff78fa456ca03]::result::Result<(), rustc_span[3e5cf3424d44936d]::ErrorGuaranteed>>::{closure#1} as core[c06ff78fa456ca03]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
32:     0x718bf6e23a6b - std::sys::pal::unix::thread::Thread::new::thread_start::hcc78f3943333fa94
33:     0x70bd6909ca94 - start_thread
                             at ./nptl/pthread_create.c:447:8
34:     0x70bd69129c3c - clone3
                             at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
35:                0x0 - <unknown>

@vaivaswatha vaivaswatha added C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ labels Dec 16, 2024
vaivaswatha added a commit to vaivaswatha/pliron that referenced this issue Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

1 participant