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 9 pull requests #107828

Merged
merged 20 commits into from
Feb 9, 2023
Merged

Conversation

compiler-errors
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

ids1024 and others added 20 commits January 26, 2023 08:08
…ize the tracing loggers at their own discretion
[svgo]: https://github.com/svg/svgo

    $ du -bs src/librustdoc/html/static/images/wheel.svg wheel-old.svg
    2972    src/librustdoc/html/static/images/wheel.svg
    3764    wheel-old.svg

100*((2972-3764)/3764) = -21.04%
To temporarily allow a `str` field in a packed struct using `derive`,
along with `[u8]`.
Implement `AsFd` and `AsRawFd` for `Rc`

Fixes rust-lang#105931.
…bilization, r=dtolnay

Stabilize feature `cstr_from_bytes_until_nul`

This PR seeks to stabilize `cstr_from_bytes_until_nul`.

Partially addresses rust-lang#95027

This function has only been on nightly for about 10 months, but I think it is simple enough that there isn't harm discussing stabilization. It has also had at least a handful of mentions on both the user forum and the discord, so it seems like it's already in use or at least known.

This needs FCP still.

Comment on potential discussion points:
- eventual conversion of `CStr` to be a single thin pointer: this function will still be useful to provide a safe way to create a `CStr` after this change.
- should this return a length too, to address concerns about the `CStr` change? I don't see it as being particularly useful, and it seems less ergonomic (i.e. returning `Result<(&CStr, usize), FromBytesUntilNulError>`). I think users that also need this length without the additional `strlen` call are likely better off using a combination of other methods, but this is up for discussion
- `CString::from_vec_until_nul`: this is also useful, but it doesn't even have a nightly implementation merged yet. I propose feature gating that separately, as opposed to blocking this `CStr` implementation on that

Possible alternatives:

A user can use `from_bytes_with_nul` on a slice up to `my_slice[..my_slice.iter().find(|c| c == 0).unwrap()]`. However; that is significantly less ergonomic, and is a bit more work for the compiler to optimize compared the direct `memchr` call that this wraps.

## New stable API

```rs
// both in core::ffi

pub struct FromBytesUntilNulError(());

impl CStr {
    pub const fn from_bytes_until_nul(
        bytes: &[u8]
    ) -> Result<&CStr, FromBytesUntilNulError>
}
```

cc ```@ericseppanen``` original author, ```@Mark-Simulacrum``` original reviewer, ```@m-ou-se``` brought up some issues on the thin pointer CStr

```@rustbot``` modify labels: +T-libs-api +needs-fcp
…ACKED_STRUCT_WITH_DERIVE, r=RalfJung

Extend `BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE`.

To temporarily allow a `str` field in a packed struct using `derive`, along with `[u8]`.

r? ``@RalfJung``
Replace a command line flag with an env var to allow tools to initialize the tracing loggers at their own discretion

fixes rust-lang/miri#2778

this was introduced in rust-lang#104645, so this PR reverts the flag-part and uses an env var instead.
 x.py fails all downloads that use a tempdir with snap curl rust-lang#107722

Have used the open() library from python to capture the binary output of the curl command and write it to a file using stdout of the subprocess. Added a single-line comment mentioning the redirect operator.
…oli-obk

correctly update goals in the cache

we may want to actually write the response for our goal into the provisional or global cache instead of simply using the result from the last iteration '^^

r? ```@rust-lang/initiative-trait-system-refactor```
…macro-is-ok, r=estebank

Do not eagerly recover for bad `impl Trait` types in macros

Fixes rust-lang#107796

cc rust-lang#106712, ```@estebank``` and ```@Ezrashaw``` please make sure to use [`Parser::may_recover`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/parser/struct.Parser.html#method.may_recover) for all eager-token-consuming parser recoveries.

This also fixes a separate regression from rust-lang#99915, that was introduced before we added `may_recover` though.
…uillaumeGomez

rustdoc: use svgo to shrink `wheel.svg`

use [svgo] to shrink `wheel.svg`

[svgo]: https://github.com/svg/svgo

    $ du -bs src/librustdoc/html/static/images/wheel.svg wheel-old.svg
    2972    src/librustdoc/html/static/images/wheel.svg
    3764    wheel-old.svg

100*((2972-3764)/3764) = -21.04%
Set `rust-analyzer.check.invocationLocation` to `root`

Add
```json
    "rust-analyzer.check.invocationLocation": "root",
    "rust-analyzer.check.invocationStrategy": "once",
```
to the bundled VS code config. This prevents an error with r-a invoking `python3 x.py` in `src/bootstrap` where `x.py` does not exist.

r? ``@jyn514``
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Feb 9, 2023
@compiler-errors
Copy link
Member Author

@bors r+ rollup=never p=9

@rustbot rustbot added the rollup A PR which is a rollup label Feb 9, 2023
@bors
Copy link
Contributor

bors commented Feb 9, 2023

📌 Commit 3e07554 has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 9, 2023
@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 9, 2023
@bors
Copy link
Contributor

bors commented Feb 9, 2023

⌛ Testing commit 3e07554 with merge e7acd07...

@bors
Copy link
Contributor

bors commented Feb 9, 2023

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing e7acd07 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 9, 2023
@bors bors merged commit e7acd07 into rust-lang:master Feb 9, 2023
@rustbot rustbot added this to the 1.69.0 milestone Feb 9, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e7acd07): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.3% [-1.4%, -1.2%] 2
Improvements ✅
(secondary)
-3.6% [-4.1%, -3.2%] 6
All ❌✅ (primary) -1.3% [-1.4%, -1.2%] 2

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.1% [1.7%, 2.6%] 2
Regressions ❌
(secondary)
2.6% [1.3%, 4.9%] 28
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.1% [1.7%, 2.6%] 2

Cycles

This benchmark run did not return any relevant results for this metric.

@compiler-errors compiler-errors deleted the rollup-gyj6dgj branch August 11, 2023 20:16
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. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.