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

Closed
wants to merge 39 commits into from

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
Since this codegen flag now only controls LLVM-generated comments rather than
all assembly comments, make the name more accurate (and also match Clang).
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.
…ssible-temp-dir-resolution, r=jieyouxu

Disable rmake test `inaccessible-temp-dir` on riscv64

In rust-lang#126279 the `inaccessible-temp-dir` test was moved to rmake, I followed up with a 'fix' derived from rust-lang#126355 in rust-lang#126707.

That 'fix' was misguided and hiding the true issue of the linker being incorrect for `riscv64gc-unknown-linux-gnu` (addressed in rust-lang#126916).

Unfortunately, even with the linker fixed, this test doesn't work. I asked myself why this appeared to work on other platforms and investigated why. Both the containers for `armhf-gnu` and `riscv64gc` run their tests as `root` and have `NO_CHANGE_USER` set:

https://github.com/rust-lang/rust/blob/553a69030e5a086eb3841d020db8c9c463948c72/src/ci/docker/host-x86_64/disabled/riscv64gc-gnu/Dockerfile#L99

This means the tests are run as `root`. As `root`, it's perfectly normal and reasonable to violate permission checks this way:

```bash
$ sudo mkdir scratch
$ sudo chmod o-w scratch
$ sudo mkdir scratch/backs
$
```

Because of this, this PR makes the test ignored on `riscv64gc` for now.

As an alternative, I believe the best long-term strategy would be to not run the tests as `root` for this job.

## Testing

> [!NOTE]
> `riscv64gc-unknown-linux-gnu` is a [**Tier 2 with Host Tools** platform](https://doc.rust-lang.org/beta/rustc/platform-support.html), all tests may not necessarily pass! This change should only ignore `inaccessible-temp-dir` and not affect other tests.

You can test out the job locally:

```sh
mv src/ci/docker/host-x86_64/disabled/riscv64gc-gnu src/ci/docker/host-x86_64/riscv64gc-gnu
DEPLOY=1 ./src/ci/docker/run.sh riscv64gc-gnu
```
…-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
…ieril

More refactorings to rustc_interface

Follow up to rust-lang#126834
…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`
Add a test for `generic_const_exprs`

Fixes rust-lang#103770

r? `@Nilstrieb`
@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 2, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=9

@bors
Copy link
Contributor

bors commented Jul 2, 2024

📌 Commit 7500abf 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 2, 2024
@bors
Copy link
Contributor

bors commented Jul 3, 2024

⌛ Testing commit 7500abf with merge dd71485...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 3, 2024
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#126403 (Actually report normalization-based type errors correctly for alias-relate obligations in new solver)
 - rust-lang#126803 (Change `asm-comments` to `verbose-asm`, always emit user comments)
 - rust-lang#126917 (Disable rmake test `inaccessible-temp-dir` on riscv64)
 - rust-lang#127050 (Make mtime of reproducible tarballs dependent on git commit)
 - rust-lang#127145 (Add `as_lang_item` to `LanguageItems`, new trait solver)
 - rust-lang#127184 (More refactorings to rustc_interface)
 - rust-lang#127202 (Remove global error count checks from typeck)
 - rust-lang#127233 (Some parser cleanups)
 - rust-lang#127245 (Add a test for `generic_const_exprs`)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 3, 2024
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#126403 (Actually report normalization-based type errors correctly for alias-relate obligations in new solver)
 - rust-lang#126803 (Change `asm-comments` to `verbose-asm`, always emit user comments)
 - rust-lang#126917 (Disable rmake test `inaccessible-temp-dir` on riscv64)
 - rust-lang#127050 (Make mtime of reproducible tarballs dependent on git commit)
 - rust-lang#127145 (Add `as_lang_item` to `LanguageItems`, new trait solver)
 - rust-lang#127184 (More refactorings to rustc_interface)
 - rust-lang#127202 (Remove global error count checks from typeck)
 - rust-lang#127233 (Some parser cleanups)
 - rust-lang#127245 (Add a test for `generic_const_exprs`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Jul 3, 2024

⌛ Testing commit 7500abf with merge 04cd3f1...

@rust-log-analyzer
Copy link
Collaborator

The job test-various failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [assembly] tests/assembly/asm-comments.rs stdout ----

error: compilation failed!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/assembly/asm-comments.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=wasm32-wasip1" "--check-cfg" "cfg(FALSE)" "-O" "-Cdebug-assertions=no" "--emit" "asm" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/assembly/asm-comments/asm-comments.s" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/wasm32-wasip1/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/assembly/asm-comments/auxiliary"
--- stderr -------------------------------
error[E0658]: inline assembly is not stable yet on this architecture
##[error]  --> /checkout/tests/assembly/asm-comments.rs:10:14
   |
   |
10 |     unsafe { core::arch::asm!("nop // example comment") };
   |
   = note: see issue #93335 <https://github.com/rust-lang/rust/issues/93335> for more information
   = note: see issue #93335 <https://github.com/rust-lang/rust/issues/93335> for more information
   = help: add `#![feature(asm_experimental_arch)]` to the crate attributes to enable

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0658`.

@bors
Copy link
Contributor

bors commented Jul 3, 2024

💔 Test failed - checks-actions

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

tgross35 commented Jul 3, 2024

#126803 was the failure

@jieyouxu
Copy link
Member

jieyouxu commented Jul 3, 2024

@bors r- (test failed)

@jieyouxu jieyouxu closed this Jul 3, 2024
@matthiaskrgr matthiaskrgr deleted the rollup-pnlimrc branch September 1, 2024 17:36
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 rollup A PR which is a rollup 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
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.