Skip to content

Conversation

jieyouxu
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

RalfJung and others added 30 commits April 15, 2024 18:45
threads: keep track of why we are blocked, and sanity-check that when waking up

Also remove support for condvars blocked on rwlocks, as that was no longer used.
no_std works on Windows now

Since we now properly support the magic linker section for TLS dtors, the no_std test works on Windows.
implement support for __rust_alloc_error_handler

Fixes rust-lang/miri#3439
directly call handle_alloc_error

Also test more codepaths. There's like 5 different things that can happen on allocation failure! Between `-Zoom`, `#[alloc_error_handler]`, and `set_alloc_error_hook`, we have 3 layers of behavior overrides. It's all a bit messy.

rust-lang#112331 seems intended to clean this up, but has not yet reached consensus.
lint-docs: Add redirects for renamed lints.

This updates the lint docs to include a redirect for renamed lints to the new name. This helps ensure that links to the old name will still be valid.

Note that this currently uses a hard-coded list. As mentioned in the comment, a future enhancement may gather this information in a better way.

Unblocks rust-lang#123680
…lacrum

coverage: Branch coverage tests for lazy boolean operators

The current branch coverage implementation already supports the `&&` and `||` operators (even outside of an `if` condition), as a natural consequence of how they are desugared/lowered, but we didn't have any specific tests for them. This PR adds some appropriate tests.

I've also moved the existing branch coverage tests into a `coverage/branch` subdirectory, so that they don't become unwieldy as I add more branch coverage tests.

`@rustbot` label +A-code-coverage
…ild_manifest, r=Mark-Simulacrum

Add llvm-bitcode-linker to build manifest

When creating rust-lang#123423 I didn't realize I also had to add the new component to the build-manifest. This PR finishes the work of adding it, by also adding it to the build manifest.

r? `@Mark-Simulacrum`
…lacrum

Improve std::fs::Metadata Debug representation

- Remove duplication of `mode` between `file_type` and `permissions`, which both involve operating on the same mode_t integer
- Add `is_symlink`
- Add `len` in bytes
- Remove Ok wrapping around `modified`, `accessed`, `created`, which eliminates 6 useless lines

<table>
<tr><th>Before</th><th>After</th></tr>
<tr><td>

```console
Metadata {
    file_type: FileType(
        FileType {
            mode: 0o100600 (-rw-------),
        },
    ),
    is_dir: false,
    is_file: true,
    permissions: Permissions(
        FilePermissions {
            mode: 0o100600 (-rw-------),
        },
    ),
    modified: Ok(
        SystemTime {
            tv_sec: 1713402981,
            tv_nsec: 682983531,
        },
    ),
    accessed: Ok(
        SystemTime {
            tv_sec: 1713402983,
            tv_nsec: 206999623,
        },
    ),
    created: Ok(
        SystemTime {
            tv_sec: 1713402981,
            tv_nsec: 682983531,
        },
    ),
    ..
}
```
</td><td>

```console
Metadata {
    file_type: FileType {
        is_file: true,
        is_dir: false,
        is_symlink: false,
        ..
    },
    permissions: Permissions(
        FilePermissions {
            mode: 0o100600 (-rw-------),
        },
    ),
    len: 2096,
    modified: SystemTime {
        tv_sec: 1713402981,
        tv_nsec: 682983531,
    },
    accessed: SystemTime {
        tv_sec: 1713402983,
        tv_nsec: 206999623,
    },
    created: SystemTime {
        tv_sec: 1713402981,
        tv_nsec: 682983531,
    },
    ..
}

```
</td></tr></table>

Generated by:

```rust
fn main() {
    println!("{:#?}", std::fs::metadata("Cargo.toml").unwrap());
}
```
…-Simulacrum

llvm RustWrapper: explain OpBundlesIndirect argument type

Follow-up to rust-lang#123941

r? `@Mark-Simulacrum`
Give a name to each distinct manipulation of pretty-printer FixupContext

There are only 7 distinct ways that the AST pretty-printer interacts with FixupContext: 3 constructors (including Default), 2 transformations, and 2 queries.

This PR turns these into associated functions which can be documented with examples.

This PR unblocks rust-lang#119427 (comment). In order to improve the pretty-printer's behavior regarding parenthesization of braced macro calls in match arms, which have different grammar than macro calls in statements, FixupContext needs to be extended with 2 new fields. In the previous approach, that would be onerous. In the new approach, all it entails is 1 new constructor (`FixupContext::new_match_arm()`).
…ulacrum

mir-opt tests: rename unit-test -> test-mir-pass

"unit-test" is extremely non-descriptive, no idea how one is supposed to read that and know that this specifies the MIR pass being tested.
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc 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. rollup A PR which is a rollup labels Apr 20, 2024
@jieyouxu
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Apr 20, 2024

📌 Commit 9dfd633 has been approved by jieyouxu

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 Apr 20, 2024
@bors
Copy link
Collaborator

bors commented Apr 20, 2024

⌛ Testing commit 9dfd633 with merge d1de9c9...

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 20, 2024
Rollup of 11 pull requests

Successful merges:

 - rust-lang#123379 (Print note with closure signature on type mismatch)
 - rust-lang#123967 (static_mut_refs: use raw pointers to remove the remaining FIXME)
 - rust-lang#123976 (Use fake libc in core test)
 - rust-lang#123986 (lint-docs: Add redirects for renamed lints.)
 - rust-lang#124053 (coverage: Branch coverage tests for lazy boolean operators)
 - rust-lang#124071 (Add llvm-bitcode-linker to build manifest)
 - rust-lang#124103 (Improve std::fs::Metadata Debug representation)
 - rust-lang#124132 (llvm RustWrapper: explain OpBundlesIndirect argument type)
 - rust-lang#124191 (Give a name to each distinct manipulation of pretty-printer FixupContext)
 - rust-lang#124193 (Miri subtree update)
 - rust-lang#124196 (mir-opt tests: rename unit-test -> test-mir-pass)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-msvc-ext failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
tests/panic\transmute_fat2.rs ... ok
tests/panic\function_calls\exported_symbol_good_unwind.rs ... ok
tests/panic\panic1.rs ... ok

FAILED TEST: tests/panic\mir-validation.rs
command: "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1\\bin\\miri.exe" "--error-format=json" "--sysroot=C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zmiri-provenance-gc=1" "-Zui-testing" "--target" "x86_64-pc-windows-msvc" "--extern" "getrandom_01=C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-tools\\ui\\miri\\x86_64-pc-windows-msvc\\debug\\deps\\libgetrandom-de8a1b4b21badd22.rlib" "--extern" "getrandom_01=C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-tools\\ui\\miri\\x86_64-pc-windows-msvc\\debug\\deps\\libgetrandom-de8a1b4b21badd22.rmeta" "--extern" "getrandom_02=C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-tools\\ui\\miri\\x86_64-pc-windows-msvc\\debug\\deps\\libgetrandom-e5f662dadaebb8db.rlib" "--extern" "getrandom_02=C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-tools\\ui\\miri\\x86_64-pc-windows-msvc\\debug\\deps\\libgetrandom-e5f662dadaebb8db.rmeta" "--extern" "libc=C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-tools\\ui\\miri\\x86_64-pc-windows-msvc\\debug\\deps\\liblibc-3e0139bc6eeab6f9.rlib" "--extern" "libc=C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-tools\\ui\\miri\\x86_64-pc-windows-msvc\\debug\\deps\\liblibc-3e0139bc6eeab6f9.rmeta" "--extern" "num_cpus=C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-tools\\ui\\miri\\x86_64-pc-windows-msvc\\debug\\deps\\libnum_cpus-127d4d81b9c33250.rlib" "--extern" "num_cpus=C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-tools\\ui\\miri\\x86_64-pc-windows-msvc\\debug\\deps\\libnum_cpus-127d4d81b9c33250.rmeta" "--extern" "rand=C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-tools\\ui\\miri\\x86_64-pc-windows-msvc\\debug\\deps\\librand-01b5952caee7083c.rlib" "--extern" "rand=C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-tools\\ui\\miri\\x86_64-pc-windows-msvc\\debug\\deps\\librand-01b5952caee7083c.rmeta" "--extern" "tempfile=C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-tools\\ui\\miri\\x86_64-pc-windows-msvc\\debug\\deps\\libtempfile-a86f06dcd7fa18db.rlib" "--extern" "tempfile=C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-tools\\ui\\miri\\x86_64-pc-windows-msvc\\debug\\deps\\libtempfile-a86f06dcd7fa18db.rmeta" "--extern" "page_size=C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-tools\\ui\\miri\\x86_64-pc-windows-msvc\\debug\\deps\\libpage_size-0ba767a1728111db.rlib" "--extern" "page_size=C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-tools\\ui\\miri\\x86_64-pc-windows-msvc\\debug\\deps\\libpage_size-0ba767a1728111db.rmeta" "--extern" "tokio=C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-tools\\ui\\miri\\x86_64-pc-windows-msvc\\debug\\deps\\libtokio-07db6c3a892515e9.rlib" "--extern" "tokio=C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-tools\\ui\\miri\\x86_64-pc-windows-msvc\\debug\\deps\\libtokio-07db6c3a892515e9.rmeta" "--extern" "windows_sys=C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-tools\\ui\\miri\\x86_64-pc-windows-msvc\\debug\\deps\\libwindows_sys-07455d154a735a27.rlib" "--extern" "windows_sys=C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-tools\\ui\\miri\\x86_64-pc-windows-msvc\\debug\\deps\\libwindows_sys-07455d154a735a27.rmeta" "-L" "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-tools\\ui\\miri\\x86_64-pc-windows-msvc\\debug\\deps" "-L" "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-tools\\ui\\miri\\debug\\deps" "--out-dir" "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-tools\\ui\\tests\\panic" "tests/panic\\mir-validation.rs" "--edition" "2021"
##[error]no message
##[error]no message
##[error]remove this line and possibly later ones by blessing the test
error: panic test got exit code: 0x80000003, but expected 101
error: actual output differed from expected
error: actual output differed from expected
Execute `./miri test --bless` to update `tests/panic\mir-validation.stderr` to the actual output
--- tests/panic\mir-validation.stderr
 thread 'rustc' panicked at compiler/rustc_const_eval/src/transform/validate.rs:LL:CC:
 thread 'rustc' panicked at compiler/rustc_const_eval/src/transform/validate.rs:LL:CC:
 broken MIR in Item(DefId) (after phase change to runtime-optimized) at bb0[1]:
 #0 [optimized_mir] optimizing MIR for `main`
 end of query stack
-
-
-Miri caused an ICE during evaluation. Here's the interpreter backtrace at the time of the panic:
-   |
-   |
-LL |     extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
-   |
-



full stderr:
thread 'rustc' panicked at compiler\rustc_const_eval\src\transform\validate.rs:89:25:
broken MIR in Item(DefId(0:4 ~ mir_validation[210f]::main)) (after phase change to runtime-optimized) at bb0[1]:
(*(_2.0: *mut i32)), has deref at the wrong place
stack backtrace:
   0: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: RINvMs5_NtCsbcnNDZZauqq_15rustc_interface7queriesNtNtB8_9interface8Compiler5enterNCNCNvCsjJQGVm3AGnx_17rustc_driver_impl12run_compiler0s_0INtNtCsamAzUbfQ1XA_4core6result6ResultINtNtB2h_6option6OptionNtB6_6LinkerENtCsjeMTOMaTCg7_10rustc_span15ErrorGuarante

error: the compiler unexpectedly panicked. this is a bug.

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly
---
Error: 
   0: ui tests in tests/panic for x86_64-pc-windows-msvc failed
   1: tests failed

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
error: test failed, to rerun pass `--test ui`
Caused by:
  process didn't exit successfully: `C:\a\rust\rust\build\x86_64-pc-windows-msvc\stage1-tools\x86_64-pc-windows-msvc\release\deps\ui-e6590fae83a7553a.exe` (exit code: 1)
Build completed unsuccessfully in 0:07:53
  local time: Sat, Apr 20, 2024  8:31:35 PM

@bors
Copy link
Collaborator

bors commented Apr 20, 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 Apr 20, 2024
@jieyouxu
Copy link
Member Author

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 20, 2024
@jieyouxu jieyouxu mentioned this pull request Apr 20, 2024
@jieyouxu jieyouxu closed this Apr 20, 2024
@jieyouxu jieyouxu deleted the rollup-i3bbeh4 branch April 20, 2024 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.