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

Rollup of 10 pull requests #79345

Merged
merged 26 commits into from
Nov 23, 2020
Merged

Rollup of 10 pull requests #79345

merged 26 commits into from
Nov 23, 2020

Conversation

jonas-schievink
Copy link
Contributor

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

camelid and others added 26 commits November 15, 2020 12:58
Also stabilize constctlz for const ctlz_nonzero.

The public methods stabilized const by this commit are:

  * `{i*,u*}::checked_pow`
  * `{i*,u*}::saturating_pow`
  * `{i*,u*}::wrapping_pow`
  * `{i*,u*}::overflowing_pow`
  * `{i*,u*}::pow`
  * `u*::next_power_of_two`
  * `u*::checked_next_power_of_two`
  * `u*::wrapping_next_power_of_two` (the method itself is still unstable)
plus a small edit for clarity
stabilize const_int_pow

This also requires stabilizing constctlz for const ctlz_nonzero.
…-schievink

MIR visitor: Don't treat debuginfo field access as a use of the struct

Fixes #77454.

r? `@jonas-schievink`
const_generics: assert resolve hack causes an error

prevent the min_const_generics `HACK`s in resolve from triggering a fallback path which successfully compiles so that we don't have to worry about future compat issues when removing it

r? `@eddyb` cc `@varkor`
Allow using generic trait methods in `const fn`

Next step for #67792, this now also allows code like the following:

```rust
struct S;

impl const PartialEq for S {
    fn eq(&self, _: &S) -> bool {
        true
    }
}

const fn equals_self<T: PartialEq>(t: &T) -> bool {
    *t == *t
}

pub const EQ: bool = equals_self(&S);
```

This works by threading const-ness of trait predicates through trait selection, in particular through `ParamCandidate`, and exposing it in the resulting `ImplSource`.

Since this change makes two bounds `T: Trait` and `T: ?const Trait` that only differ in their const-ness be treated like different bounds, candidate winnowing has been changed to drop the `?const` candidate in favor of the const candidate, to avoid ambiguities when both a const and a non-const bound is present.
Use Option::and_then instead of open-coding it

`@rustbot` modify labels to +C-cleanup.
Reduce boilerplate with the `?` operator

`@rustbot` modify labels to +C-cleanup.
Fix typo in comment

This is trivial enough I'm just going to merge without review.

r? `@ghost`
doc typo

plus a small edit for clarity
Use Option::map instead of open coding it

r?  `@jonas-schievink` since you're frequently sniping these minor cleanups anyway.
`@rustbot` modify labels +C-cleanup  +T-compiler
@rustbot rustbot added the rollup A PR which is a rollup label Nov 23, 2020
@jonas-schievink
Copy link
Contributor Author

@bors r+ rollup=never p=10

@rustbot modify labels: rollup

@bors
Copy link
Contributor

bors commented Nov 23, 2020

📌 Commit ea3c269 has been approved by jonas-schievink

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Nov 23, 2020
@bors
Copy link
Contributor

bors commented Nov 23, 2020

⌛ Testing commit ea3c269 with merge 40624dd...

@bors
Copy link
Contributor

bors commented Nov 23, 2020

☀️ Test successful - checks-actions
Approved by: jonas-schievink
Pushing 40624dd to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 23, 2020
@bors bors merged commit 40624dd into rust-lang:master Nov 23, 2020
@rustbot rustbot added this to the 1.50.0 milestone Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants