typeshare icon indicating copy to clipboard operation
typeshare copied to clipboard

`thread '<unnamed>' panicked at .../typeshare-cli-1.9.2/src/main.rs:293:17:`

Open HHogg opened this issue 1 year ago • 1 comments

Typeshare cli panics with the following error.

thread 'main' panicked at /Users/.../.cargo/registry/src/index.crates.io-6f17d22bba15001f/typeshare-cli-1.9.2/src/main.rs:293:17:
expected identifier, found keyword `use`
stack backtrace:
   0:        0x102f026d0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h86895059245fddf1
   1:        0x102f1dc3c - core::fmt::write::h96560297a130d185
   2:        0x102effd84 - std::io::Write::write_fmt::hcce57c840fbfb93a
   3:        0x102f02528 - std::sys_common::backtrace::print::h4dcf9b42b72e8c39
   4:        0x102f03684 - std::panicking::default_hook::{{closure}}::haf8740723901d1d4
   5:        0x102f03378 - std::panicking::default_hook::hc9f6c915d03e3556
   6:        0x102f03f3c - std::panicking::rust_panic_with_hook::h08681e217444fcc3
   7:        0x102f0396c - std::panicking::begin_panic_handler::{{closure}}::hb4d9896bcc795caa
   8:        0x102f02b58 - std::sys_common::backtrace::__rust_end_short_backtrace::hab39235fb9e6a0f5
   9:        0x102f036dc - _rust_begin_unwind
  10:        0x102f37184 - core::panicking::panic_fmt::hb05658191fed4684
  11:        0x102c46d0c - core::panicking::panic_display::hed42836686819ed7
  12:        0x102f26658 - typeshare::main::{{closure}}::panic_cold_display::ha322968e8cffc1a9
  13:        0x102c44424 - core::ops::function::impls::<impl core::ops::function::FnMut<A> for &F>::call_mut::h3d7ef825d62a20d7
  14:        0x102c401b8 - <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold::heb9a411113f1bded
  15:        0x102c4e894 - rayon::iter::plumbing::bridge_producer_consumer::helper::h6b258642959e9bf6
  16:        0x102c49428 - typeshare::main::h60b45878a40fcb8d
  17:        0x102c52058 - std::sys_common::backtrace::__rust_begin_short_backtrace::h7e39e6a60a797819
  18:        0x102c586ec - std::rt::lang_start::{{closure}}::he992f89ddef17f3e
  19:        0x102ef9ce0 - std::rt::lang_start_internal::h4fe1c69f59f9e9bd
  20:        0x102c4a70c - _main

From this fn signature...

fn iter(&self) -> impl Iterator<Item = (f64, f64)> + use<'_, TEntryValue> {
  ...
}

Works fine when changed to

pub fn iter_points(&self) -> impl Iterator<Item = (f64, f64)> + '_ {

It was quite hard to track this down as the panic didn't display any information about what file or line of code it was failing on.

HHogg avatar Jan 01 '25 23:01 HHogg

That sounds like our version of syn is not up to date with precise capturing use syntax yet. I'll take a look as well as seeing if we can improve the parsing error logging as well.

darrell-roberts avatar Feb 10 '25 16:02 darrell-roberts