Skip to content

Implement Zero for unit #8155

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

Closed
wants to merge 1 commit into from
Closed

Conversation

stepancheg
Copy link
Contributor

No description provided.

#[cfg(not(test))]
impl Zero for () {
fn zero() -> () { () }
fn is_zero(&self) -> bool { true }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these two functions be marked with #[inline]?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bstrie added in pull request #8404

stepancheg added a commit to stepancheg/rust that referenced this pull request Aug 8, 2013
bors added a commit that referenced this pull request Aug 11, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Feb 10, 2022
…o_iter, r=giraffate

[explicit_counter_loop] suggests `.into_iter()`, despite that triggering [into_iter_on_ref] in some cases

I have modified `fn make_iterator_snippet` in clippy_lints/src/loops/utils.rs ,so this change has some little influence on another lint [manual_flatten] .

fixes rust-lang#8155

---
changelog: Fix that [`explicit_counter_loop`] suggests `into_iter()` despite that triggering [`into_iter_on_ref`] in some cases
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 this pull request may close these issues.

4 participants