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

Rename Integer divides to is_multiple_of. #16045

Closed
wants to merge 1 commit into from
Closed

Rename Integer divides to is_multiple_of. #16045

wants to merge 1 commit into from

Conversation

treeman
Copy link
Contributor

@treeman treeman commented Jul 28, 2014

This is a fix for #15710.

[breaking-change]

@sinistersnare
Copy link
Contributor

I think this needs a [breaking-change] report?

@treeman
Copy link
Contributor Author

treeman commented Jul 28, 2014

You may be right. I assume I just needed to add that line?

@sinistersnare
Copy link
Contributor

I think you need an explanation of how to fix it (in this case just change divides to is_multiple_of) and the literal [breaking-change] on a separate line.

cc @cmr, is that correct?

@alexcrichton
Copy link
Member

You can find documentation of our breaking changes policy here: https://mail.mozilla.org/pipermail/rust-dev/2014-April/009543.html

@alexcrichton
Copy link
Member

Two notable changes would be placing [breaking-change] in the commit message along with rationale and migration paths forward. Additionally this should leave the old functions as #[deprecated] to provide a smoother migration path.

@treeman
Copy link
Contributor Author

treeman commented Jul 28, 2014

Alright, thanks!

It is being changed because the previous wording was ambiguous.
`a.divides(b)` implied `a % b == 0` but it sounds like the other way
around. `9.divides(&3) == true` but we might read that as
"does 9 divide 3?".  It has been renamed to sidestep the ambiguity.

Work around the change by using `is_multiple_of` instead.

[breaking-change]
@treeman
Copy link
Contributor Author

treeman commented Jul 28, 2014

@alexcrichton care to take a peek?

@alexcrichton
Copy link
Member

Looks good @treeman, thanks! (just looking at the structure of the change)

@treeman
Copy link
Contributor Author

treeman commented Jul 29, 2014

I'm not sure why the tests failed, to me it seems like it went fine?

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 11, 2023
Fix panic with closure inside array len

I was working on rust-lang#15947 and found out that we panic on this test:
```
fn main() {
    let x = [(); &(&'static: loop { |x| {}; }) as *const _ as usize]
}
```
This PR fixes the panic. Closures in array len are still broken, but closure in const eval is not stable anyway.
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