rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.54k stars 12.74k forks source link

ICE: Region parameter out of range when substituting #105057

Open ricoyoung345 opened 1 year ago

ricoyoung345 commented 1 year ago

Code

<code>

Meta

rustc --version --verbose:

<version>
root@SK:~# rustc --version --verbose
rustc 1.65.0 (897e37553 2022-11-02)
binary: rustc
commit-hash: 897e37553bba8b42751c67658967889d11ecd120
commit-date: 2022-11-02
host: x86_64-unknown-linux-gnu
release: 1.65.0
LLVM version: 15.0.0

Error output

<output>
error: internal compiler error: compiler/rustc_middle/src/ty/subst.rs:724:13: Region parameter out of range when substituting in region 'a (index=1, substs = ['_#21r])

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.67.0-nightly (2585bcea0 2022-11-28) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C opt-level=3 -C panic=abort -C linker-plugin-lto -C codegen-units=1 -C strip=symbols -C link-arg=-s

note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [typeck] type-checking `acl::<impl at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/shadowsocks-service-1.14.3/src/acl/mod.rs:326:1: 326:19>::check_target_bypassed`
#1 [thir_body] building THIR for `acl::<impl at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/shadowsocks-service-1.14.3/src/acl/mod.rs:326:1: 326:19>::check_target_bypassed`
#2 [mir_built] building MIR for `acl::<impl at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/shadowsocks-service-1.14.3/src/acl/mod.rs:326:1: 326:19>::check_target_bypassed`
#3 [unsafety_check_result] unsafety-checking `acl::<impl at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/shadowsocks-service-1.14.3/src/acl/mod.rs:326:1: 326:19>::check_target_bypassed`
#4 [mir_const] preparing `acl::<impl at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/shadowsocks-service-1.14.3/src/acl/mod.rs:326:1: 326:19>::check_target_bypassed` for borrow checking
#5 [mir_promoted] processing MIR for `acl::<impl at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/shadowsocks-service-1.14.3/src/acl/mod.rs:326:1: 326:19>::check_target_bypassed`
#6 [mir_borrowck] borrow-checking `acl::<impl at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/shadowsocks-service-1.14.3/src/acl/mod.rs:326:1: 326:19>::check_target_bypassed`
#7 [type_of] computing type of `acl::<impl at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/shadowsocks-service-1.14.3/src/acl/mod.rs:326:1: 326:19>::check_target_bypassed::{opaque#0}`
#8 [check_mod_item_types] checking item types in module `acl`
#9 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `shadowsocks-service`
error: failed to compile `shadowsocks-rust v1.14.3`, intermediate artifacts can be found at `/tmp/cargo-installCwtSO7`
Backtrace

``` thread 'rustc' panicked at 'Box', /rustc/2585bcea0bc2a9c42a4be2c1eba5c61137f2b167/compiler/rustc_errors/src/lib.rs:1575:9 stack backtrace: 0: 0x7f8866e1d20a - std::backtrace_rs::backtrace::libunwind::trace::h5d63982369f255be at /rustc/2585bcea0bc2a9c42a4be2c1eba5c61137f2b167/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5 1: 0x7f8866e1d20a - std::backtrace_rs::backtrace::trace_unsynchronized::h3f0ca420a5fce959 at /rustc/2585bcea0bc2a9c42a4be2c1eba5c61137f2b167/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x7f8866e1d20a - std::sys_common::backtrace::_print_fmt::hb06d2f24224d5008 at /rustc/2585bcea0bc2a9c42a4be2c1eba5c61137f2b167/library/std/src/sys_common/backtrace.rs:65:5 3: 0x7f8866e1d20a - ::fmt::h3ab5a4a02080cf95 at /rustc/2585bcea0bc2a9c42a4be2c1eba5c61137f2b167/library/std/src/sys_common/backtrace.rs:44:22 4: 0x7f8862db812e - core::fmt::write::h7d275b25684d2f4b at /rustc/2585bcea0bc2a9c42a4be2c1eba5c61137f2b167/library/core/src/fmt/mod.rs:1208:17 5: 0x7f8866e114d5 - std::io::Write::write_fmt::habd0270971df3efd at /rustc/2585bcea0bc2a9c42a4be2c1eba5c61137f2b167/library/std/src/io/mod.rs:1682:15 6: 0x7f8866e1cfd5 - std::sys_common::backtrace::_print::h61bb07d45642a6b0 at /rustc/2585bcea0bc2a9c42a4be2c1eba5c61137f2b167/library/std/src/sys_common/backtrace.rs:47:5 7: 0x7f8866e1cfd5 - std::sys_common::backtrace::print::h5d41efe8a7680c9e at /rustc/2585bcea0bc2a9c42a4be2c1eba5c61137f2b167/library/std/src/sys_common/backtrace.rs:34:9 8: 0x7f8866e1f33f - std::panicking::default_hook::{{closure}}::he45a8add8cd6c157 at /rustc/2585bcea0bc2a9c42a4be2c1eba5c61137f2b167/library/std/src/panicking.rs:267:22 9: 0x7f8866e1f07b - std::panicking::default_hook::h5bdfb218ae8ccf1a at /rustc/2585bcea0bc2a9c42a4be2c1eba5c61137f2b167/library/std/src/panicking.rs:286:9 10: 0x7f8866064e54 - rustc_driver[9b4589fbd0ca3010]::DEFAULT_HOOK::{closure#0}::{closure#0} 11: 0x7f8866e1fb3d - as core::ops::function::Fn>::call::hc626e6f5815a4649 at /rustc/2585bcea0bc2a9c42a4be2c1eba5c61137f2b167/library/alloc/src/boxed.rs:2032:9 12: 0x7f8866e1fb3d - std::panicking::rust_panic_with_hook::haa2a8406479dd255 at /rustc/2585bcea0bc2a9c42a4be2c1eba5c61137f2b167/library/std/src/panicking.rs:692:13 13: 0x7f886651ab31 - std[85b9d86509865b2b]::panicking::begin_panic::::{closure#0} 14: 0x7f88665196d6 - std[85b9d86509865b2b]::sys_common::backtrace::__rust_end_short_backtrace::::{closure#0}, !> 15: 0x7f8866518a96 - std[85b9d86509865b2b]::panicking::begin_panic:: 16: 0x7f88664baa96 - std[85b9d86509865b2b]::panic::panic_any:: 17: 0x7f88664ba9c6 - ::bug::<&alloc[edfeea1ed307d55e]::string::String> 18: 0x7f88664ba620 - ::bug::<&alloc[edfeea1ed307d55e]::string::String> 19: 0x7f886658217e - rustc_middle[2ae535847981180d]::ty::context::tls::with_context_opt::::{closure#0}, ()>::{closure#0}, ()> 20: 0x7f8866584646 - rustc_middle[2ae535847981180d]::util::bug::opt_span_bug_fmt:: 21: 0x7f88643262b3 - rustc_middle[2ae535847981180d]::util::bug::bug_fmt 22: 0x7f88664c9661 - ::fold_region::region_param_out_of_range 23: 0x7f8864096d4e - ::instantiate_into 24: 0x7f886458164d - ::nominal_obligations_inner 25: 0x7f886457f6e1 - ::compute 26: 0x7f88642f399f - ::process_obligation 27: 0x7f88642f0e2f - >::process_obligations:: 28: 0x7f88642f08e8 - ::select_where_possible 29: 0x7f886522bb85 - ::try_find_coercion_lub:: 30: 0x7f88642c3663 - ::check_match::{closure#0} 31: 0x7f886425c987 - ::check_expr_with_expectation_and_args 32: 0x7f88642a3414 - ::check_block_with_expected 33: 0x7f886425f0a3 - ::check_expr_with_expectation_and_args 34: 0x7f88642c31e1 - ::check_match::{closure#0} 35: 0x7f886425c987 - ::check_expr_with_expectation_and_args 36: 0x7f88642a62ca - ::check_decl 37: 0x7f886425f373 - ::check_expr_with_expectation_and_args 38: 0x7f886425cad4 - ::check_expr_with_expectation_and_args 39: 0x7f88642a3414 - ::check_block_with_expected 40: 0x7f886425aa72 - ::check_expr_with_expectation_and_args 41: 0x7f88642c31e1 - ::check_match::{closure#0} 42: 0x7f886425c987 - ::check_expr_with_expectation_and_args 43: 0x7f88642a3511 - ::check_block_with_expected 44: 0x7f886425aa72 - ::check_expr_with_expectation_and_args 45: 0x7f886425ce71 - ::check_expr_with_expectation_and_args 46: 0x7f88642a3511 - ::check_block_with_expected 47: 0x7f886425aa72 - ::check_expr_with_expectation_and_args 48: 0x7f88646b5203 - ::check_return_expr 49: 0x7f88646ac9cc - rustc_hir_typeck[7049c46b6b0ab522]::check::check_fn 50: 0x7f8864346e59 - ::check_expr_closure 51: 0x7f886425e8f5 - ::check_expr_with_expectation_and_args 52: 0x7f88642d2533 - ::check_argument_types 53: 0x7f88653cca60 - ::check_call 54: 0x7f886425a534 - ::check_expr_with_expectation_and_args 55: 0x7f88646b5203 - ::check_return_expr 56: 0x7f88646ac9cc - rustc_hir_typeck[7049c46b6b0ab522]::check::check_fn 57: 0x7f88646993cd - ::enter::::{closure#0}::{closure#1}, &rustc_middle[2ae535847981180d]::ty::context::TypeckResults> 58: 0x7f886468b2f3 - rustc_hir_typeck[7049c46b6b0ab522]::typeck 59: 0x7f88646896cd - rustc_query_system[a24047382b4b5120]::query::plumbing::try_execute_query::> 60: 0x7f8865a41a37 - ::typeck 61: 0x7f8864bfccab - rustc_mir_build[ee9d234d456ac1e7]::thir::cx::thir_body 62: 0x7f8864ed6115 - rustc_query_system[a24047382b4b5120]::query::plumbing::try_execute_query::, core[bc14861035b9f032]::result::Result<(&rustc_data_structures[4a8549ac1ce25c0f]::steal::Steal, rustc_middle[2ae535847981180d]::thir::ExprId), rustc_errors[7d36137f8dd089c7]::ErrorGuaranteed>>> 63: 0x7f8864ecf3ef - rustc_mir_build[ee9d234d456ac1e7]::build::mir_built 64: 0x7f88649ce8fc - rustc_query_system[a24047382b4b5120]::query::plumbing::try_execute_query::, &rustc_data_structures[4a8549ac1ce25c0f]::steal::Steal>> 65: 0x7f88649dd4ff - rustc_mir_transform[a2c6b554fc875fb0]::check_unsafety::unsafety_check_result 66: 0x7f88649d5397 - rustc_query_system[a24047382b4b5120]::query::plumbing::try_execute_query::> 67: 0x7f88649d13ba - rustc_mir_transform[a2c6b554fc875fb0]::mir_const 68: 0x7f88649cec26 - rustc_query_system[a24047382b4b5120]::query::plumbing::try_execute_query::, &rustc_data_structures[4a8549ac1ce25c0f]::steal::Steal>> 69: 0x7f8864f0ba90 - rustc_mir_transform[a2c6b554fc875fb0]::mir_promoted 70: 0x7f8864f09705 - rustc_query_system[a24047382b4b5120]::query::plumbing::try_execute_query::, (&rustc_data_structures[4a8549ac1ce25c0f]::steal::Steal, &rustc_data_structures[4a8549ac1ce25c0f]::steal::Steal>)>> 71: 0x7f8864f07efb - rustc_borrowck[6ed6c0199ebbf74d]::mir_borrowck 72: 0x7f886512a0cb - rustc_query_system[a24047382b4b5120]::query::plumbing::try_execute_query::> 73: 0x7f8865a41de3 - ::mir_borrowck 74: 0x7f886588a724 - rustc_hir_analysis[124a26e50c1aa23a]::collect::type_of::type_of 75: 0x7f8864a15f98 - rustc_query_system[a24047382b4b5120]::query::plumbing::get_query:: 76: 0x7f886401205e - rustc_hir_analysis[124a26e50c1aa23a]::check::check::check_mod_item_types 77: 0x7f8864be75b8 - rustc_query_system[a24047382b4b5120]::query::plumbing::try_execute_query::> 78: 0x7f8865464f5e - rustc_query_system[a24047382b4b5120]::query::plumbing::get_query:: 79: 0x7f88657463d5 - ::for_each_module:: 80: 0x7f886446bf72 - rustc_hir_analysis[124a26e50c1aa23a]::check_crate 81: 0x7f886446bbbb - rustc_interface[4869d893f0e6a446]::passes::analysis 82: 0x7f88657c9dcc - rustc_query_system[a24047382b4b5120]::query::plumbing::try_execute_query::>> 83: 0x7f88657c9abb - rustc_query_system[a24047382b4b5120]::query::plumbing::get_query:: 84: 0x7f88652cee1b - ::enter::> 85: 0x7f88652c73ae - ::enter::, rustc_errors[7d36137f8dd089c7]::ErrorGuaranteed>> 86: 0x7f88652c23c8 - rustc_span[fe585761646e9245]::with_source_map::, rustc_interface[4869d893f0e6a446]::interface::run_compiler, rustc_driver[9b4589fbd0ca3010]::run_compiler::{closure#1}>::{closure#0}::{closure#0}> 87: 0x7f88652c1eb5 - >::set::, rustc_driver[9b4589fbd0ca3010]::run_compiler::{closure#1}>::{closure#0}, core[bc14861035b9f032]::result::Result<(), rustc_errors[7d36137f8dd089c7]::ErrorGuaranteed>> 88: 0x7f88652c14a2 - std[85b9d86509865b2b]::sys_common::backtrace::__rust_begin_short_backtrace::, rustc_driver[9b4589fbd0ca3010]::run_compiler::{closure#1}>::{closure#0}, core[bc14861035b9f032]::result::Result<(), rustc_errors[7d36137f8dd089c7]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[bc14861035b9f032]::result::Result<(), rustc_errors[7d36137f8dd089c7]::ErrorGuaranteed>> 89: 0x7f88652c11b8 - <::spawn_unchecked_, rustc_driver[9b4589fbd0ca3010]::run_compiler::{closure#1}>::{closure#0}, core[bc14861035b9f032]::result::Result<(), rustc_errors[7d36137f8dd089c7]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[bc14861035b9f032]::result::Result<(), rustc_errors[7d36137f8dd089c7]::ErrorGuaranteed>>::{closure#1} as core[bc14861035b9f032]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} 90: 0x7f8866e26d73 - as core::ops::function::FnOnce>::call_once::h87f315d78631c89a at /rustc/2585bcea0bc2a9c42a4be2c1eba5c61137f2b167/library/alloc/src/boxed.rs:2000:9 91: 0x7f8866e26d73 - as core::ops::function::FnOnce>::call_once::h44e64edef3723eae at /rustc/2585bcea0bc2a9c42a4be2c1eba5c61137f2b167/library/alloc/src/boxed.rs:2000:9 92: 0x7f8866e26d73 - std::sys::unix::thread::Thread::new::thread_start::h6b1af1d92f601469 at /rustc/2585bcea0bc2a9c42a4be2c1eba5c61137f2b167/library/std/src/sys/unix/thread.rs:108:17 93: 0x7f8862c23ea7 - start_thread at ./nptl/./nptl/pthread_create.c:477:8 94: 0x7f8862b41a2f - __clone at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95 95: 0x0 - note: the compiler unexpectedly panicked. this is a bug. ```

kpreid commented 10 months ago

Triage: Relabeling issues which don't have a runnable reproduction (as opposed to having a non-minimized one) to the new label S-needs-repro. @rustbot label +S-needs-repro -E-needs-mcve