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

Revert (some) const functionality from #296 #323

Closed
clubby789 opened this issue Jul 25, 2022 · 1 comment · Fixed by #324
Closed

Revert (some) const functionality from #296 #323

clubby789 opened this issue Jul 25, 2022 · 1 comment · Fixed by #324

Comments

@clubby789
Copy link
Contributor

clubby789 commented Jul 25, 2022

While marking functions as const in the PR (#296), I didn't notice a few issues, such as

#[must_use]
#[inline]
pub const fn can_decode(&self) -> bool {
self.data_ptr != self.data_ptr_end
}

Comparing pointers in a const context is disallowed without unstable features, but since the pointers are stored as usize, rustc didn't warn of the issue.

There might be other functions that shouldn't be const, this is just the first one I noticed.

@wtfsck
Copy link
Member

wtfsck commented Jul 25, 2022

There are only 6 const fn in that file, so seems like you found the only function that shouldn't be const. Want to send a PR?

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

Successfully merging a pull request may close this issue.

2 participants