Skip to content
This repository has been archived by the owner on Dec 17, 2022. It is now read-only.

Occasional panic formatting #5

Closed
dsherret opened this issue Sep 1, 2021 · 1 comment
Closed

Occasional panic formatting #5

dsherret opened this issue Sep 1, 2021 · 1 comment

Comments

@dsherret
Copy link
Member

dsherret commented Sep 1, 2021

I sometimes get an error that looks like this in the CLI:

[dprint-plugin-rustfmt]
error: expected item, found keyword `let`
 --> <stdin>:1:1
  |
1 | let result = dprint_core::formatting::format(|| {
  | ^^^ expected item

thread 'main' panicked at 'range start index 8 out of range for slice of length 0', src\format.rs:18:42
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: expected item, found keyword `let`
 --> <stdin>:3:1
  |
3 | let parent_process_id = ...; // parse this from the `--parent-pid` command line argument
  | ^^^ expected item

thread 'main' panicked at 'range start index 8 out of range for slice of length 0', src\format.rs:18:42
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: expected item, found keyword `let`
 --> <stdin>:1:1
  |
1 | let result = dprint_core::formatting::format(|| {
  | ^^^ expected item

thread 'main' panicked at 'range start index 8 out of range for slice of length 0', src\format.rs:18:42
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: expected item, found keyword `let`
 --> <stdin>:3:1
  |
3 | let parent_process_id = ...; // parse this from the `--parent-pid` command line argument
  | ^^^ expected item

thread 'main' panicked at 'range start index 8 out of range for slice of length 0', src\format.rs:18:42
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: expected one of `!` or `::`, found `(`
 --> <stdin>:1:30
  |
1 | handle_process_stdio_messages(MyPluginHandler::new())
  |                              ^ expected one of `!` or `::`

thread 'main' panicked at 'range start index 8 out of range for slice of length 0', src\format.rs:18:42
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The error goes away when I run it again. It might have to do with the <stdin>:x:x thing.

@dsherret
Copy link
Member Author

dsherret commented Jan 30, 2022

Fixed in #8 (or... should be fixed...)

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

No branches or pull requests

1 participant