Skip to content

Rollup of 9 pull requests #136030

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

Merged
merged 62 commits into from
Jan 25, 2025
Merged

Rollup of 9 pull requests #136030

merged 62 commits into from
Jan 25, 2025

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Kobzol and others added 30 commits January 5, 2025 18:15
This will cause the CI build to be marked successful even if the build
failed. Instead, use `if: '!cancelled()'` to always save the cache
(except when the job is cancelled), even if the linkcheck failed.

See https://stackoverflow.com/a/58859404 for more.
ci: Remove incorrect use of `continue-on-error`
This documents how to determine which settings are used in CI, since I
see this question come up regularly. We currently don't have a great way
to answer the question, but at least there is something.
* Rename `StringReader -> Lexer`
* Remove deleted `Query` struct
* Update some internal links
ZuseZ4 and others added 10 commits January 24, 2025 16:05
…sDenton

Add `File already exists` error doc to `hard_link` function

## Description
If the link path already exists, the error `AlreadyExists` is returned. This commit adds this error to the docs.

I tested it with the current rust master version, this error was returned when there is already a link for the file is present.
This was the error returned:
```
[harshit:../Desktop/rust_compiler_testing/hard_link (master|…5)] cargo +stage1 run
   Compiling hard_link v0.1.0 (/home/harshit/Desktop/rust_compiler_testing/hard_link)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.12s
     Running `target/debug/hard_link`
Err(Os { code: 17, kind: AlreadyExists, message: "File exists" })
```
This is my first PR on rust, any suggestions on which issue I can take next are most welcome 😄

Fixes rust-lang#130117
Separate Builder methods from tcx

As part of the autodiff upstreaming we noticed, that it would be nice to have various builder methods available without the TypeContext, which prevents the normal CodegenCx to be passed around between threads.
We introduce a SimpleCx which just owns the llvm module and llvm context, to encapsulate them.
The previous CodegenCx now implements deref and forwards access to the llvm module or context to it's SimpleCx sub-struct. This gives us a bit more flexibility, because now we can pass (or construct) the SimpleCx in locations where we don't have enough information to construct a CodegenCx, or are not able to pass it around due to the tcx lifetimes (and it not implementing send/sync).

This also introduces an SBuilder, similar to the SimpleCx. The SBuilder uses a SimpleCx, whereas the existing Builder uses the larger CodegenCx. I will push updates to make  implementations generic (where possible) to be implemented once and work for either of the two. I'll also clean up the leftover code.

`call` is a bit tricky, because it requires a tcx, I probably need to duplicate it after all.

Tracking:

- rust-lang#124509
document order of items in iterator from drain

fixes rust-lang#135710
…davidtwco

Do not assume const params are printed after type params

Fixes rust-lang#135737
Rustc dev guide subtree update

r? ``@ghost``
Add memory layout documentation to generic NonZero<T>

The documentation I've added is based on the same Layout documentation that appears on the other `NonZero*` types. For example see [the Layout docs on `NonZeroI8`](https://doc.rust-lang.org/std/num/type.NonZeroI8.html#layout-1).
Use short type string in E0308 secondary span label

We were previously printing the full type on the "this expression has type" label.

```
error[E0308]: mismatched types
  --> $DIR/secondary-label-with-long-type.rs:8:9
   |
LL |     let () = x;
   |         ^^   - this expression has type `((..., ..., ..., ...), ..., ..., ...)`
   |         |
   |         expected `((..., ..., ..., ...), ..., ..., ...)`, found `()`
   |
   = note:  expected tuple `((..., ..., ..., ...), ..., ..., ...)`
           found unit type `()`
   = note: the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/secondary-label-with-long-type/secondary-label-with-long-type.long-type-3987761834644699448.txt'
   = note: consider using `--verbose` to print the full type name to the console
```

Reported in a comment of rust-lang#135919.
…i-obk

Don't drop types with no drop glue when building drops for tailcalls

this is required as otherwise drops of `&mut` refs count as a usage of a
'two-phase temporary' causing an ICE.

fixes rust-lang#128097

The underlying issue is that the current code generates drops for `&mut` which are later counted as a second use of a two-phase temporary:

`bat t.rs -p`
```rust
#![expect(incomplete_features)]
#![feature(explicit_tail_calls)]

fn f(x: &mut ()) {
    let _y = String::new();
    become f(x);
}

fn main() {}
```
`rustc t.rs -Zdump_mir=f`
```text
error: internal compiler error: compiler/rustc_borrowck/src/borrow_set.rs:298:17: found two uses for 2-phase borrow temporary _4: bb2[1] and bb3[0]
 --> t.rs:6:5
  |
6 |     become f(x);
  |     ^^^^^^^^^^^

thread 'rustc' panicked at compiler/rustc_borrowck/src/borrow_set.rs:298:17:
Box<dyn Any>
stack backtrace:
[REDACTED]

error: aborting due to 1 previous error
```
`bat ./mir_dump/t.f.-------.renumber.0.mir -p -lrust`
```rust
// MIR for `f` 0 renumber

fn f(_1: &mut ()) -> () {
    debug x => _1;
    let mut _0: ();
    let mut _2: !;
    let _3: std::string::String;
    let mut _4: &mut ();
    scope 1 {
        debug _y => _3;
    }

    bb0: {
        StorageLive(_3);
        _3 = String::new() -> [return: bb1, unwind: bb4];
    }

    bb1: {
        FakeRead(ForLet(None), _3);
        StorageLive(_4);
        _4 = &mut (*_1);
        drop(_3) -> [return: bb2, unwind: bb3];
    }

    bb2: {
        StorageDead(_3);
        tailcall f(Spanned { node: move _4, span: t.rs:6:14: 6:15 (#0) });
    }

    bb3 (cleanup): {
        drop(_4) -> [return: bb4, unwind terminate(cleanup)];
    }

    bb4 (cleanup): {
        resume;
    }
}
```

Note how `_4 is moved into the tail call in `bb2` and dropped in `bb3`.

This PR adds a check that the locals we drop need dropping.

r? `@oli-obk` (feel free to reassign, I'm not sure who would be a good reviewer, but thought you might have an idea)
cc `@beepster4096,` since you wrote the original drop implementation.
…ile-indent, r=notriddle

[rustdoc] Fix indent of trait items on mobile

Before:

![Screenshot From 2025-01-24 15-38-53](https://github.com/user-attachments/assets/f7738ff8-92b6-4aca-8a66-2d3618c54572)

After:

![Screenshot From 2025-01-24 15-38-37](https://github.com/user-attachments/assets/0a19dc7e-dddd-4cd5-b087-1915e152d7c1)

Seems like we forgot them when we did rust-lang#131718. Can be tested [here](https://rustdoc.crud.net/imperio/fix-trait-items-mobile-indent/foo/trait.T.html).

r? `@notriddle`
@rustbot rustbot added A-rustc-dev-guide Area: rustc-dev-guide S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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. rollup A PR which is a rollup labels Jan 24, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Jan 24, 2025

📌 Commit d15cf36 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 Jan 24, 2025
@bors
Copy link
Collaborator

bors commented Jan 24, 2025

⌛ Testing commit d15cf36 with merge 814ebca...

@bors
Copy link
Collaborator

bors commented Jan 25, 2025

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 814ebca to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 25, 2025
@bors bors merged commit 814ebca into rust-lang:master Jan 25, 2025
7 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 25, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#135415 Add File already exists error doc to hard_link function 41cdff727935898c4c4e51755453f567ae289feb (link)
#135581 Separate Builder methods from tcx 829a1106da0c5452794920bda654df1e766ab6f5 (link)
#135728 document order of items in iterator from drain d337e49e8e109bc0a0593b77eee6459872aa960f (link)
#135749 Do not assume const params are printed after type params a5f39857716cbc51e398471be83aa8b6e1f99be5 (link)
#135829 Rustc dev guide subtree update 336af6530a4e52d2d43da2aca3e3ec00457d6a8c (link)
#135938 Add memory layout documentation to generic NonZero 27e73c2c2d8f118274db61d9fa31c41eed5c023b (link)
#135949 Use short type string in E0308 secondary span label 01a4d8fc79c6d0c6213875911778d9a7534f43bb (link)
#135976 Don't drop types with no drop glue when building drops for … f66ac1180eadcb3731c4b96769bc2234620cc1f6 (link)
#135998 [rustdoc] Fix indent of trait items on mobile 63ba72a9fdca4ec62d675794f7774a6bde782bb7 (link)

previous master: 1e9b0177da

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 (814ebca): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

Max RSS (memory usage)

Results (primary -1.3%, secondary 3.4%)

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)
3.2% [3.2%, 3.2%] 1
Regressions ❌
(secondary)
3.4% [2.4%, 4.5%] 2
Improvements ✅
(primary)
-2.8% [-3.8%, -1.7%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.3% [-3.8%, 3.2%] 4

Cycles

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

Binary size

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

Bootstrap: 772.08s -> 774.222s (0.28%)
Artifact size: 325.82 MiB -> 325.84 MiB (0.01%)

@matthiaskrgr matthiaskrgr deleted the rollup-cbue0ng branch January 25, 2025 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustc-dev-guide Area: rustc-dev-guide 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-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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.