rust-analyzer / countme

Apache License 2.0
18 stars 4 forks source link

Example fails #12

Open peter-lyons-kehl opened 2 years ago

peter-lyons-kehl commented 2 years ago

The example given at https://docs.rs/countme/3.0.1/countme fails at runtime, with both Rust 1.61.0 and 1.63-nightly. My guess is non-lexical lifetimes make the local variables disappear early?

(The following is from https://github.com/peter-kehl/countme_test, which has the aforementioned example pasted in.)

thread 'tests::countme_orig_example' panicked at 'assertion failed: `(left == right)`
  left: `0`,
 right: `2`', src/lib.rs:23:9
crazymerlyn commented 2 months ago

Works fine if you use the feature "enable". Don't know why that feature isn't on by default.