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 #127278

Merged
merged 34 commits into from
Jul 3, 2024
Merged

Rollup of 8 pull requests #127278

merged 34 commits into from
Jul 3, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Kobzol and others added 30 commits June 29, 2024 15:08
It can contain an owned value instead of a reference.
I.e. change the return type from `TokenStream` to `Vec<TokenTree>`.

Most of the callsites require a `TokenStream`, but the recursive call
used to create `target_tokens` requires a `Vec<TokenTree>`. It's easy
to convert a `Vec<TokenTree>` to a `TokenStream` (just call
`TokenStream::new`) but it's harder to convert a `TokenStream` to a
`Vec<TokenTree>` (either iterate/clone/collect, or use `Lrc::into_inner`
if appropriate).

So this commit changes the return value to simplify that `target_tokens`
call site.
`tts` is a better name than `streams` for a `Vec<TokenTree>`.
Currently it uses a mixture of functional style (`flat_map`) and
imperative style (`push`), which is a bit hard to read. This commit
converts it to fully imperative, which is more concise and avoids the
need for `smallvec`.
Both the indenting, and the missing `)`.
So that the `capturing` state is adjusted immediately before and after
the call to `f`.
To make things a little clearer, and to avoid some `mut` variables.
The number of source code bytes can't exceed a `u32`'s range, so a token
position also can't. This reduces the size of `Parser` and
`LazyAttrTokenStreamImpl` by eight bytes each.
And update the comment. Clearly the return type of this function was
changed at some point in the past, but its name and comment weren't
updated to match.
Since this codegen flag now only controls LLVM-generated comments rather than
all assembly comments, make the name more accurate (and also match Clang).
Change `asm-comments` to `verbose-asm`, always emit user comments

Implements what is described in rust-lang/compiler-team#762

Tracking issue: rust-lang#126802
…-ozkan

Make mtime of reproducible tarballs dependent on git commit

Since rust-lang#123246, our tarballs should be fully reproducible. That means that the mtime of all files and directories in the tarballs is set to the date of the first Rust commit (from 2006). However, this is causing some mtime invalidation issues (rust-lang#125578 (comment)).

Ideally, we would like to keep the mtime reproducible, but still update it with new versions of Rust. That's what this PR does. It modifies the tarball installer bootstrap invocation so that if the current rustc directory is managed by git, we will set the UTC timestamp of the latest commit as the mtime for all files in the archive. This means that the archive should be still fully reproducible from a given commit SHA, but it will also be changed with new beta bumps and `download-rustc` versions.

Note that only files are set to this mtime, directories are still set to the year 2006, because the `tar` library used by `rust-installer` doesn't allow us to selectively override mtime for directories (or at least I haven't found it). We could work around that by doing all the mtime modifications in bootstrap, but that would require more changes. I think/hope that just modifying the file mtimes should be enough. It should at least fix cargo `rustc` mtime invalidation.

Fixes: rust-lang#125578

r? ``@onur-ozkan``

try-job: x86_64-gnu-distcheck
Add `as_lang_item` to `LanguageItems`, new trait solver

Add `as_lang_item` which turns `DefId` into a `TraitSolverLangItem` in the new trait solver, so we can turn the large chain of if statements in `assemble_builtin_impl_candidates` into a match instead.

r? lcnr
…leywiser

Remove global error count checks from typeck

Some of these are not reachable anymore, others can now rely on information local to the current typeck run. One check was actually invalid, because it was relying on wfcheck running before typeck, which is not guaranteed in the query system and usually easy to create ICEing examples for via const eval (which runs typeck before wfcheck)
…rochenkov

Some parser cleanups

Cleanups I made while looking closely at this code.

r? ``@petrochenkov``
…compiler-errors

Add parse fail test using safe trait/impl trait

Added 2 more tests to be sure that nothing weird happens using `safe` on items.
Needed to do this in separate tests as they give parsing errors.
…i-improvements, r=Kobzol

Small `run-make-support` API improvements

r? `@Kobzol`
…Kobzol

bootstrap: pass correct struct size to winapi

Into K32GetProcessMemoryInfo (https://learn.microsoft.com/en-us/windows/win32/api/psapi/nf-psapi-getprocessmemoryinfo) passed in pointer to PROCESS_MEMORY_COUNTERS, but size of PROCESS_MEMORY_COUNTERS_EX, whoops.
@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative rollup A PR which is a rollup labels Jul 3, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=8

@bors
Copy link
Contributor

bors commented Jul 3, 2024

📌 Commit b212cd0 has been approved by matthiaskrgr

It is now in the queue for this repository.

@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 Jul 3, 2024
@bors
Copy link
Contributor

bors commented Jul 3, 2024

⌛ Testing commit b212cd0 with merge 1cfd47f...

@bors
Copy link
Contributor

bors commented Jul 3, 2024

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 1cfd47f to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 3, 2024
@bors bors merged commit 1cfd47f into rust-lang:master Jul 3, 2024
7 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jul 3, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#126803 Change asm-comments to verbose-asm, always emit user co… 19cedd9d6ae0469984c31737786fd6e38da6db4c (link)
#127050 Make mtime of reproducible tarballs dependent on git commit e815e13b501062af527ced2e1954f09155373dfd (link)
#127145 Add as_lang_item to LanguageItems, new trait solver 0332b8796d1e7f440b97f48defcb0a122c73b051 (link)
#127202 Remove global error count checks from typeck 5b67e97529af236db946d0bf883abd4036194952 (link)
#127233 Some parser cleanups d63ff4a7e1f3712037bc71c48d336afaf4fa2498 (link)
#127248 Add parse fail test using safe trait/impl trait d811b22e230cee1df42a7d7a95ca43d3edd174ea (link)
#127264 Small run-make-support API improvements e4e42bf4d88addfbf304d7e19c775618d8abd014 (link)
#127270 bootstrap: pass correct struct size to winapi cbc9975818978bdff784d91eb9b0cddda5e4fe0b (link)

previous master: 1086affd98

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1cfd47f): comparison URL.

Overall result: ❌ regressions - 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.3% [0.2%, 0.6%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary 1.9%)

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)
- - 0
Regressions ❌
(secondary)
6.1% [4.3%, 7.3%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.7% [-4.7%, -2.1%] 3
All ❌✅ (primary) - - 0

Cycles

Results (secondary 2.2%)

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)
- - 0
Regressions ❌
(secondary)
2.2% [2.1%, 2.2%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 706.903s -> 742.585s (5.05%)
Artifact size: 327.56 MiB -> 327.63 MiB (0.02%)

@matthiaskrgr matthiaskrgr deleted the rollup-fjexkdr branch September 1, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.