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

or_fun_call should ignore const fns #1527

Closed
sgrif opened this issue Feb 10, 2017 · 2 comments
Closed

or_fun_call should ignore const fns #1527

sgrif opened this issue Feb 10, 2017 · 2 comments
Assignees
Labels
C-bug Category: Clippy is not doing the correct thing E-medium Call for participation: Medium difficulty level problem and requires some initial experience. T-middle Type: Probably requires verifiying types

Comments

@sgrif
Copy link

sgrif commented Feb 10, 2017

Hi there. I was surprised to find that clippy warns on foo.map(CStr::as_ptr).unwrap_or(ptr::null_mut()). Given that null_mut is a const fn, forcing it to be in unwrap_or_else(|| ptr::null_mut()) is just noise. (I'm also unsure whether enum constructors are technically const fns, but fixing this could potentially fix #1338)

@oli-obk oli-obk added E-medium Call for participation: Medium difficulty level problem and requires some initial experience. C-bug Category: Clippy is not doing the correct thing T-middle Type: Probably requires verifiying types labels Feb 10, 2017
@mcarton mcarton self-assigned this Feb 12, 2017
@mcarton
Copy link
Member

mcarton commented Feb 12, 2017

I cannot reproduce even in diesel's repo and this should have been fixed in #917. The original PR on diesel is older than #917, this might have been the problem.
I can however reproduce #1338.
Feel free to reopen if you have a reproducible example.

@mcarton mcarton closed this as completed Feb 12, 2017
@killercup
Copy link
Member

The original PR on diesel is older than #917, this might have been the problem.

Can confirm. I'm pretty good at cargo culting changes like that without thinking about it 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing E-medium Call for participation: Medium difficulty level problem and requires some initial experience. T-middle Type: Probably requires verifiying types
Projects
None yet
Development

No branches or pull requests

4 participants