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

Compilation error regexes don't pick up panic backtrace file locations #560

Open
rtpg opened this issue Oct 17, 2024 · 0 comments
Open

Compilation error regexes don't pick up panic backtrace file locations #560

rtpg opened this issue Oct 17, 2024 · 0 comments

Comments

@rtpg
Copy link

rtpg commented Oct 17, 2024

While working through something I noticed that while the panicing regex does pick up the "panicked at" line and put a link there, it doesn't properly capture the subsequent at lines.

checking "/Users/rtpg/proj/ruff/crates/red_knot_workspace/resources/test/corpus/73_class_generic_cycle.py"
thread 'corpus_no_panic' panicked at crates/red_knot_python_semantic/src/semantic_model.rs:64:32:
Could not find expression for Subscript(ExprSubscript { range: 27..44, value: Name(ExprName { range: 27..31, id: Name("list"), ctx: Load }), slice: BinOp(ExprBinOp { range: 32..43, left: Name(ExprName { range: 32..36, id: Name("Tree"), ctx: Load }), op: BitOr, right: Name(ExprName { range: 39..43, id: Name("Leaf"), ctx: Load }) }), ctx: Load })
stack backtrace:
   0: rust_begin_unwind
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:665:5
   1: core::panicking::panic_fmt
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panicking.rs:74:14
   2: <ruff_python_ast::expression::ExpressionRef as red_knot_python_semantic::semantic_model::HasTy>::ty::{{closure}}
             at /Users/rtpg/proj/ruff/crates/red_knot_python_semantic/src/semantic_model.rs:64:32
   3: core::option::Option<T>::unwrap_or_else
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/option.rs:1015:21
   4: <ruff_python_ast::expression::ExpressionRef as red_knot_python_semantic::semantic_model::HasTy>::ty
             at /Users/rtpg/proj/ruff/crates/red_knot_python_semantic/src/semantic_model.rs:62:9
   <etc>

This is probably an easy fix with the regex compilations, but having a bit of trouble finding the right incantation here

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