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

Unsoundly mark unsafe function as safe in crate Ngrammatic #2141

Open
lwz23 opened this issue Nov 21, 2024 · 0 comments
Open

Unsoundly mark unsafe function as safe in crate Ngrammatic #2141

lwz23 opened this issue Nov 21, 2024 · 0 comments

Comments

@lwz23
Copy link

lwz23 commented Nov 21, 2024

see compenguy/ngrammatic#13 for detail.
following function are unsound:

pub fn ngram_from_id(&self, ngram_id: usize) -> NG {
        unsafe { self.ngrams.get_unchecked(ngram_id) }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant