cessen / ropey

A utf8 text rope for manipulating and editing large texts.
MIT License
1.04k stars 46 forks source link

attempt to compute `0_usize - 1_usize`, which would overflow #73

Closed steewbsd closed 1 year ago

steewbsd commented 1 year ago

Hello, while trying to compile some cargo package (zee) which has ropey as a dependency, I ran into this error: attempt to compute 0_usize - 1_usize, which would overflow image

Viewing the source, the comment above this declaration specifies this: image

I am unsure whether this is an error on my side, relevant info: rustc --version: rustc 1.65.0 (897e37553 2022-11-02) rustup toolchain list: stable-x86_64-unknown-linux-musl (default) nightly-x86_64-unknown-linux-musl Operating system: Alpine linux edge x86_64

cessen commented 1 year ago

This appears to be a manifestation of #56, which was fixed in Ropey 1.5.0. It looks like you're building a version of Zee that depends on Ropey 1.4.1, which is why you're running into it. The latest master of Zee uses Ropey 1.5.0, so if you download and build that instead, you should be good to go.

You could also poke the maintainer of Zee to make another crates.io release with the upgraded Ropey dependency.

steewbsd commented 1 year ago

Thanks, building from git solved the issue.