Skip to content
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

fix(docs): change old 0.14.0 #410

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion book/src/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

```toml
[dependencies]
logos = "0.14.0"
logos = "0.14.1"
```

Then, you can automatically derive the [`Logos`](https://docs.rs/logos/latest/logos/trait.Logos.html) trait on your `enum` using the `Logos` derive macro:
Expand Down
4 changes: 2 additions & 2 deletions tests/tests/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn test_clone_ub() {
let mut lexer = Token::lexer("a");
assert_eq!(lexer.next(), Some(Ok(Token::Evil(Evil::default()))));

// In logos 0.14.0, this causes use-after-free (UB),
// In logos 0.14.1, this causes use-after-free (UB),
// because `Clone` dereferences the value returned by the last call to `lexer.next()`,
// which got deallocated.
// A real-life example where this could happen is with `Rc`.
Expand All @@ -51,7 +51,7 @@ fn test_clone_leak() {
};
assert_eq!(evil.0.get(), 0);

// In logos 0.14.0, this causes a memory leak because `evil` is cloned with `lexer`.
// In logos 0.14.1, this causes a memory leak because `evil` is cloned with `lexer`.
// This produces `evil.0.get() == 1`. It will fail even on `cargo test`.
let mut lexer2 = lexer.clone();
assert_eq!(evil.0.get(), 0);
Expand Down
Loading