Closed
Description
Code
fn main() {
println!("{foo}{foo:?}", foo = "bar");
}
Meta
Rust version (rustc -Vv
):
rustc 1.58.0-nightly (e99963c55 2021-10-29)
binary: rustc
commit-hash: e99963c554e4d12010c2dea9f46d7bbd41dc1271
commit-date: 2021-10-29
host: x86_64-unknown-linux-gnu
release: 1.58.0-nightly
LLVM version: 13.0.0
Error output
thread 'rustc' panicked at 'index out of bounds: the len is 1 but the index is 1', src/tools/clippy/clippy_utils/src/higher.rs:592:61
Backtrace
stack backtrace:
0: 0x7f79fd78c76c - std::backtrace_rs::backtrace::libunwind::trace::hc6c3491277866fea
at /rustc/e99963c554e4d12010c2dea9f46d7bbd41dc1271/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
1: 0x7f79fd78c76c - std::backtrace_rs::backtrace::trace_unsynchronized::h4524f073368a5b13
at /rustc/e99963c554e4d12010c2dea9f46d7bbd41dc1271/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x7f79fd78c76c - std::sys_common::backtrace::_print_fmt::h0d0cace6159902af
at /rustc/e99963c554e4d12010c2dea9f46d7bbd41dc1271/library/std/src/sys_common/backtrace.rs:67:5
3: 0x7f79fd78c76c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3e6af6f05919a7fc
at /rustc/e99963c554e4d12010c2dea9f46d7bbd41dc1271/library/std/src/sys_common/backtrace.rs:46:22
4: 0x7f79fd7e99ac - core::fmt::write::h72801a82c94e6ff1
at /rustc/e99963c554e4d12010c2dea9f46d7bbd41dc1271/library/core/src/fmt/mod.rs:1149:17
5: 0x7f79fd77ce95 - std::io::Write::write_fmt::ha4f5d34aaccbac84
at /rustc/e99963c554e4d12010c2dea9f46d7bbd41dc1271/library/std/src/io/mod.rs:1696:15
6: 0x7f79fd78f9c0 - std::sys_common::backtrace::_print::heed69f5ce9a8e189
at /rustc/e99963c554e4d12010c2dea9f46d7bbd41dc1271/library/std/src/sys_common/backtrace.rs:49:5
7: 0x7f79fd78f9c0 - std::sys_common::backtrace::print::h5f3918bd80c09252
at /rustc/e99963c554e4d12010c2dea9f46d7bbd41dc1271/library/std/src/sys_common/backtrace.rs:36:9
8: 0x7f79fd78f9c0 - std::panicking::default_hook::{{closure}}::h5af30648530eb3d0
at /rustc/e99963c554e4d12010c2dea9f46d7bbd41dc1271/library/std/src/panicking.rs:210:50
9: 0x7f79fd78f56b - std::panicking::default_hook::he88d5fb1ba1b4c19
at /rustc/e99963c554e4d12010c2dea9f46d7bbd41dc1271/library/std/src/panicking.rs:227:9
10: 0x564959f1e089 - clippy_driver[dbc6d5f654e79c6b]::ICE_HOOK::{closure#0}::{closure#0}
11: 0x7f79fd7901d9 - std::panicking::rust_panic_with_hook::h01febc308b2b313b
at /rustc/e99963c554e4d12010c2dea9f46d7bbd41dc1271/library/std/src/panicking.rs:607:17
12: 0x7f79fd78fc90 - std::panicking::begin_panic_handler::{{closure}}::h24a6d13f5560b71f
at /rustc/e99963c554e4d12010c2dea9f46d7bbd41dc1271/library/std/src/panicking.rs:499:13
13: 0x7f79fd78cc14 - std::sys_common::backtrace::__rust_end_short_backtrace::h3e2917f0da9fbc5c
at /rustc/e99963c554e4d12010c2dea9f46d7bbd41dc1271/library/std/src/sys_common/backtrace.rs:139:18
14: 0x7f79fd78fbf9 - rust_begin_unwind
at /rustc/e99963c554e4d12010c2dea9f46d7bbd41dc1271/library/std/src/panicking.rs:495:5
15: 0x7f79fd755151 - core::panicking::panic_fmt::h7b8580d81fcbbacd
at /rustc/e99963c554e4d12010c2dea9f46d7bbd41dc1271/library/core/src/panicking.rs:106:14
16: 0x7f79fd755112 - core::panicking::panic_bounds_check::h63650a5dfc9aa86f
at /rustc/e99963c554e4d12010c2dea9f46d7bbd41dc1271/library/core/src/panicking.rs:74:5
17: 0x56495a2989ac - <core[cc79c391059f8e46]::iter::adapters::map::Map<core[cc79c391059f8e46]::iter::adapters::map::Map<core[cc79c391059f8e46]::slice::iter::Iter<rustc_hir[ebe20662f7c118b7]::hir::Expr>, <clippy_utils[74a7d98358495316]::higher::FormatArgsExpn>::args::{closure#1}>, <core[cc79c391059f8e46]::option::Option<alloc[9a4bc13598ff604f]::vec::Vec<clippy_utils[74a7d98358495316]::higher::FormatArgsArg>> as core[cc79c391059f8e46]::iter::traits::collect::FromIterator<core[cc79c391059f8e46]::option::Option<clippy_utils[74a7d98358495316]::higher::FormatArgsArg>>>::from_iter<core[cc79c391059f8e46]::iter::adapters::map::Map<core[cc79c391059f8e46]::slice::iter::Iter<rustc_hir[ebe20662f7c118b7]::hir::Expr>, <clippy_utils[74a7d98358495316]::higher::FormatArgsExpn>::args::{closure#1}>>::{closure#0}> as core[cc79c391059f8e46]::iter::traits::iterator::Iterator>::try_fold::<(), <core[cc79c391059f8e46]::iter::adapters::ResultShunt<core[cc79c391059f8e46]::iter::adapters::map::Map<core[cc79c391059f8e46]::iter::adapters::map::Map<core[cc79c391059f8e46]::slice::iter::Iter<rustc_hir[ebe20662f7c118b7]::hir::Expr>, <clippy_utils[74a7d98358495316]::higher::FormatArgsExpn>::args::{closure#1}>, <core[cc79c391059f8e46]::option::Option<alloc[9a4bc13598ff604f]::vec::Vec<clippy_utils[74a7d98358495316]::higher::FormatArgsArg>> as core[cc79c391059f8e46]::iter::traits::collect::FromIterator<core[cc79c391059f8e46]::option::Option<clippy_utils[74a7d98358495316]::higher::FormatArgsArg>>>::from_iter<core[cc79c391059f8e46]::iter::adapters::map::Map<core[cc79c391059f8e46]::slice::iter::Iter<rustc_hir[ebe20662f7c118b7]::hir::Expr>, <clippy_utils[74a7d98358495316]::higher::FormatArgsExpn>::args::{closure#1}>>::{closure#0}>, ()> as core[cc79c391059f8e46]::iter::traits::iterator::Iterator>::try_fold<(), core[cc79c391059f8e46]::iter::traits::iterator::Iterator::find::check<clippy_utils[74a7d98358495316]::higher::FormatArgsArg, <core[cc79c391059f8e46]::iter::adapters::ResultShunt<core[cc79c391059f8e46]::iter::adapters::map::Map<core[cc79c391059f8e46]::iter::adapters::map::Map<core[cc79c391059f8e46]::slice::iter::Iter<rustc_hir[ebe20662f7c118b7]::hir::Expr>, <clippy_utils[74a7d98358495316]::higher::FormatArgsExpn>::args::{closure#1}>, <core[cc79c391059f8e46]::option::Option<alloc[9a4bc13598ff604f]::vec::Vec<clippy_utils[74a7d98358495316]::higher::FormatArgsArg>> as core[cc79c391059f8e46]::iter::traits::collect::FromIterator<core[cc79c391059f8e46]::option::Option<clippy_utils[74a7d98358495316]::higher::FormatArgsArg>>>::from_iter<core[cc79c391059f8e46]::iter::adapters::map::Map<core[cc79c391059f8e46]::slice::iter::Iter<rustc_hir[ebe20662f7c118b7]::hir::Expr>, <clippy_utils[74a7d98358495316]::higher::FormatArgsExpn>::args::{closure#1}>>::{closure#0}>, ()> as core[cc79c391059f8e46]::iter::traits::iterator::Iterator>::next::{closure#0}>::{closure#0}, core[cc79c391059f8e46]::ops::control_flow::ControlFlow<clippy_utils[74a7d98358495316]::higher::FormatArgsArg>>::{closure#0}, core[cc79c391059f8e46]::ops::control_flow::ControlFlow<core[cc79c391059f8e46]::ops::control_flow::ControlFlow<clippy_utils[74a7d98358495316]::higher::FormatArgsArg>>>
18: 0x56495a29aa6e - <alloc[9a4bc13598ff604f]::vec::Vec<clippy_utils[74a7d98358495316]::higher::FormatArgsArg> as alloc[9a4bc13598ff604f]::vec::spec_from_iter::SpecFromIter<clippy_utils[74a7d98358495316]::higher::FormatArgsArg, core[cc79c391059f8e46]::iter::adapters::ResultShunt<core[cc79c391059f8e46]::iter::adapters::map::Map<core[cc79c391059f8e46]::iter::adapters::map::Map<core[cc79c391059f8e46]::slice::iter::Iter<rustc_hir[ebe20662f7c118b7]::hir::Expr>, <clippy_utils[74a7d98358495316]::higher::FormatArgsExpn>::args::{closure#1}>, <core[cc79c391059f8e46]::option::Option<alloc[9a4bc13598ff604f]::vec::Vec<clippy_utils[74a7d98358495316]::higher::FormatArgsArg>> as core[cc79c391059f8e46]::iter::traits::collect::FromIterator<core[cc79c391059f8e46]::option::Option<clippy_utils[74a7d98358495316]::higher::FormatArgsArg>>>::from_iter<core[cc79c391059f8e46]::iter::adapters::map::Map<core[cc79c391059f8e46]::slice::iter::Iter<rustc_hir[ebe20662f7c118b7]::hir::Expr>, <clippy_utils[74a7d98358495316]::higher::FormatArgsExpn>::args::{closure#1}>>::{closure#0}>, ()>>>::from_iter
19: 0x56495a276e2f - <clippy_utils[74a7d98358495316]::higher::FormatArgsExpn>::args
20: 0x56495a172029 - <clippy_lints[9e92ca657df0f7ec]::format_args::FormatArgs as rustc_lint[de47920a91b77d90]::passes::LateLintPass>::check_expr
21: 0x7f79fecde2a4 - <rustc_lint[de47920a91b77d90]::late::LateLintPassObjects as rustc_lint[de47920a91b77d90]::passes::LateLintPass>::check_expr
22: 0x7f79fe03a40c - <rustc_lint[de47920a91b77d90]::late::LateContextAndPass<rustc_lint[de47920a91b77d90]::late::LateLintPassObjects> as rustc_hir[ebe20662f7c118b7]::intravisit::Visitor>::visit_expr
23: 0x7f79fe034c0b - rustc_hir[ebe20662f7c118b7]::intravisit::walk_expr::<rustc_lint[de47920a91b77d90]::late::LateContextAndPass<rustc_lint[de47920a91b77d90]::late::LateLintPassObjects>>
24: 0x7f79fe03a417 - <rustc_lint[de47920a91b77d90]::late::LateContextAndPass<rustc_lint[de47920a91b77d90]::late::LateLintPassObjects> as rustc_hir[ebe20662f7c118b7]::intravisit::Visitor>::visit_expr
25: 0x7f79fe03a542 - <rustc_lint[de47920a91b77d90]::late::LateContextAndPass<rustc_lint[de47920a91b77d90]::late::LateLintPassObjects> as rustc_hir[ebe20662f7c118b7]::intravisit::Visitor>::visit_stmt
26: 0x7f79fe0332d7 - rustc_hir[ebe20662f7c118b7]::intravisit::walk_block::<rustc_lint[de47920a91b77d90]::late::LateContextAndPass<rustc_lint[de47920a91b77d90]::late::LateLintPassObjects>>
27: 0x7f79fe03a589 - <rustc_lint[de47920a91b77d90]::late::LateContextAndPass<rustc_lint[de47920a91b77d90]::late::LateLintPassObjects> as rustc_hir[ebe20662f7c118b7]::intravisit::Visitor>::visit_block
28: 0x7f79fe03a417 - <rustc_lint[de47920a91b77d90]::late::LateContextAndPass<rustc_lint[de47920a91b77d90]::late::LateLintPassObjects> as rustc_hir[ebe20662f7c118b7]::intravisit::Visitor>::visit_expr
29: 0x7f79fe03a542 - <rustc_lint[de47920a91b77d90]::late::LateContextAndPass<rustc_lint[de47920a91b77d90]::late::LateLintPassObjects> as rustc_hir[ebe20662f7c118b7]::intravisit::Visitor>::visit_stmt
30: 0x7f79fe0332d7 - rustc_hir[ebe20662f7c118b7]::intravisit::walk_block::<rustc_lint[de47920a91b77d90]::late::LateContextAndPass<rustc_lint[de47920a91b77d90]::late::LateLintPassObjects>>
31: 0x7f79fe03a589 - <rustc_lint[de47920a91b77d90]::late::LateContextAndPass<rustc_lint[de47920a91b77d90]::late::LateLintPassObjects> as rustc_hir[ebe20662f7c118b7]::intravisit::Visitor>::visit_block
32: 0x7f79fe03a417 - <rustc_lint[de47920a91b77d90]::late::LateContextAndPass<rustc_lint[de47920a91b77d90]::late::LateLintPassObjects> as rustc_hir[ebe20662f7c118b7]::intravisit::Visitor>::visit_expr
33: 0x7f79fe03aa0c - <rustc_lint[de47920a91b77d90]::late::LateContextAndPass<rustc_lint[de47920a91b77d90]::late::LateLintPassObjects> as rustc_hir[ebe20662f7c118b7]::intravisit::Visitor>::visit_nested_body
34: 0x7f79fe03ac7a - <rustc_lint[de47920a91b77d90]::late::LateContextAndPass<rustc_lint[de47920a91b77d90]::late::LateLintPassObjects> as rustc_hir[ebe20662f7c118b7]::intravisit::Visitor>::visit_fn
35: 0x7f79fe0350d2 - rustc_hir[ebe20662f7c118b7]::intravisit::walk_item::<rustc_lint[de47920a91b77d90]::late::LateContextAndPass<rustc_lint[de47920a91b77d90]::late::LateLintPassObjects>>
36: 0x7f79fe03b807 - <rustc_lint[de47920a91b77d90]::late::LateContextAndPass<rustc_lint[de47920a91b77d90]::late::LateLintPassObjects> as rustc_hir[ebe20662f7c118b7]::intravisit::Visitor>::visit_nested_item
37: 0x7f79fe034797 - rustc_hir[ebe20662f7c118b7]::intravisit::walk_mod::<rustc_lint[de47920a91b77d90]::late::LateContextAndPass<rustc_lint[de47920a91b77d90]::late::LateLintPassObjects>>
38: 0x7f79fe03adac - <rustc_lint[de47920a91b77d90]::late::LateContextAndPass<rustc_lint[de47920a91b77d90]::late::LateLintPassObjects> as rustc_hir[ebe20662f7c118b7]::intravisit::Visitor>::visit_mod
39: 0x7f79fe0305a8 - <rustc_middle[5d69d80fd58182b4]::hir::map::Map>::walk_toplevel_module::<rustc_lint[de47920a91b77d90]::late::LateContextAndPass<rustc_lint[de47920a91b77d90]::late::LateLintPassObjects>>
40: 0x7f79fe037b58 - rustc_lint[de47920a91b77d90]::late::late_lint_pass_crate::<rustc_lint[de47920a91b77d90]::late::LateLintPassObjects>
41: 0x7f79ffe39750 - <rustc_session[3b6910ad19e800a6]::session::Session>::time::<(), rustc_lint[de47920a91b77d90]::late::check_crate<rustc_lint[de47920a91b77d90]::BuiltinCombinedLateLintPass, rustc_interface[71a95cb40f833645]::passes::analysis::{closure#5}::{closure#0}::{closure#3}::{closure#0}::{closure#0}>::{closure#0}::{closure#0}>
42: 0x7f79ffe39ec0 - <rustc_session[3b6910ad19e800a6]::session::Session>::time::<(), rustc_interface[71a95cb40f833645]::passes::analysis::{closure#5}::{closure#0}::{closure#3}::{closure#0}>
43: 0x7f79ffe2e429 - <core[cc79c391059f8e46]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[71a95cb40f833645]::passes::analysis::{closure#5}::{closure#0}> as core[cc79c391059f8e46]::ops::function::FnOnce<()>>::call_once
44: 0x7f79ffe3b718 - <rustc_session[3b6910ad19e800a6]::session::Session>::time::<(), rustc_interface[71a95cb40f833645]::passes::analysis::{closure#5}>
45: 0x7f79ffe1941c - rustc_interface[71a95cb40f833645]::passes::analysis
46: 0x7f7a0039e9f0 - <rustc_query_system[b3ad412178d53c83]::dep_graph::graph::DepGraph<rustc_middle[5d69d80fd58182b4]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[5d69d80fd58182b4]::ty::context::TyCtxt, (), core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>>
47: 0x7f7a003462b3 - rustc_data_structures[3cd648c062680881]::stack::ensure_sufficient_stack::<(core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>, rustc_query_system[b3ad412178d53c83]::dep_graph::graph::DepNodeIndex), rustc_query_system[b3ad412178d53c83]::query::plumbing::execute_job<rustc_query_impl[fe5fc68bac3e7249]::plumbing::QueryCtxt, (), core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>>::{closure#3}>
48: 0x7f7a002ad6b6 - rustc_query_system[b3ad412178d53c83]::query::plumbing::try_execute_query::<rustc_query_impl[fe5fc68bac3e7249]::plumbing::QueryCtxt, rustc_query_system[b3ad412178d53c83]::query::caches::DefaultCache<(), core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>>>
49: 0x7f7a0030e205 - rustc_query_system[b3ad412178d53c83]::query::plumbing::get_query::<rustc_query_impl[fe5fc68bac3e7249]::queries::analysis, rustc_query_impl[fe5fc68bac3e7249]::plumbing::QueryCtxt>
50: 0x7f79ffe093d9 - <rustc_interface[71a95cb40f833645]::passes::QueryContext>::enter::<rustc_driver[98914a17e63058c]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>>
51: 0x7f79ffdf6344 - <rustc_interface[71a95cb40f833645]::interface::Compiler>::enter::<rustc_driver[98914a17e63058c]::run_compiler::{closure#1}::{closure#2}, core[cc79c391059f8e46]::result::Result<core[cc79c391059f8e46]::option::Option<rustc_interface[71a95cb40f833645]::queries::Linker>, rustc_errors[932abaefb61eb634]::ErrorReported>>
52: 0x7f79ffde6e4f - rustc_span[b6a32fa5db97fd22]::with_source_map::<core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>, rustc_interface[71a95cb40f833645]::interface::create_compiler_and_run<core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>, rustc_driver[98914a17e63058c]::run_compiler::{closure#1}>::{closure#0}>
53: 0x7f79ffdf7270 - <scoped_tls[3fea4c3dcac147b1]::ScopedKey<rustc_span[b6a32fa5db97fd22]::SessionGlobals>>::set::<rustc_interface[71a95cb40f833645]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[71a95cb40f833645]::interface::run_compiler<core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>, rustc_driver[98914a17e63058c]::run_compiler::{closure#1}>::{closure#0}, core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>>::{closure#0}::{closure#0}, core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>>
54: 0x7f79ffde96d5 - std[fcea40badc263c8f]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[71a95cb40f833645]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[71a95cb40f833645]::interface::run_compiler<core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>, rustc_driver[98914a17e63058c]::run_compiler::{closure#1}>::{closure#0}, core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>>::{closure#0}, core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>>
55: 0x7f79ffe0bee2 - <<std[fcea40badc263c8f]::thread::Builder>::spawn_unchecked<rustc_interface[71a95cb40f833645]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[71a95cb40f833645]::interface::run_compiler<core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>, rustc_driver[98914a17e63058c]::run_compiler::{closure#1}>::{closure#0}, core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>>::{closure#0}, core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>>::{closure#1} as core[cc79c391059f8e46]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
56: 0x7f79fd79b4c3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd81bd86213781012
at /rustc/e99963c554e4d12010c2dea9f46d7bbd41dc1271/library/alloc/src/boxed.rs:1691:9
57: 0x7f79fd79b4c3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h7b3e346f5d8f6d6a
at /rustc/e99963c554e4d12010c2dea9f46d7bbd41dc1271/library/alloc/src/boxed.rs:1691:9
58: 0x7f79fd79b4c3 - std::sys::unix::thread::Thread::new::thread_start::ha575792f17151d60
at /rustc/e99963c554e4d12010c2dea9f46d7bbd41dc1271/library/std/src/sys/unix/thread.rs:106:17
59: 0x7f79fd46cb37 - start_thread
60: 0x7f79fd4f1640 - clone3
61: 0x0 - <unknown>
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new
note: Clippy version: clippy 0.1.58 (e99963c 2021-10-29)
query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `foo`
cc @smoelius since this code was added in c9599d7#diff-fd2bc43d49c8eb65110d5ac1439fce94b0b59cff73c5802d202d65ae6e08a025R592