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 panics at NormalizeAfterErasingRegionsFolder:: normalize_generic_arg_after_erasing_regions when run on RustPython #8837

Closed
Tyrubias opened this issue May 17, 2022 · 1 comment

Comments

@Tyrubias
Copy link
Contributor

Tyrubias commented May 17, 2022

When I run cargo clippy on the RustPython project, Clippy panics while compiling RustPython in the NormalizeAfterErasingRegionsFolder:: normalize_generic_arg_after_erasing_regions of rustc. I'm on the M1 Max MacBook Pro running macOS Monterey 12.4.

Edit: the above method is being called from clippy_utils/src/ty.rs#L71

Here is the full backtrace
    Checking rustpython-vm v0.1.2 (/Users/vsong/Downloads/RustPython/vm)
warning: unknown lint: `clippy::needless_match`
   --> vm/src/builtins/function.rs:509:17
    |
509 |         #[allow(clippy::needless_match)] // False positive on nightly
    |                 ^^^^^^^^^^^^^^^^^^^^^^ help: did you mean: `clippy::needless_bool`
    |
    = note: `#[warn(unknown_lints)]` on by default

error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:179:90: Failed to normalize <std::option::Option<&std::option::Option<object::core::PyRef<builtins::pystr::PyStr>>> as std::iter::Iterator>::Item, maybe try to call `try_normalize_erasing_regions` instead

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1160:9
stack backtrace:
   0:        0x1057b3118 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h10cf06316d33e2a9
   1:        0x1057ff808 - core::fmt::write::h1faf18c959c3a8df
   2:        0x1057a5104 - std::io::Write::write_fmt::h86ab231360bc97d2
   3:        0x1057b6e44 - std::panicking::default_hook::{{closure}}::h36e628ffaf3cd44f
   4:        0x1057b6abc - std::panicking::default_hook::h3ee1564a7544e58f
   5:        0x1047eccc8 - clippy_driver[d0264e908c5afe0f]::ICE_HOOK::{closure#0}::{closure#0}
   6:        0x1057b7634 - std::panicking::rust_panic_with_hook::h191339fbd2fe2360
   7:        0x1107d2930 - std[8541ff70ccfedbb0]::panicking::begin_panic::<rustc_errors[677d6d214e1093d1]::ExplicitBug>::{closure#0}
   8:        0x1107d28e8 - std[8541ff70ccfedbb0]::sys_common::backtrace::__rust_end_short_backtrace::<std[8541ff70ccfedbb0]::panicking::begin_panic<rustc_errors[677d6d214e1093d1]::ExplicitBug>::{closure#0}, !>
   9:        0x110aa7238 - std[8541ff70ccfedbb0]::panicking::begin_panic::<rustc_errors[677d6d214e1093d1]::ExplicitBug>
  10:        0x110803df8 - std[8541ff70ccfedbb0]::panic::panic_any::<rustc_errors[677d6d214e1093d1]::ExplicitBug>
  11:        0x110801460 - <rustc_errors[677d6d214e1093d1]::HandlerInner>::bug
  12:        0x1107ff7f4 - <rustc_errors[677d6d214e1093d1]::Handler>::bug
  13:        0x110549224 - rustc_middle[48a4de8117124789]::ty::context::tls::with_opt::<rustc_middle[48a4de8117124789]::util::bug::opt_span_bug_fmt<rustc_span[dd8cd730fd24a84e]::span_encoding::Span>::{closure#0}, ()>
  14:        0x110549298 - rustc_middle[48a4de8117124789]::util::bug::opt_span_bug_fmt::<rustc_span[dd8cd730fd24a84e]::span_encoding::Span>
  15:        0x110a987ec - rustc_middle[48a4de8117124789]::util::bug::bug_fmt
  16:        0x1106af400 - <rustc_middle[48a4de8117124789]::ty::normalize_erasing_regions::NormalizeAfterErasingRegionsFolder>::normalize_generic_arg_after_erasing_regions
  17:        0x1106adbdc - <rustc_middle[48a4de8117124789]::ty::normalize_erasing_regions::NormalizeAfterErasingRegionsFolder as rustc_middle[48a4de8117124789]::ty::fold::TypeFolder>::fold_ty
  18:        0x104b014f0 - clippy_utils[df06801d8f7bb650]::ty::get_associated_type
  19:        0x104a1fc6c - clippy_lints[503b9a17ac460ecf]::methods::iter_overeager_cloned::check
  20:        0x10493cd28 - <clippy_lints[503b9a17ac460ecf]::methods::Methods as rustc_lint[5173b4f512a1398f]::passes::LateLintPass>::check_expr
  21:        0x1102b4c0c - <rustc_lint[5173b4f512a1398f]::late::LateLintPassObjects as rustc_lint[5173b4f512a1398f]::passes::LateLintPass>::check_expr
  22:        0x10cc41ef0 - rustc_hir[e48eef9567c76cb6]::intravisit::walk_body::<rustc_lint[5173b4f512a1398f]::late::LateContextAndPass<rustc_lint[5173b4f512a1398f]::late::LateLintPassObjects>>
  23:        0x10cc3de7c - <rustc_lint[5173b4f512a1398f]::late::LateContextAndPass<rustc_lint[5173b4f512a1398f]::late::LateLintPassObjects> as rustc_hir[e48eef9567c76cb6]::intravisit::Visitor>::visit_nested_body
  24:        0x10cc48b04 - rustc_hir[e48eef9567c76cb6]::intravisit::walk_expr::<rustc_lint[5173b4f512a1398f]::late::LateContextAndPass<rustc_lint[5173b4f512a1398f]::late::LateLintPassObjects>>
  25:        0x10cc48688 - rustc_hir[e48eef9567c76cb6]::intravisit::walk_expr::<rustc_lint[5173b4f512a1398f]::late::LateContextAndPass<rustc_lint[5173b4f512a1398f]::late::LateLintPassObjects>>
  26:        0x10cc47c48 - rustc_hir[e48eef9567c76cb6]::intravisit::walk_block::<rustc_lint[5173b4f512a1398f]::late::LateContextAndPass<rustc_lint[5173b4f512a1398f]::late::LateLintPassObjects>>
  27:        0x10cc48b88 - rustc_hir[e48eef9567c76cb6]::intravisit::walk_expr::<rustc_lint[5173b4f512a1398f]::late::LateContextAndPass<rustc_lint[5173b4f512a1398f]::late::LateLintPassObjects>>
  28:        0x10cc41efc - rustc_hir[e48eef9567c76cb6]::intravisit::walk_body::<rustc_lint[5173b4f512a1398f]::late::LateContextAndPass<rustc_lint[5173b4f512a1398f]::late::LateLintPassObjects>>
  29:        0x10cc3de7c - <rustc_lint[5173b4f512a1398f]::late::LateContextAndPass<rustc_lint[5173b4f512a1398f]::late::LateLintPassObjects> as rustc_hir[e48eef9567c76cb6]::intravisit::Visitor>::visit_nested_body
  30:        0x10cc4776c - rustc_hir[e48eef9567c76cb6]::intravisit::walk_impl_item::<rustc_lint[5173b4f512a1398f]::late::LateContextAndPass<rustc_lint[5173b4f512a1398f]::late::LateLintPassObjects>>
  31:        0x10cc3cf60 - <rustc_lint[5173b4f512a1398f]::late::LateContextAndPass<rustc_lint[5173b4f512a1398f]::late::LateLintPassObjects> as rustc_hir[e48eef9567c76cb6]::intravisit::Visitor>::visit_nested_impl_item
  32:        0x10cc42cc4 - rustc_hir[e48eef9567c76cb6]::intravisit::walk_item::<rustc_lint[5173b4f512a1398f]::late::LateContextAndPass<rustc_lint[5173b4f512a1398f]::late::LateLintPassObjects>>
  33:        0x10cc3bff0 - <rustc_lint[5173b4f512a1398f]::late::LateContextAndPass<rustc_lint[5173b4f512a1398f]::late::LateLintPassObjects> as rustc_hir[e48eef9567c76cb6]::intravisit::Visitor>::visit_nested_item
  34:        0x10cc426f4 - rustc_hir[e48eef9567c76cb6]::intravisit::walk_item::<rustc_lint[5173b4f512a1398f]::late::LateContextAndPass<rustc_lint[5173b4f512a1398f]::late::LateLintPassObjects>>
  35:        0x10cc3bff0 - <rustc_lint[5173b4f512a1398f]::late::LateContextAndPass<rustc_lint[5173b4f512a1398f]::late::LateLintPassObjects> as rustc_hir[e48eef9567c76cb6]::intravisit::Visitor>::visit_nested_item
  36:        0x10cc426f4 - rustc_hir[e48eef9567c76cb6]::intravisit::walk_item::<rustc_lint[5173b4f512a1398f]::late::LateContextAndPass<rustc_lint[5173b4f512a1398f]::late::LateLintPassObjects>>
  37:        0x10cc3bff0 - <rustc_lint[5173b4f512a1398f]::late::LateContextAndPass<rustc_lint[5173b4f512a1398f]::late::LateLintPassObjects> as rustc_hir[e48eef9567c76cb6]::intravisit::Visitor>::visit_nested_item
  38:        0x10cc426f4 - rustc_hir[e48eef9567c76cb6]::intravisit::walk_item::<rustc_lint[5173b4f512a1398f]::late::LateContextAndPass<rustc_lint[5173b4f512a1398f]::late::LateLintPassObjects>>
  39:        0x10cc3bff0 - <rustc_lint[5173b4f512a1398f]::late::LateContextAndPass<rustc_lint[5173b4f512a1398f]::late::LateLintPassObjects> as rustc_hir[e48eef9567c76cb6]::intravisit::Visitor>::visit_nested_item
  40:        0x10cc3ea08 - rustc_lint[5173b4f512a1398f]::late::late_lint_pass_crate::<rustc_lint[5173b4f512a1398f]::late::LateLintPassObjects>
  41:        0x10cc3ef00 - rustc_lint[5173b4f512a1398f]::late::late_lint_crate::<rustc_lint[5173b4f512a1398f]::BuiltinCombinedLateLintPass>
  42:        0x10cce4974 - <rustc_session[d383daeae0c11292]::session::Session>::time::<(), rustc_lint[5173b4f512a1398f]::late::check_crate<rustc_lint[5173b4f512a1398f]::BuiltinCombinedLateLintPass, rustc_interface[2280aded15839b11]::passes::analysis::{closure#5}::{closure#0}::{closure#3}::{closure#0}::{closure#0}>::{closure#0}::{closure#0}>
  43:        0x10ccf8d20 - <core[e180da0f2c78f25f]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[2280aded15839b11]::passes::analysis::{closure#5}::{closure#0}::{closure#3}> as core[e180da0f2c78f25f]::ops::function::FnOnce<()>>::call_once
  44:        0x10ccfa3e0 - <core[e180da0f2c78f25f]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[2280aded15839b11]::passes::analysis::{closure#5}::{closure#0}> as core[e180da0f2c78f25f]::ops::function::FnOnce<()>>::call_once
  45:        0x10cce67ac - <rustc_session[d383daeae0c11292]::session::Session>::time::<(), rustc_interface[2280aded15839b11]::passes::analysis::{closure#5}>
  46:        0x10cc720b4 - rustc_interface[2280aded15839b11]::passes::analysis
  47:        0x10fb53df0 - <rustc_query_system[91d58cadb6adb151]::dep_graph::graph::DepGraph<rustc_middle[48a4de8117124789]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[48a4de8117124789]::ty::context::TyCtxt, (), core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>>
  48:        0x10fc74a34 - rustc_data_structures[6a7bec35f5e261c6]::stack::ensure_sufficient_stack::<(core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>, rustc_query_system[91d58cadb6adb151]::dep_graph::graph::DepNodeIndex), rustc_query_system[91d58cadb6adb151]::query::plumbing::execute_job<rustc_query_impl[9309ed91bf96ef41]::plumbing::QueryCtxt, (), core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>>::{closure#3}>
  49:        0x10f94d464 - rustc_query_system[91d58cadb6adb151]::query::plumbing::try_execute_query::<rustc_query_impl[9309ed91bf96ef41]::plumbing::QueryCtxt, rustc_query_system[91d58cadb6adb151]::query::caches::DefaultCache<(), core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>>>
  50:        0x10f9ecdc4 - rustc_query_system[91d58cadb6adb151]::query::plumbing::get_query::<rustc_query_impl[9309ed91bf96ef41]::queries::analysis, rustc_query_impl[9309ed91bf96ef41]::plumbing::QueryCtxt>
  51:        0x10cb7fd38 - <rustc_interface[2280aded15839b11]::passes::QueryContext>::enter::<rustc_driver[3e35567b0507961a]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>>
  52:        0x10cb3344c - rustc_interface[2280aded15839b11]::interface::create_compiler_and_run::<core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>, rustc_driver[3e35567b0507961a]::run_compiler::{closure#1}>
  53:        0x10cb1acb0 - std[8541ff70ccfedbb0]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[2280aded15839b11]::util::run_in_thread_pool_with_globals<rustc_interface[2280aded15839b11]::interface::run_compiler<core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>, rustc_driver[3e35567b0507961a]::run_compiler::{closure#1}>::{closure#0}, core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>>::{closure#0}, core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>>
  54:        0x10cb94648 - <<std[8541ff70ccfedbb0]::thread::Builder>::spawn_unchecked_<rustc_interface[2280aded15839b11]::util::run_in_thread_pool_with_globals<rustc_interface[2280aded15839b11]::interface::run_compiler<core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>, rustc_driver[3e35567b0507961a]::run_compiler::{closure#1}>::{closure#0}, core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>>::{closure#0}, core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>>::{closure#1} as core[e180da0f2c78f25f]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  55:        0x1057c2b70 - std::sys::unix::thread::Thread::new::thread_start::h8ccdabc567c5eee0
  56:        0x19768426c - __pthread_deallocate

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 (7737e0b5 2022-04-04)

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

If there's anything else I can do to help debug this, please let me know! I'm new to Rust and would love to contribute.

@Tyrubias
Copy link
Contributor Author

I just realize the solution was mentioned in #8662 (comment) and this issue was fixed in #8602

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant