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 6 pull requests #65622

Merged
merged 13 commits into from
Oct 20, 2019
Merged

Rollup of 6 pull requests #65622

merged 13 commits into from
Oct 20, 2019

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Oct 20, 2019

Successful merges:

Failed merges:

r? @ghost

tesuji and others added 13 commits October 2, 2019 12:22
Will reduce confusion like in https://users.rust-lang.org/t/help-understanding-the-ref-t-syntax/33779 since match ergonomics means you (almost) never have to say `ref` anymore!
Inline `ptr::null(_mut)` even in debug builds

I think we should treat `ptr::null(_mut)` as a constant. As It may help reduce code size
in debug build.
See godbolt link: https://godbolt.org/z/b9YMtD
Avoid realloc in `CString::new`

If `&[u8]` or `&str` is given, `CString::new` allocates a new `Vec` with the exact capacity, and then `CString::from_vec_unchecked` calls `.reserve_exact(1)` for nul byte. This PR avoids the reallocation by allocationg `len + 1` bytes beforehand. In microbenchmark this PR speeds up `CString::new(&[u8])` by 30%.
add test for calling non-const fn

The good news is that there is an error. But I expected to see [this error](https://github.com/rust-lang/rust/blob/9578272d681c8691ca2ff3f5c4230b491bc1c694/src/librustc_mir/const_eval.rs#L346) surface. @oli-obk any idea why that message is not shown anywhere?

r? @oli-obk
Remove unneeded `ref` from docs

Will reduce confusion like in https://users.rust-lang.org/t/help-understanding-the-ref-t-syntax/33779 since match ergonomics means you (almost) never have to say `ref` anymore!

There might be more like this, but I don't have a checkout on my computer right this second and I'm on slow wifi and GitHub search isn't powerful enough and that's my story.
@Centril
Copy link
Contributor Author

Centril commented Oct 20, 2019

@bors r+ p=6 rollup=never

@bors
Copy link
Contributor

bors commented Oct 20, 2019

📌 Commit ba42fc2 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 Oct 20, 2019
@Centril Centril added the rollup A PR which is a rollup label Oct 20, 2019
@bors
Copy link
Contributor

bors commented Oct 20, 2019

⌛ Testing commit ba42fc2 with merge 89e645a...

bors added a commit that referenced this pull request Oct 20, 2019
Rollup of 6 pull requests

Successful merges:

 - #64996 (Inline `ptr::null(_mut)` even in debug builds)
 - #65551 (Avoid realloc in `CString::new`)
 - #65593 (add test for calling non-const fn)
 - #65595 (move `parse_cfgspecs` to `rustc_interface`)
 - #65600 (Remove unneeded `ref` from docs)
 - #65602 (Fix plural mistake in emitter.rs)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented Oct 20, 2019

☀️ Test successful - checks-azure
Approved by: Centril
Pushing 89e645a to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 20, 2019
@bors bors merged commit ba42fc2 into rust-lang:master Oct 20, 2019
@bors bors mentioned this pull request Oct 20, 2019
@Centril Centril deleted the rollup-l8orba7 branch October 20, 2019 18:06
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.

7 participants