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 8 pull requests #80939

Merged
merged 22 commits into from
Jan 12, 2021
Merged

Rollup of 8 pull requests #80939

merged 22 commits into from
Jan 12, 2021

Conversation

JohnTitor
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

jryans and others added 22 commits December 6, 2020 02:32
This replaces tabs earlier in the diagnostics emitting process, which allows
various margin calculations to ignore the existence of tabs. It does add a
string copy for the source lines that are emitted.
Rationale:

- `atty` is widely used in the Rust ecosystem
- We already use it (in `rustc_errors` and other places)
- We shouldn't be rolling our own TTY detector when there's a
  widely-used, well-tested package that we can use
…-expand, r=estebank

Replace tabs earlier in diagnostics

This replaces tabs earlier in the diagnostics emitting process, which allows various margin calculations to ignore the existence of tabs. It does add a string copy for the source lines that are emitted.

Fixes rust-lang#78438

r? `@estebank`
…me_init, r=dtolnay

Add `MaybeUninit` method `array_assume_init`

When initialising an array element-by-element, the conversion to the initialised array is done through `mem::transmute`, which is both ugly and does not work with const generics (see rust-lang#61956). This PR proposes the associated method `array_assume_init`, matching the style of `slice_assume_init_*`:

```rust
unsafe fn array_assume_init<T, const N: usize>(array: [MaybeUninit<T>; N]) -> [T; N];
```

Example:
```rust
let mut array: [MaybeUninit<i32>; 3] = MaybeUninit::uninit_array();
array[0].write(0);
array[1].write(1);
array[2].write(2);

// SAFETY: Now safe as we initialised all elements
let array: [i32; 3] = unsafe {
     MaybeUninit::array_assume_init(array)
};
```

Things I'm unsure about:
* Should this be a method of array instead?
* Should the function be const?
…chenkov

Move some tests to more reasonable directories

The idea is to move `issues`/`ui` tests in small batches

r? `@petrochenkov`
driver: Use `atty` instead of rolling our own

Fixes rust-lang#80888.

Rationale:

- `atty` is widely used in the Rust ecosystem
- We already use it (in `rustc_errors` and other places)
- We shouldn't be rolling our own TTY detector when there's a
  widely-used, well-tested package that we can use
Replace a simple `if let` with the `matches` macro

`@rustbot` modify labels +C-cleanup +T-compiler
…, r=estebank

fix typo in trait method mutability mismatch help
@rustbot rustbot added the rollup A PR which is a rollup label Jan 12, 2021
@JohnTitor
Copy link
Member Author

@bors r+ rollup=never p=8

@bors
Copy link
Contributor

bors commented Jan 12, 2021

📌 Commit 139daf5 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 Jan 12, 2021
@bors
Copy link
Contributor

bors commented Jan 12, 2021

⌛ Testing commit 139daf5 with merge b6b4616...

@bors
Copy link
Contributor

bors commented Jan 12, 2021

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 12, 2021
@bors bors merged commit b6b4616 into rust-lang:master Jan 12, 2021
@rustbot rustbot added this to the 1.51.0 milestone Jan 12, 2021
@JohnTitor JohnTitor deleted the rollup-pymns4q branch January 12, 2021 11:27
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.

10 participants