Commit graph

289084 commits

Author SHA1 Message Date
David Tolnay
c35914383a
Consistent trait bounds for ExtractIf Debug impls 2025-05-05 19:46:46 -07:00
Zalathar
c53a76743c coverage-dump: Dump filenames instead of global file IDs (and bless) 2025-05-06 11:58:58 +10:00
Zalathar
041b2b2c98 coverage-dump: Make filenames available to covfun record dumping
Actually printing the filenames is deferred to a subsequent commit that will
simultaneously bless all affected tests.
2025-05-06 11:58:58 +10:00
Zalathar
f1b8cd433f coverage-dump: Include filenames hash in covfun line data 2025-05-06 11:58:58 +10:00
Zalathar
bc3f0e326a coverage-dump: Extract a common parser method for maybe-compressed bytes 2025-05-06 11:58:58 +10:00
Zalathar
89319f2e12 coverage-dump: Extract some common code to an llvm_utils submodule 2025-05-06 11:58:50 +10:00
Zalathar
a3d5562fcf bootstrap: Add check/test/run steps for src/tools/coverage-dump
This also causes the coverage-dump unit tests to run in CI and `./x test` by
default.
2025-05-06 11:48:37 +10:00
bors
7295b08a17 Auto merge of #131160 - ismailarilik:handle-potential-query-instability-lint-for-rustc-middle, r=oli-obk
Handle `rustc_middle` cases of `rustc::potential_query_instability` lint

This PR removes `#![allow(rustc::potential_query_instability)]` line from [`compiler/rustc_middle/src/lib.rs`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_middle/src/lib.rs#L29) and converts `FxHash{Map,Set}` types into `FxIndex{Map,Set}` to suppress lint errors.

A somewhat tracking issue: https://github.com/rust-lang/rust/issues/84447

r? `@compiler-errors`
2025-05-06 01:36:23 +00:00
bors
4a0969e06d Auto merge of #140682 - GuillaumeGomez:rollup-6xjf6zn, r=GuillaumeGomez
Rollup of 11 pull requests

Successful merges:

 - #140080 (mir-opt: Use one MirPatch in MatchBranchSimplification)
 - #140115 (mir-opt: execute MatchBranchSimplification after GVN)
 - #140357 (bypass linker configuration and cross target check on `x check`)
 - #140374 (Resolve instance for SymFn in global/naked asm)
 - #140559 (Removing rustc_type_ir in the rustc_infer codebase)
 - #140605 (`fn check_opaque_type_parameter_valid` defer error)
 - #140636 (implement `PanicTracker` to track `t` panics)
 - #140661 (Make `-Zfixed-x18` into a target modifier)
 - #140670 (calculate step duration in a panic-safe way)
 - #140672 (Deeply normalize in the new solver in WF)
 - #140676 (Update books)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-05 22:24:10 +00:00
Eric Huss
292aea50d8 Update mdbook to 0.4.49
This is a routine update to pull in some fixes and updates.

Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0449
2025-05-05 15:13:40 -07:00
Guillaume Gomez
2a882f75b4
Rollup merge of #140676 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/reference

9 commits in 3bf3402aea982b876eb56c87da17b0685c6461d5..387392674d74656f7cb437c05a96f0c52ea8e601
2025-05-03 21:29:09 UTC to 2025-04-22 15:25:03 UTC

- Document `let_chains` again (rust-lang/reference#1740)
- Add: orphan rule rationale. (rust-lang/reference#1755)
- Remove apologies about the Reference (rust-lang/reference#1792)
- Clean up some inline assembly examples (rust-lang/reference#1804)
- Remove StructExprTuple and StructExprUnit (rust-lang/reference#1803)
- Improve documentation of struct expressions (rust-lang/reference#1799)
- Clarify interaction of asm-goto with IBT (rust-lang/reference#1790)
- naked functions (rust-lang/reference#1689)
- Relabel grammarRailroad-Button (rust-lang/reference#1798)

## rust-lang/rust-by-example

3 commits in 0d7964d5b22cf920237ef1282d869564b4883b88..8a8918c698534547fa8a1a693cb3e7277f0bfb2f
2025-04-30 12:20:49 UTC to 2025-04-22 17:42:30 UTC

-   The example is not meant to be compiled. Changed the code block ann… (rust-lang/rust-by-example#1926)
- Non-tail recursive call note in testcase_linked_list.md (rust-lang/rust-by-example#1924)
- docs: mark illustrative 'static lifetime example with `ignore` (rust-lang/rust-by-example#1923)
2025-05-05 21:32:36 +02:00
Guillaume Gomez
bdbf1c631a
Rollup merge of #140672 - compiler-errors:deeply-normalize, r=lcnr
Deeply normalize in the new solver in WF

We need to deeply normalize types we check for well-formedness, since we only collect implied bounds from normalized signature types.

Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/194

r? lcnr
2025-05-05 21:32:35 +02:00
Guillaume Gomez
5822dd6247
Rollup merge of #140670 - onur-ozkan:129959, r=Kobzol
calculate step duration in a panic-safe way

obvious/self-explanatory change.

Fixes #129959
2025-05-05 21:32:35 +02:00
Guillaume Gomez
0d7067d7b2
Rollup merge of #140661 - Darksonn:fixedx18-tm, r=wesleywiser
Make `-Zfixed-x18` into a target modifier

As part of #136966, the `-Zfixed-x18` flag should be turned into a target modifier. This is a blocker to stabilization of the flag. The flag was originally added in #124655 and the MCP for its addition is [MCP#748](https://github.com/rust-lang/compiler-team/issues/748).

On some aarch64 targets, the x18 register is used as a temporary caller-saved register by default. When the `-Zfixed-x18` flag is passed, this is turned off so that the compiler doesn't use the x18 register. This allows end-users to use the x18 register for other purposes. For example, by accessing it with inline asm you can use the register as a very efficient thread-local variable. Another common use-case is to store the stack pointer needed by the shadow-call-stack sanitizer. There are also some aarch64 targets where not using x18 is the default – in those cases the flag is a no-op.

Note that this flag does not *on its own* cause an ABI mismatch. What actually causes an ABI mismatch is when you have different compilation units that *disagree* on what it should be used for. But having a CU that uses it and another CU that doesn't normally isn't enough to trigger an ABI problem. However, we still consider the flag to be a target modifier in all cases, since it is assumed that you are passing the flag because you intend to assign some other meaning to the register. Rejecting all flag mismatches even if not all are unsound is consistent with [RFC#3716](https://rust-lang.github.io/rfcs/3716-target-modifiers.html). See the headings "not all mismatches are unsound" and "cases that are not caught" for additional discussion of this.

On aarch64 targets where `-Zfixed-x18` is not a no-op, it is an error to pass `-Zsanitizer=shadow-call-stack` without also passing `-Zfixed-x18`.
2025-05-05 21:32:34 +02:00
Guillaume Gomez
6cee5bf556
Rollup merge of #140636 - onur-ozkan:panic-tracker-for-t-macro, r=Kobzol
implement `PanicTracker` to track `t` panics

Trying to understand panics triggered by `t` macro is very exhausting (especially on CI failures) because it doesn't provide any information about where the macro was originally invoked. This change adds that missing information when an inner call inside the `t` macro panics.

Resolves #137557
2025-05-05 21:32:34 +02:00
Guillaume Gomez
1c801a385c
Rollup merge of #140605 - lcnr:defer-opaque-type-error, r=compiler-errors
`fn check_opaque_type_parameter_valid` defer error

Will be used in #139587 to silence opaque type errors if there are other borrowck failures. I think it can be merged separately.

r? `@compiler-errors`
2025-05-05 21:32:33 +02:00
Guillaume Gomez
224e3ca096
Rollup merge of #140559 - rperier:type-ir-to-type-middle, r=compiler-errors
Removing rustc_type_ir in the rustc_infer codebase

cc #138449

This is a second refactoring of rustc_type_ir to use rustc_middle instead, this time that's for rustc_infer
2025-05-05 21:32:32 +02:00
Guillaume Gomez
1e90557ae8
Rollup merge of #140374 - compiler-errors:global_asm-bug, r=lcnr
Resolve instance for SymFn in global/naked asm

`Instance::expect_resolve` ensures that we're actually going from trait item -> impl item.

Fixes #140373
2025-05-05 21:32:32 +02:00
Guillaume Gomez
246acdbb95
Rollup merge of #140357 - onur-ozkan:133840, r=clubby789
bypass linker configuration and cross target check on `x check`

I was going to handle this using the untracked env approach, but I realized it somehow doesn't regress https://github.com/rust-lang/rust/issues/130108 anymore...

Anyway, if it works, it works. 😄 No need to dig deeper but my guess is we moved some cache-invalidating env from these functions to others.

Fixes https://github.com/rust-lang/rust/issues/133840

try-job: aarch64-apple
2025-05-05 21:32:31 +02:00
Guillaume Gomez
ab7623e93c
Rollup merge of #140115 - dianqk:gvn-matchbr, r=oli-obk
mir-opt: execute MatchBranchSimplification after GVN

This can provide more opportunities for MatchBranchSimplification.

Currently, rustc does not optimize the following code into a single statement at mir-opt, and this PR fixes the first case.

```rust
pub fn match1(c: bool, v1: i32, v2: i32) -> i32 {
    if c { v1 - v2 } else { v1 - v2 }
}

pub fn match2(c: bool, v1: i32) -> i32 {
    if c { v1 - 1 } else { v1 - 1 }
}
```

https://rust.godbolt.org/z/Y8xPMjrfM

r? mir-opt
2025-05-05 21:32:30 +02:00
Guillaume Gomez
677a5aca7f
Rollup merge of #140080 - dianqk:one-mirpatch, r=oli-obk
mir-opt: Use one MirPatch in MatchBranchSimplification
2025-05-05 21:32:30 +02:00
bors
2e6882ac5b Auto merge of #140664 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2025-05-05 19:14:42 +00:00
Skgland
fb8784585e
fix tidy and bless test 2025-05-05 21:09:31 +02:00
Michael Goulet
c0dfa44c48 Be a bit more relaxed about not yet constrained infer vars in closure upvar analysis 2025-05-05 19:06:45 +00:00
John Kåre Alsaker
e1e8857d54 Add some comments about thread local indices 2025-05-05 21:01:43 +02:00
John Kåre Alsaker
aeab2819f6 Tweak index chunk allocation 2025-05-05 20:50:32 +02:00
Skgland
7fc84ac964
expand comment 2025-05-05 20:40:44 +02:00
Urgau
6a7996e303 Take into-account -Zremap-path-scope when embedding filenames 2025-05-05 19:45:34 +02:00
rustbot
872387195d Update books 2025-05-05 19:01:06 +02:00
smrobtzz
57941afb23 Apply suggestions from code review
Co-authored-by: Jubilee <workingjubilee@gmail.com>
2025-05-05 12:34:09 -04:00
Sam Roberts
fa6d0d1ba2 Use more accurate ELF flags on MIPS 2025-05-05 12:23:41 -04:00
Michael Goulet
12d3021ef0 Deeply normalize in the new solver in WF 2025-05-05 15:52:38 +00:00
Guillaume Gomez
27e39c3ac6 Created tests/rustdoc/async subfolder to limit number of files at the top level 2025-05-05 17:49:12 +02:00
Guillaume Gomez
e14e19a67d Created tests/rustdoc/extern subfolder to limit number of files at the top level 2025-05-05 17:49:12 +02:00
Guillaume Gomez
e245c3bc6b Move primitive rustdoc tests into the primitive sub folder 2025-05-05 17:47:18 +02:00
Guillaume Gomez
4b6bc73507 Created tests/rustdoc/enum subfolder to limit number of files at the top level 2025-05-05 17:47:18 +02:00
Guillaume Gomez
fa2b9227a1 Created tests/rustdoc/assoc subfolder to limit number of files at the top level 2025-05-05 17:47:18 +02:00
Guillaume Gomez
b84f4cc39e Created tests/rustdoc/impl subfolder to limit number of files at the top level 2025-05-05 17:47:18 +02:00
Guillaume Gomez
be71d8b24f Created tests/rustdoc/doc-cfg subfolder to limit number of files at the top level 2025-05-05 17:47:18 +02:00
Guillaume Gomez
d1f4a0bcb6 Created tests/rustdoc/macro subfolder to limit number of files at the top level 2025-05-05 17:47:18 +02:00
Guillaume Gomez
eee6c97535 Created tests/rustdoc/private subfolder to limit number of files at the top level 2025-05-05 17:47:18 +02:00
Guillaume Gomez
a00b39961a Move intra-doc tests into the expected subfolder 2025-05-05 17:47:18 +02:00
Guillaume Gomez
9db7de5915 Created tests/rustdoc/jump-to-def subfolder to limit number of files at the top level 2025-05-05 17:47:18 +02:00
Guillaume Gomez
ff971d001d Created tests/rustdoc/auto subfolder to limit number of files at the top level 2025-05-05 17:47:18 +02:00
Guillaume Gomez
b374996ab8 Created tests/rustdoc/anchors subfolder to limit number of files at the top level 2025-05-05 17:47:18 +02:00
Guillaume Gomez
099f730dcf Created tests/rustdoc/source-code-pages subfolder to limit number of files at the top level 2025-05-05 17:47:17 +02:00
Guillaume Gomez
b796179f98 Created tests/rustdoc/reexports subfolder to limit number of files at the top level 2025-05-05 17:47:17 +02:00
Vladimir Krivopalov
cdf4143eb8 Implement VecDeque::truncate_front()
Tracking issue: #140667

Signed-off-by: Vladimir Krivopalov <vladimir.krivopalov@gmail.com>
2025-05-05 11:13:26 -04:00
Deadbeef
662182637e Implement RFC 3503: frontmatters
Supercedes #137193
2025-05-05 23:10:08 +08:00
onur-ozkan
29f9aaf503 calculate step duration in a panic-safe way
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-05 15:02:46 +00:00