Skip to content

type parameter Self/#0 (Self/0) out of range when substituting #9675

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
bigdogs opened this issue Oct 18, 2022 · 6 comments
Closed

type parameter Self/#0 (Self/0) out of range when substituting #9675

bigdogs opened this issue Oct 18, 2022 · 6 comments
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@bigdogs
Copy link

bigdogs commented Oct 18, 2022

cargo clippy runs failed on nightly 2022-10-17. Not sure if this is a known issue.

error: internal compiler error: compiler\rustc_middle\src\ty\subst.rs:695:9: type parameter `Self/#0` (Self/0) out of range when substituting, substs=[]

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/06f049a35535d26d5c8426d4f782f78277b41aa1\compiler\rustc_errors\src\lib.rs:1516:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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.66 (06f049a3 2022-10-17)

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
@Alexendoo
Copy link
Member

Thanks @bigdogs

Is the code for this public anywhere? Or if not are you able to show the output of running with RUST_BACKTRACE=1?

@bigdogs
Copy link
Author

bigdogs commented Oct 18, 2022

@Alexendoo hi, sorry for that it's our private project :(, here is the backtrace, hope it helps


error: internal compiler error: compiler\rustc_middle\src\ty\subst.rs:695:9: type parameter `Self/#0` (Self/0) out of range when substituting, substs=[]

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/06f049a35535d26d5c8426d4f782f78277b41aa1\compiler\rustc_errors\src\lib.rs:1516:9
stack backtrace:
   0:     0x7ffc467597f2 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h482ef523d2d08fee
   1:     0x7ffc467950fb - core::fmt::write::h8037f092d83f7802
   2:     0x7ffc4674be1a - <std::io::IoSlice as core::fmt::Debug>::fmt::hf5b3748c929449b4
   3:     0x7ffc4675953b - std::sys::common::alloc::realloc_fallback::h6e0fe1395e704b6a
   4:     0x7ffc4675ce99 - std::panicking::default_hook::h1d0cc73c71564703
   5:     0x7ffc4675cb1a - std::panicking::default_hook::h1d0cc73c71564703
   6:     0x7ff610bd73a3 - <unknown>
   7:     0x7ffc4675d7f0 - std::panicking::rust_panic_with_hook::h6e788efc95c397cb
   8:     0x7ffc40a78f13 - <rustc_middle[88b50f213d6e6aad]::ty::context::TyCtxt>::_intern_bound_variable_kinds
   9:     0x7ffc40a78289 - <rustc_middle[88b50f213d6e6aad]::ty::context::TyCtxt>::_intern_bound_variable_kinds
  10:     0x7ffc40a44259 - <rustc_middle[88b50f213d6e6aad]::ty::sty::ExistentialProjection as rustc_middle[88b50f213d6e6aad]::ty::context::Lift>::lift_to_tcx
  11:     0x7ffc40a78279 - <rustc_middle[88b50f213d6e6aad]::ty::context::TyCtxt>::_intern_bound_variable_kinds
  12:     0x7ffc40a76ae4 - <rustc_middle[88b50f213d6e6aad]::ty::context::TyCtxt>::_intern_bound_variable_kinds
  13:     0x7ffc40a763e2 - <rustc_middle[88b50f213d6e6aad]::ty::context::TyCtxt>::_intern_bound_variable_kinds
  14:     0x7ffc40aba377 - <&rustc_middle[88b50f213d6e6aad]::ty::list::List<rustc_middle[88b50f213d6e6aad]::ty::Ty> as rustc_middle[88b50f213d6e6aad]::ty::context::Lift>::lift_to_tcx
  15:     0x7ffc40aba618 - rustc_middle[88b50f213d6e6aad]::util::bug::bug_fmt
  16:     0x7ffc40aba595 - rustc_middle[88b50f213d6e6aad]::util::bug::bug_fmt
  17:     0x7ffc40aba093 - <rustc_middle[88b50f213d6e6aad]::ty::list::List<rustc_middle[88b50f213d6e6aad]::ty::subst::GenericArg>>::try_as_type_list
  18:     0x7ffc3e6d37d8 - <rustc_middle[88b50f213d6e6aad]::ty::subst::SubstFolder as rustc_middle[88b50f213d6e6aad]::ty::fold::TypeFolder>::fold_ty
  19:     0x7ff610d8404e - <unknown>
  20:     0x7ff610e1ec0a - <unknown>
  21:     0x7ff610e5279d - <unknown>
  22:     0x7ff610d99aec - <unknown>
  23:     0x7ff610d987aa - <unknown>
  24:     0x7ff610df64ad - <unknown>
  25:     0x7ffc40847db5 - <rustc_lint[29620f12027d6b16]::late::LateLintPassObjects as rustc_lint[29620f12027d6b16]::passes::LateLintPass>::check_expr
  26:     0x7ffc3e897e8e - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  27:     0x7ffc3e89dce7 - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  28:     0x7ffc3e897e99 - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  29:     0x7ffc3e89dce7 - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  30:     0x7ffc3e897e99 - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  31:     0x7ffc3e89ddc8 - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  32:     0x7ffc3e897e99 - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  33:     0x7ffc3e89df60 - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  34:     0x7ffc3e897e99 - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  35:     0x7ffc3e89dce7 - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  36:     0x7ffc3e897e99 - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  37:     0x7ffc3e897fca - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  38:     0x7ffc3e897e99 - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  39:     0x7ffc3e8982bb - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  40:     0x7ffc3e89849e - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  41:     0x7ffc3e89d02a - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  42:     0x7ffc3e898cf4 - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  43:     0x7ffc3e89e1d3 - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  44:     0x7ffc3e898a38 - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  45:     0x7ffc3e89d919 - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  46:     0x7ffc3e89e21d - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  47:     0x7ffc3e898a38 - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  48:     0x7ffc3e89d919 - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  49:     0x7ffc3e89e21d - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  50:     0x7ffc3e898a38 - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  51:     0x7ffc3e89d919 - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  52:     0x7ffc3e89e21d - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  53:     0x7ffc3e898a38 - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  54:     0x7ffc3e89d919 - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  55:     0x7ffc3e859346 - rustc_interface[2957e14ec90fea7d]::interface::try_print_query_stack
  56:     0x7ffc3e897b4d - rustc_interface[2957e14ec90fea7d]::util::rustc_path
  57:     0x7ffc3cf574ba - once_cell[389b5cc3a148d201]::imp::initialize_or_wait
  58:     0x7ffc3c059b78 - <rustc_interface[2957e14ec90fea7d]::passes::boxed_resolver::BoxedResolver>::to_resolver_outputs
  59:     0x7ffc3c05499c - <rustc_interface[2957e14ec90fea7d]::passes::boxed_resolver::BoxedResolver>::to_resolver_outputs
  60:     0x7ffc3c064b2c - rustc_interface[2957e14ec90fea7d]::util::commit_date_str
  61:     0x7ffc3c056bcb - <rustc_interface[2957e14ec90fea7d]::passes::boxed_resolver::BoxedResolver>::to_resolver_outputs
  62:     0x7ffc3c06a8bd - rustc_interface[2957e14ec90fea7d]::passes::analysis
  63:     0x7ffc3ca580be - rustc_query_impl[19b498cdebeee058]::profiling_support::alloc_self_profile_query_strings
  64:     0x7ffc3cac1ab9 - <&[(rustc_middle[88b50f213d6e6aad]::middle::exported_symbols::ExportedSymbol, rustc_middle[88b50f213d6e6aad]::middle::exported_symbols::SymbolExportInfo)] as rustc_serialize[f19ab2f20457f212]::serialize::Decodable<rustc_query_impl[19b498cdebeee058]::on_disk_cache::CacheDecoder>>::decode
  65:     0x7ffc3cb97efe - <&[(rustc_middle[88b50f213d6e6aad]::middle::exported_symbols::ExportedSymbol, rustc_middle[88b50f213d6e6aad]::middle::exported_symbols::SymbolExportInfo)] as rustc_serialize[f19ab2f20457f212]::serialize::Decodable<rustc_query_impl[19b498cdebeee058]::on_disk_cache::CacheDecoder>>::decode
  66:     0x7ffc3cbe7e66 - <&[(rustc_middle[88b50f213d6e6aad]::middle::exported_symbols::ExportedSymbol, rustc_middle[88b50f213d6e6aad]::middle::exported_symbols::SymbolExportInfo)] as rustc_serialize[f19ab2f20457f212]::serialize::Decodable<rustc_query_impl[19b498cdebeee058]::on_disk_cache::CacheDecoder>>::decode
  67:     0x7ffc3c028094 - <unknown>
  68:     0x7ffc3c0035a8 - <unknown>
  69:     0x7ffc3c0378fa - <rustc_middle[88b50f213d6e6aad]::ty::SymbolName as core[5c3625cf65bd79e3]::fmt::Debug>::fmt
  70:     0x7ffc3c005454 - <unknown>
  71:     0x7ffc3c037217 - rustc_driver[417e5e09b2b61d12]::args::arg_expand_all
  72:     0x7ffc3c0288f9 - <unknown>
  73:     0x7ffc3c020960 - <unknown>
  74:     0x7ffc4676e53c - std::sys::windows::thread::Thread::new::h358cd21a6b4bff06
  75:     0x7ffccb257034 - <unknown>
  76:     0x7ffccd122651 - RtlUserThreadStart

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.66 (06f049a3 2022-10-17)

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack

@Alexendoo Alexendoo added C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ labels Oct 18, 2022
@Alexendoo
Copy link
Member

Ahh no worries. Unfortunate that the presumably clippy parts are showing as <unknown> 🤔

@ghost
Copy link

ghost commented Oct 19, 2022

This might be another occurrence of the problem in #9505 . Check for any code that might trigger unnecessary_to_owned.

@bigdogs
Copy link
Author

bigdogs commented Nov 23, 2022

problem still exists on the latest clippy. nightly-2022-11-21 , Is there any workaround to skip the check of unnecceary_to_owned?

@bigdogs
Copy link
Author

bigdogs commented Dec 17, 2022

checked on nightly-2022-12-17, issued was fixed

@bigdogs bigdogs closed this as completed Dec 17, 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

No branches or pull requests

2 participants