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 7 pull requests #57957

Merged
merged 25 commits into from
Jan 29, 2019
Merged

Rollup of 7 pull requests #57957

merged 25 commits into from
Jan 29, 2019

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Jan 28, 2019

Successful merges:

Failed merges:

r? @ghost

purple-ice and others added 25 commits January 3, 2019 20:15
Added an example that points out hardly obvious mistake one could make when writing impl for a new type.
Replaced impl block dock with suggested one and made sure that blocks compile.
It's overall faster to perform this extra check than to perform the
query, even if the result is already in the query cache.
This is needed to properly respect "deny_warnings = false" in config.toml
…apin

Kill remaining uses of mem::uninitialized in libcore, liballoc

Kill remaining uses of mem::uninitialized in libcore and liballoc, and enable a lint that will warn when uses are added again in the future.

To avoid casting raw pointers around (which is always very dangerous because it is not typechecked at all -- it doesn't even get the "same size" sanity check that `transmute` gets), I also added two new functions to `MaybeUninit`:

```rust
    /// Get a pointer to the first contained values.
    pub fn first_ptr(this: &[MaybeUninit<T>]) -> *const T {
        this as *const [MaybeUninit<T>] as *const T
    }

    /// Get a mutable pointer to the first contained values.
    pub fn first_mut_ptr(this: &mut [MaybeUninit<T>]) -> *mut T {
        this as *mut [MaybeUninit<T>] as *mut T
    }
```

I changed some of the existing code to use array-of-`MaybeUninit` instead of `MaybeUninit`-of-array, successfully removing raw pointer casts there as well.
Avoid erase_regions_ty queries if there are no regions to erase

It's overall faster to perform this extra check than to perform the
query, even if the result is already in the query cache.
…alexcrichton

Print a slightly clearer message when failing to launch a thread

As discussed in rust-lang#46345, the `io::Error` you get when a thread fails to launch is of type `io::ErrorKind::WouldBlock`. This is super uninformative when an arbitrary `thread::spawn` fails somewhere in your code:

```
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 11,
kind: WouldBlock, message: "operation would block" }', src/libcore/result.rs:997:5
```

This PR improves the situation a little bit by using `expect` instead of `unwrap`. I don't consider this a complete fix for rust-lang#46345 though.
…ietMisdreavus

Fix invalid background color

As discussed in rust-lang#57814.

r? @QuietMisdreavus
add typo suggestion to unknown attribute error

Provides a suggestion using Levenshtein distance to suggest built-in attributes and attribute macros.

Fixes rust-lang#49270.
Pretty print `$crate` as `crate` or `crate_name` in more cases

So, people do parse output of `--pretty=expanded` (sigh), so covering only the legacy proc-macro case (like it was done in rust-lang#57155) is not enough.

This PRs resolves all `$crate`s produced by macros, so they are all printed in the parseable form `$crate::foo` -> `crate::foo` or `crate_name::foo`.

Fixes rust-lang#38016 (comment)
Fixes rust-lang#57155 (comment)
…r=estebank

Extend E0106, E0261

This is a reopening of rust-lang#57310 with review comments addressed because the original author has since deleted their fork.

From the author (@purple-ice):

> Added an example that points out hardly obvious mistake one could make when writing impl for a new type.

r? @rust-lang/docs
@Centril
Copy link
Contributor Author

Centril commented Jan 28, 2019

@bors r+ p=7

@bors
Copy link
Contributor

bors commented Jan 28, 2019

📌 Commit d77db2e has been approved by Centril

@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 28, 2019
@bors
Copy link
Contributor

bors commented Jan 28, 2019

⌛ Testing commit d77db2e with merge 1e3b791c4f0e6f578df7d27cf3571d346e32dd51...

@bors
Copy link
Contributor

bors commented Jan 29, 2019

💥 Test timed out

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 29, 2019
@kennytm
Copy link
Member

kennytm commented Jan 29, 2019

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 29, 2019
@bors
Copy link
Contributor

bors commented Jan 29, 2019

⌛ Testing commit d77db2e with merge 5f60208...

bors added a commit that referenced this pull request Jan 29, 2019
Rollup of 7 pull requests

Successful merges:

 - #57045 (Kill remaining uses of mem::uninitialized in libcore, liballoc)
 - #57674 (Avoid erase_regions_ty queries if there are no regions to erase)
 - #57833 (Print a slightly clearer message when failing to launch a thread)
 - #57859 (Fix invalid background color)
 - #57904 (add typo suggestion to unknown attribute error)
 - #57915 (Pretty print `$crate` as `crate` or `crate_name` in more cases)
 - #57950 (Extend E0106, E0261)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented Jan 29, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: Centril
Pushing 5f60208 to master...

@bors
Copy link
Contributor

bors commented Jan 29, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: Centril
Pushing 5f60208 to master...

@bors bors merged commit d77db2e into rust-lang:master Jan 29, 2019
@Centril Centril deleted the rollup branch January 29, 2019 08:17
@Centril Centril added the rollup A PR which is a rollup label Oct 2, 2019
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-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