-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
let
and mut
panic if tokens are placed after a redirection
#13835
Comments
This happens even if you type normally, right at the ~/fork/nushell> let foo o> file Error: × Main thread panicked.
├─▶ at crates/nu-protocol/src/span.rs:187:9
╰─▶ assertion failed: spans.windows(2).all(|spans|
{
let &[a, b] = spans else { return false; };
a.start <= b.start && a.end <= b.end
})
0: 0x564874f1ad54 - rust_begin_unwind
1: 0x5648719ec063 - core::panicking::panic_fmt::h556dd313afe3d53e
2: 0x5648719ec0ec - core::panicking::panic::hac5d0741b9be4a00
3: 0x5648745a84b0 - nu_protocol::span::Span::concat::h27e6cc6003258db3
at /home/kaathewise/fork/nushell/crates/nu-protocol/src/span.rs:187
4: 0x56487369b5d1 - nu_parser::parse_keywords::parse_let::h942bf08e8d5b2400
at /home/kaathewise/fork/nushell/crates/nu-parser/src/parse_keywords.rs:3127
5: 0x56487370b1a3 - nu_parser::parser::parse_builtin_commands::h0f93e1158d050920
at /home/kaathewise/fork/nushell/crates/nu-parser/src/parser.rs:5598
6: 0x56487370f1e4 - nu_parser::parser::parse_pipeline::h404fb07b7bd0b3a4
at /home/kaathewise/fork/nushell/crates/nu-parser/src/parser.rs:5983
7: 0x56487370f853 - nu_parser::parser::parse_block::h3a794479b0a7fa59
at /home/kaathewise/fork/nushell/crates/nu-parser/src/parser.rs:6017
8: 0x5648737149b1 - nu_parser::parser::parse::h8625e6639ecf9fcf
at /home/kaathewise/fork/nushell/crates/nu-parser/src/parser.rs:6565
9: 0x56487330a1a5 - <nu_cli::syntax_highlight::NuHighlighter as reedline::highlighter::Highlighter>::highlight::h5b073a4b913cb1f8
at /home/kaathewise/fork/nushell/crates/nu-cli/src/syntax_highlight.rs:26
10: 0x56487343080a - reedline::engine::Reedline::buffer_paint::hf271607f81f8033a
at /home/kaathewise/.local/state/cargo/git/checkouts/reedline-e42026a78d91c510/7af8959/src/engine.rs:1740
11: 0x56487342d90b - reedline::engine::Reedline::repaint::hb35f6d4ec72e4c1c
at /home/kaathewise/.local/state/cargo/git/checkouts/reedline-e42026a78d91c510/7af8959/src/engine.rs:1505
12: 0x564873426df9 - reedline::engine::Reedline::read_line_helper::hf0ab89bce4d8be63
at /home/kaathewise/.local/state/cargo/git/checkouts/reedline-e42026a78d91c510/7af8959/src/engine.rs:802
13: 0x564873426120 - reedline::engine::Reedline::read_line::h5b125cba9094a8b8
at /home/kaathewise/.local/state/cargo/git/checkouts/reedline-e42026a78d91c510/7af8959/src/engine.rs:646
14: 0x5648732b55ad - nu_cli::repl::loop_iteration::h6816b17367ca997b
at /home/kaathewise/fork/nushell/crates/nu-cli/src/repl.rs:450
15: 0x5648732a1b82 - nu_cli::repl::evaluate_repl::{{closure}}::hbca2bfde76009799
at /home/kaathewise/fork/nushell/crates/nu-cli/src/repl.rs:190
16: 0x56487325cccf - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h895fb711eb7591ef
at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panic/unwind_safe.rs:272
17: 0x5648732ea4a0 - std::panicking::try::do_call::h1cf869321e89d99f
at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:557
18: 0x5648732d3c2b - __rust_try
19: 0x5648732d3b6e - std::panicking::try::hc4b39dbf45d3d1c2
at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:521
- std::panic::catch_unwind::he3bf7de7bdf452cc
at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panic.rs:350
20: 0x5648732ae5aa - nu_cli::repl::evaluate_repl::h65b3e40271ec5dc4
at /home/kaathewise/fork/nushell/crates/nu-cli/src/repl.rs:189
21: 0x564871a4fc28 - nu::run::run_repl::he4323f7bae4513ca
at /home/kaathewise/fork/nushell/src/run.rs:208
22: 0x564871a02fa9 - nu::main::ha6e44a0e5fd8878b
at /home/kaathewise/fork/nushell/src/main.rs:416
23: 0x564871a51d1b - core::ops::function::FnOnce::call_once::hd3df071a50ca3844
at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/ops/function.rs:250
help: set the `RUST_BACKTRACE=1` environment variable to display a backtrace. |
sholderbach
added
🐛 bug
Something isn't working
parser
Issues related to parsing
panic
and removed
needs-triage
An issue that hasn't had any proper look
labels
Sep 13, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
let
andmut
should look like thisIf a redirection is placed between the variable name and
=
, attempting to add another token panics nuThis also happens even if there are type annotations
How to reproduce
=
Expected behavior
panic()!
Configuration
Panic message
The text was updated successfully, but these errors were encountered: