Skip to content

'index out of bounds: the len is 1 but the index is 1', src/tools/clippy/clippy_lints/src/ptr.rs:644:25 #8386

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

Closed
matthiaskrgr opened this issue Feb 1, 2022 · 0 comments · Fixed by #8387
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@matthiaskrgr
Copy link
Member

Summary

git clone https://github.com/rust-analyzer/rust-analyzer/
cd rust-analyzer
git checkout 6634eaf13a7e3a2b30f98f6e69af952f2d760df4
cd crates/proc_macro_api
cargo clippy -- --cap-lints warn

Version

rustc 1.60.0-nightly (498eeb72f 2022-01-31)
binary: rustc
commit-hash: 498eeb72f590e518e19746b346be53713689e207
commit-date: 2022-01-31
host: x86_64-unknown-linux-gnu
release: 1.60.0-nightly
LLVM version: 13.0.0

Error output

Backtrace

thread 'rustc' panicked at 'index out of bounds: the len is 1 but the index is 1', src/tools/clippy/clippy_lints/src/ptr.rs:644:25
stack backtrace:
 0:     0x7fc68b10e8bc - std::backtrace_rs::backtrace::libunwind::trace::h57f7807b414eb329
                             at /rustc/498eeb72f590e518e19746b346be53713689e207/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
 1:     0x7fc68b10e8bc - std::backtrace_rs::backtrace::trace_unsynchronized::hbdc9ceca4a060796
                             at /rustc/498eeb72f590e518e19746b346be53713689e207/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
 2:     0x7fc68b10e8bc - std::sys_common::backtrace::_print_fmt::h27b5ccb1591e1f2e
                             at /rustc/498eeb72f590e518e19746b346be53713689e207/library/std/src/sys_common/backtrace.rs:67:5
 3:     0x7fc68b10e8bc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h9d599eca26bfbfe0
                             at /rustc/498eeb72f590e518e19746b346be53713689e207/library/std/src/sys_common/backtrace.rs:46:22
 4:     0x7fc68b16fd2c - core::fmt::write::hc18d9fcf926de540
                             at /rustc/498eeb72f590e518e19746b346be53713689e207/library/core/src/fmt/mod.rs:1190:17
 5:     0x7fc68b0fde73 - std::io::Write::write_fmt::h01252dec1ee17d5d
                             at /rustc/498eeb72f590e518e19746b346be53713689e207/library/std/src/io/mod.rs:1653:15
 6:     0x7fc68b112ce2 - std::sys_common::backtrace::_print::hbf6e4652dcbb9d3e
                             at /rustc/498eeb72f590e518e19746b346be53713689e207/library/std/src/sys_common/backtrace.rs:49:5
 7:     0x7fc68b112ce2 - std::sys_common::backtrace::print::h9b9cd8c491550afc
                             at /rustc/498eeb72f590e518e19746b346be53713689e207/library/std/src/sys_common/backtrace.rs:36:9
 8:     0x7fc68b112ce2 - std::panicking::default_hook::{{closure}}::hf1ff40c60b5ab30d
                             at /rustc/498eeb72f590e518e19746b346be53713689e207/library/std/src/panicking.rs:290:50
 9:     0x7fc68b1128c5 - std::panicking::default_hook::h4651ea8e62ea60f2
                             at /rustc/498eeb72f590e518e19746b346be53713689e207/library/std/src/panicking.rs:307:9
10:     0x563fa2b1e571 - clippy_driver[ca87026c7a38ebfb]::ICE_HOOK::{closure#0}::{closure#0}
11:     0x7fc676857589 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hb83eb55f482facb0
12:     0x7fc676894b54 - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::h8ca10bb03731e98a
13:     0x7fc6768f3d06 - std::panicking::update_hook::{{closure}}::h23a548444e3d640e
14:     0x7fc68b1134fb - std::panicking::rust_panic_with_hook::h595b878a5a043a08
                             at /rustc/498eeb72f590e518e19746b346be53713689e207/library/std/src/panicking.rs:695:17
15:     0x7fc68b1131b7 - std::panicking::begin_panic_handler::{{closure}}::hc7507907a9ea289e
                             at /rustc/498eeb72f590e518e19746b346be53713689e207/library/std/src/panicking.rs:581:13
16:     0x7fc68b10ed64 - std::sys_common::backtrace::__rust_end_short_backtrace::hc1cd0ec74aad6d4d
                             at /rustc/498eeb72f590e518e19746b346be53713689e207/library/std/src/sys_common/backtrace.rs:139:18
17:     0x7fc68b112ec9 - rust_begin_unwind
                             at /rustc/498eeb72f590e518e19746b346be53713689e207/library/std/src/panicking.rs:577:5
18:     0x7fc68b0da7d3 - core::panicking::panic_fmt::h4ba65dd8f60b462e
                             at /rustc/498eeb72f590e518e19746b346be53713689e207/library/core/src/panicking.rs:135:14
19:     0x7fc68b0da722 - core::panicking::panic_bounds_check::hd091da064864f323
                             at /rustc/498eeb72f590e518e19746b346be53713689e207/library/core/src/panicking.rs:77:5
20:     0x563fa2cd1c66 - <hashbrown[eb61a139ecd08067]::map::HashMap<rustc_hir[4fd4c8cfa82df924]::hir_id::HirId, usize, core[ea131dd00119fcdf]::hash::BuildHasherDefault<rustc_hash[ddc3963188a291e8]::FxHasher>> as core[ea131dd00119fcdf]::iter::traits::collect::Extend<(rustc_hir[4fd4c8cfa82df924]::hir_id::HirId, usize)>>::extend::<core[ea131dd00119fcdf]::iter::adapters::filter_map::FilterMap<core[ea131dd00119fcdf]::iter::adapters::enumerate::Enumerate<core[ea131dd00119fcdf]::slice::iter::Iter<clippy_lints[97b25566a96a474f]::ptr::PtrArg>>, clippy_lints[97b25566a96a474f]::ptr::check_ptr_arg_usage::{closure#1}>>
21:     0x563fa2ce79b3 - <clippy_lints[97b25566a96a474f]::ptr::Ptr as rustc_lint[af83189a70346794]::passes::LateLintPass>::check_body
22:     0x7fc68c677711 - <rustc_lint[af83189a70346794]::late::LateLintPassObjects as rustc_lint[af83189a70346794]::passes::LateLintPass>::check_body
23:     0x7fc68b9e315b - <rustc_lint[af83189a70346794]::late::LateContextAndPass<rustc_lint[af83189a70346794]::late::LateLintPassObjects> as rustc_hir[4fd4c8cfa82df924]::intravisit::Visitor>::visit_nested_body
24:     0x7fc68b9e35ba - <rustc_lint[af83189a70346794]::late::LateContextAndPass<rustc_lint[af83189a70346794]::late::LateLintPassObjects> as rustc_hir[4fd4c8cfa82df924]::intravisit::Visitor>::visit_fn
25:     0x7fc68b97a732 - rustc_hir[4fd4c8cfa82df924]::intravisit::walk_item::<rustc_lint[af83189a70346794]::late::LateContextAndPass<rustc_lint[af83189a70346794]::late::LateLintPassObjects>>
26:     0x7fc68b9e2355 - <rustc_lint[af83189a70346794]::late::LateContextAndPass<rustc_lint[af83189a70346794]::late::LateLintPassObjects> as rustc_hir[4fd4c8cfa82df924]::intravisit::Visitor>::visit_nested_item
27:     0x7fc68b97a327 - rustc_hir[4fd4c8cfa82df924]::intravisit::walk_mod::<rustc_lint[af83189a70346794]::late::LateContextAndPass<rustc_lint[af83189a70346794]::late::LateLintPassObjects>>
28:     0x7fc68b9e3a9c - <rustc_lint[af83189a70346794]::late::LateContextAndPass<rustc_lint[af83189a70346794]::late::LateLintPassObjects> as rustc_hir[4fd4c8cfa82df924]::intravisit::Visitor>::visit_mod
29:     0x7fc68b9e2355 - <rustc_lint[af83189a70346794]::late::LateContextAndPass<rustc_lint[af83189a70346794]::late::LateLintPassObjects> as rustc_hir[4fd4c8cfa82df924]::intravisit::Visitor>::visit_nested_item
30:     0x7fc68b97a327 - rustc_hir[4fd4c8cfa82df924]::intravisit::walk_mod::<rustc_lint[af83189a70346794]::late::LateContextAndPass<rustc_lint[af83189a70346794]::late::LateLintPassObjects>>
31:     0x7fc68b9e3a9c - <rustc_lint[af83189a70346794]::late::LateContextAndPass<rustc_lint[af83189a70346794]::late::LateLintPassObjects> as rustc_hir[4fd4c8cfa82df924]::intravisit::Visitor>::visit_mod
32:     0x7fc68b9e0578 - <rustc_middle[308624d00b1a60fb]::hir::map::Map>::walk_toplevel_module::<rustc_lint[af83189a70346794]::late::LateContextAndPass<rustc_lint[af83189a70346794]::late::LateLintPassObjects>>
33:     0x7fc68b9e42a9 - rustc_lint[af83189a70346794]::late::late_lint_pass_crate::<rustc_lint[af83189a70346794]::late::LateLintPassObjects>
34:     0x7fc68d79bfe2 - rustc_lint[af83189a70346794]::late::late_lint_crate::<rustc_lint[af83189a70346794]::BuiltinCombinedLateLintPass>
35:     0x7fc68d791cbb - <rustc_session[4e9edec593f7bf37]::session::Session>::time::<(), rustc_lint[af83189a70346794]::late::check_crate<rustc_lint[af83189a70346794]::BuiltinCombinedLateLintPass, rustc_interface[8a9b172a366d8799]::passes::analysis::{closure#5}::{closure#0}::{closure#3}::{closure#0}::{closure#0}>::{closure#0}::{closure#0}>
36:     0x7fc68d793fd6 - <core[ea131dd00119fcdf]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[8a9b172a366d8799]::passes::analysis::{closure#5}::{closure#0}::{closure#3}> as core[ea131dd00119fcdf]::ops::function::FnOnce<()>>::call_once
37:     0x7fc68d795ab5 - <core[ea131dd00119fcdf]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[8a9b172a366d8799]::passes::analysis::{closure#5}::{closure#0}> as core[ea131dd00119fcdf]::ops::function::FnOnce<()>>::call_once
38:     0x7fc68d793518 - <rustc_session[4e9edec593f7bf37]::session::Session>::time::<(), rustc_interface[8a9b172a366d8799]::passes::analysis::{closure#5}>
39:     0x7fc68d77a4ac - rustc_interface[8a9b172a366d8799]::passes::analysis
40:     0x7fc68dce00de - <rustc_query_system[2e537618065482c4]::dep_graph::graph::DepGraph<rustc_middle[308624d00b1a60fb]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[308624d00b1a60fb]::ty::context::TyCtxt, (), core[ea131dd00119fcdf]::result::Result<(), rustc_errors[5c190b1069194a04]::ErrorReported>>
41:     0x7fc68dc66903 - rustc_data_structures[8dfc0aadcd5f6c30]::stack::ensure_sufficient_stack::<(core[ea131dd00119fcdf]::result::Result<(), rustc_errors[5c190b1069194a04]::ErrorReported>, rustc_query_system[2e537618065482c4]::dep_graph::graph::DepNodeIndex), rustc_query_system[2e537618065482c4]::query::plumbing::execute_job<rustc_query_impl[4895e94c0e24efb7]::plumbing::QueryCtxt, (), core[ea131dd00119fcdf]::result::Result<(), rustc_errors[5c190b1069194a04]::ErrorReported>>::{closure#3}>
42:     0x7fc68dc11896 - rustc_query_system[2e537618065482c4]::query::plumbing::try_execute_query::<rustc_query_impl[4895e94c0e24efb7]::plumbing::QueryCtxt, rustc_query_system[2e537618065482c4]::query::caches::DefaultCache<(), core[ea131dd00119fcdf]::result::Result<(), rustc_errors[5c190b1069194a04]::ErrorReported>>>
43:     0x7fc68dc508d5 - rustc_query_system[2e537618065482c4]::query::plumbing::get_query::<rustc_query_impl[4895e94c0e24efb7]::queries::analysis, rustc_query_impl[4895e94c0e24efb7]::plumbing::QueryCtxt>
44:     0x7fc68d74dfbd - <rustc_interface[8a9b172a366d8799]::passes::QueryContext>::enter::<rustc_driver[fb1ec9b0c191644e]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[ea131dd00119fcdf]::result::Result<(), rustc_errors[5c190b1069194a04]::ErrorReported>>
45:     0x7fc68d74c1fa - <rustc_interface[8a9b172a366d8799]::interface::Compiler>::enter::<rustc_driver[fb1ec9b0c191644e]::run_compiler::{closure#1}::{closure#2}, core[ea131dd00119fcdf]::result::Result<core[ea131dd00119fcdf]::option::Option<rustc_interface[8a9b172a366d8799]::queries::Linker>, rustc_errors[5c190b1069194a04]::ErrorReported>>
46:     0x7fc68d74f03c - rustc_span[704723e66117c16c]::with_source_map::<core[ea131dd00119fcdf]::result::Result<(), rustc_errors[5c190b1069194a04]::ErrorReported>, rustc_interface[8a9b172a366d8799]::interface::create_compiler_and_run<core[ea131dd00119fcdf]::result::Result<(), rustc_errors[5c190b1069194a04]::ErrorReported>, rustc_driver[fb1ec9b0c191644e]::run_compiler::{closure#1}>::{closure#1}>
47:     0x7fc68d74bbde - rustc_interface[8a9b172a366d8799]::interface::create_compiler_and_run::<core[ea131dd00119fcdf]::result::Result<(), rustc_errors[5c190b1069194a04]::ErrorReported>, rustc_driver[fb1ec9b0c191644e]::run_compiler::{closure#1}>
48:     0x7fc68d730be2 - std[6f6e099d0ffdbe4a]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[8a9b172a366d8799]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[8a9b172a366d8799]::interface::run_compiler<core[ea131dd00119fcdf]::result::Result<(), rustc_errors[5c190b1069194a04]::ErrorReported>, rustc_driver[fb1ec9b0c191644e]::run_compiler::{closure#1}>::{closure#0}, core[ea131dd00119fcdf]::result::Result<(), rustc_errors[5c190b1069194a04]::ErrorReported>>::{closure#0}, core[ea131dd00119fcdf]::result::Result<(), rustc_errors[5c190b1069194a04]::ErrorReported>>
49:     0x7fc68d72f639 - <<std[6f6e099d0ffdbe4a]::thread::Builder>::spawn_unchecked_<rustc_interface[8a9b172a366d8799]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[8a9b172a366d8799]::interface::run_compiler<core[ea131dd00119fcdf]::result::Result<(), rustc_errors[5c190b1069194a04]::ErrorReported>, rustc_driver[fb1ec9b0c191644e]::run_compiler::{closure#1}>::{closure#0}, core[ea131dd00119fcdf]::result::Result<(), rustc_errors[5c190b1069194a04]::ErrorReported>>::{closure#0}, core[ea131dd00119fcdf]::result::Result<(), rustc_errors[5c190b1069194a04]::ErrorReported>>::{closure#1} as core[ea131dd00119fcdf]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
50:     0x7fc68b11f253 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h517b04514611d0c2
                             at /rustc/498eeb72f590e518e19746b346be53713689e207/library/alloc/src/boxed.rs:1854:9
51:     0x7fc68b11f253 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h7f563a51cc3a5629
                             at /rustc/498eeb72f590e518e19746b346be53713689e207/library/alloc/src/boxed.rs:1854:9
52:     0x7fc68b11f253 - std::sys::unix::thread::Thread::new::thread_start::h3d3787d3c1d471cc
                             at /rustc/498eeb72f590e518e19746b346be53713689e207/library/std/src/sys/unix/thread.rs:108:17
53:     0x7fc68b011259 - start_thread
54:     0x7fc68adf45e3 - __GI___clone
55:                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.60 (498eeb7 2022-01-31)

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
warning: `proc_macro_api` (lib) generated 2 warnings
error: could not compile `proc_macro_api`; 2 warnings emitted

@matthiaskrgr matthiaskrgr added C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ labels Feb 1, 2022
@bors bors closed this as completed in 327768c Feb 1, 2022
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

Successfully merging a pull request may close this issue.

1 participant