Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Rollup of 11 pull requests #80105

Merged
merged 30 commits into from
Dec 17, 2020
Merged

Rollup of 11 pull requests #80105

merged 30 commits into from
Dec 17, 2020

Conversation

JohnTitor
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

LeSeulArtichaut and others added 30 commits December 6, 2020 11:48
See
rust-lang#80045 (comment)

Coverage statements are moved to the beginning of the BCB. This does
also affect what's counted before a panic, changing some results, but I
think these results may even be preferred? In any case, there are no
guarantees about what's counted when a panic occurs (by design).
…k-Simulacrum"

This reverts commit 7afc517, reversing
changes made to d4ea0b3.
Integer types have a `count_ones` method that end up calling
`intrinsics::ctpop`.
On some architectures, that intrinsic is translated as a corresponding
CPU instruction know as "popcount" or "popcnt".

This PR makes it so that searching for those names in rustdoc shows those methods.

CC https://blog.rust-lang.org/2020/11/19/Rust-1.48.html#adding-search-aliases
…thewjasper

Implement if-let match guards

Implements rust-lang/rfcs#2294 (tracking issue: rust-lang#51114).

I probably should do a few more things before this can be merged:
- [x] Add tests (added basic tests, more advanced tests could be done in the future?)
- [x] Add lint for exhaustive if-let guard (comparable to normal if-let statements)
- [x] Fix clippy

However since this is a nightly feature maybe it's fine to land this and do those steps in follow-up PRs.

Thanks a lot `@matthewjasper` ❤️ for helping me with lowering to MIR! Would you be interested in reviewing this?
r? `@ghost` for now
Allow `since="TBD"` for rustc_deprecated

Closes rust-lang#78381.

This PR only affects `#[rustc_deprecated]`, not `#[deprecated]`, so there is no effect on any stable language feature.

Likewise this PR only implements `since="TBD"`, it does not actually tag any library functions with it, so there is no effect on any stable API.

Overview of changes:

* `rustc_middle/stability.rs`:
    * change `deprecation_in_effect` function to return `false` when `since="TBD"`
    * tidy up the compiler output when a deprecated item has `since="TBD"`
* `rustc_passes/stability.rs`:
    * allow `since="TBD"` to pass the sanity check for stable_version < deprecated_version
    * refactor the "invalid stability version" and "invalid deprecation version" error into separate errors
* rustdoc: make `since="TBD"` message on a deprecated item's page match the command-line deprecation output
* tests:
    * test rustdoc output
    * test that the `deprecated_in_future` lint fires when `since="TBD"`
    * test the new "invalid deprecation version" error message
Fix issue rust-lang#78496

EarlyOtherwiseBranch finds MIR structures like:

```
bb0: {
  ...
  _2 = discriminant(X)
  ...
  switchInt(_2) -> [1_isize: bb1, otherwise: bb3]
}
bb1: {
  ...
  _3 = discriminant(Y)
  ...
  switchInt(_3) -> [1_isize: bb2, otherwise: bb3]
}
bb2: {...}
bb3: {...}
```

And transforms them into something like:

```
bb0: {
  ...
  _2 = discriminant(X)
  _3 = discriminant(Y)
  _4 = Eq(_2, _3)
  switchInt(_4) -> [true: bb4, otherwise: bb3]
}
bb2: {...} // unchanged
bb3: {...} // unchanged
bb4: {
  switchInt(_2) -> [1_isize: bb2, otherwise: bb3]
}
```

But that is not always a safe thing to do -- sometimes the early `otherwise` branch is necessary so the later block could assume the value of `discriminant(X)`.

I am not totally sure what's the best way to detect that, but fixing rust-lang#78496 should be easy -- we just check if `X` is a sub-expression of `Y`. A more precise test might be to check if `Y` contains a `Downcast(1)` of `X`, but I think this might be good enough.

Fix rust-lang#78496
…Mark-Simulacrum

expand-yaml-anchors: Make the output directory separator-insensitive

Fixes rust-lang#75709
…=matthewjasper

Remove unused `TyEncoder::tcx` required method

Unsure if this is helpful or not...

r? ``@ghost`` cc ``@matthewjasper`` ``@jackh726``
Test that `core::assert!` is valid

Closes rust-lang#55482.

r? `@dtolnay`
…2.1, r=tmandry

Fixed conflict with drop elaboration and coverage

See
rust-lang#80045 (comment)

Coverage statements are moved to the beginning of the BCB. This does
also affect what's counted before a panic, changing some results, but I
think these results may even be preferred? In any case, there are no
guarantees about what's counted when a panic occurs (by design).

r? `@tmandry`

FYI `@wesleywiser` `@ecstatic-morse`
…r=varkor

Add support for target aliases

Closes rust-lang#68214, see that for more info.

`@varkor`
…k-Simulacrum

Revert rust-lang#78790 - rust-src vendoring

This reverts the rust-src vendor changes from rust-lang#78790. There were a few issues (see rust-lang#79218, rust-lang/cargo#8962, rust-lang/cargo#8963), that I don't think will get fixed in the next few days before the beta branch.

Fixes rust-lang#79218
Add `popcount` and `popcnt` as doc aliases for `count_ones` methods.

Integer types have a `count_ones` method that end up calling `intrinsics::ctpop`. On some architectures, that intrinsic is translated as a corresponding CPU instruction know as "popcount" or "popcnt".

This PR makes it so that searching for those names in rustdoc shows those methods.

CC https://blog.rust-lang.org/2020/11/19/Rust-1.48.html#adding-search-aliases
…c_expand, r=jyn514

Remove docs for non-existent parameters in `rustc_expand`
@rustbot rustbot added the rollup A PR which is a rollup label Dec 17, 2020
@JohnTitor
Copy link
Member Author

@bors r+ p=5 rollup=never

@bors
Copy link
Collaborator

bors commented Dec 17, 2020

📌 Commit e2582e4 has been approved by JohnTitor

@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 Dec 17, 2020
@bors
Copy link
Collaborator

bors commented Dec 17, 2020

⌛ Testing commit e2582e4 with merge 9b84d36...

@bors
Copy link
Collaborator

bors commented Dec 17, 2020

☀️ Test successful - checks-actions
Approved by: JohnTitor
Pushing 9b84d36 to master...

# for free to join this conversation on GitHub. Already have an account? # 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.