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 20 pull requests #82148

Closed
wants to merge 47 commits into from
Closed

Rollup of 20 pull requests #82148

wants to merge 47 commits into from

Conversation

jonas-schievink
Copy link
Contributor

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

henryboisdequin and others added 30 commits February 3, 2021 10:18
rest in peace match bool <3
Changed 'a an exception' to 'an exception'
- Add a "Safety" section, edit formatting for clarity
- Add missing punctuation in code comments
Previously, there two different ways to encode the same info: `None` or
`Some(&[])`. Now there is only one way, `&[]`.
Maybe it was used before the introduction of placeholders, but now it has no effect.
Starting from #63468 cfg attributes on variants, fields, fn params etc. are processed together with other attributes (via `configure!`).
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
…tput register.

On 32-bit ARM platforms, the register `r14` has the alias `lr`. When used as an output register in `asm!`, rustc canonicalizes the name to `r14`. LLVM only knows the register by the name `lr`, and rejects it. This changes rustc's LLVM code generation to output `lr` instead.
…estebank

Suggest to create a new `const` item if the `fn` in the array is a `const fn`

Fixes #73734. If the `fn` in the array repeat expression is a `const fn`, suggest creating a new `const` item. On nightly, suggest creating an inline `const` block. This PR also removes the `suggest_const_in_array_repeat_expressions` as it is no longer necessary.

Example:

```rust
fn main() {
    // Should not compile but hint to create a new const item (stable) or an inline const block (nightly)
    let strings: [String; 5] = [String::new(); 5];
    println!("{:?}", strings);
}

```

Gives this error:

```
error[E0277]: the trait bound `std::string::String: std::marker::Copy` is not satisfied
 --> $DIR/const-fn-in-vec.rs:3:32
  |
2 |     let strings: [String; 5] = [String::new(); 5];
  |                             ^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `String`
  |
  = note: the `Copy` trait is required because the repeated element will be copied
```

With this change, this is the error message:

```
error[E0277]: the trait bound `String: Copy` is not satisfied
  --> $DIR/const-fn-in-vec.rs:3:32
   |
LL |     let strings: [String; 5] = [String::new(); 5];
   |                                ^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
   |
   = help: moving the function call to a new `const` item will resolve the error
```
…gression_test, r=Mark-Simulacrum

Add match pattern diagnostics regression test

Closes #72377 by adding a regression test.

This test case fails on stable but now works on beta and nightly. It *should* have worked already for years, the crucial point whether it is mentioned that some uncovered patterns are not explicitly mentioned.
Seal the CommandExt, OsStrExt and OsStringExt traits

A crater run (#81213 (comment)) has shown that this does not break any existing code.

This also unblocks #77728.

Based on #81213.

r? ```@m-ou-se```
cc ```@lygstate```
const_generics: Dont evaluate array length const when handling errors

Fixes #79518
Fixes #78246

cc ```@lcnr```

This was ICE'ing because we dont pass in the correct ``ParamEnv`` which meant that there was no ``Self: Foo`` predicate to make ``Self::Assoc`` well formed which caused an ICE when trying to normalize ``Self::Assoc`` in the mir interpreter

r? ```@varkor```
Fix typos in BTreeSet::{first, last} docs

map -> set
CTFE validation: catch ReadPointerAsBytes and better error

r? `@oli-obk`
Fixes #79690
Cc rust-lang/miri#1706
Fixed minor typo in catch_unwind docs

Changed "a an exception" to "an exception" inside of the `std::panic::catch_unwind` docs.
const_generics: Fix incorrect ty::ParamEnv::empty() usage

Fixes #80561

Not sure if I should keep the `debug!(..)`s or not but its the second time I've needed them so they sure seem useful lol

cc `@lcnr`
r? `@oli-obk`
Edit `rustc_arena::DropArena` docs

- Add a "Safety" section, edit formatting for clarity
- Add missing punctuation in code comments
Add tests for Atomic*::fetch_{min,max}

This ensures that all atomic operations except for fences are tested. This has been useful to test my work on using atomic instructions for atomic operations in cg_clif instead of a global lock.
Fix a typo

This pull request fixes a typo.
Remove unnecessary `Option` in `default_doc`

Previously, there were two different ways to encode the same info: `None` or
`Some(&[])`. Now there is only one way, `&[]`.
expand: Some cleanup

See individual commits for details.

r? `@Aaron1011`
Add missing env!-decl variant

Resolves #82117
Fix typo in link to CreateSymbolicLinkW documentation.
Remove redundant bool_to_option feature gate
Update link for extern prelude.

There was some reorganization in the reference as part of rust-lang/reference#937.
32-bit ARM: Emit `lr` instead of `r14` when specified as an `asm!` output register.

On 32-bit ARM platforms, the register `r14` has the alias `lr`. When used as an output register in `asm!`, rustc canonicalizes the name to `r14`. LLVM only knows the register by the name `lr`, and rejects it. This changes rustc's LLVM code generation to output `lr` instead.

closes #82052

r? `@nagisa`
@rustbot rustbot added the rollup A PR which is a rollup label Feb 15, 2021
@jonas-schievink
Copy link
Contributor Author

@bors r+ rollup=never p=20

@bors
Copy link
Contributor

bors commented Feb 15, 2021

📌 Commit 4f47637 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 Feb 15, 2021
@bjorn3
Copy link
Member

bjorn3 commented Feb 15, 2021

@bors r-

See #82093 (comment)

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 15, 2021
@jonas-schievink jonas-schievink deleted the rollup-qnc68lv branch February 15, 2021 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.