Commit graph

272174 commits

Author SHA1 Message Date
bors
d10a6823f4 Auto merge of #133588 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`
2024-11-29 19:52:08 +00:00
Orion Gonzalez
ce98bf3d79 simplify how the hir_typeck_pass_to_variadic_function diagnostic is created 2024-11-29 20:49:06 +01:00
Esteban Küber
998ff2f0cd Move the crate-loading test to use diff output 2024-11-29 18:59:24 +00:00
Esteban Küber
e97e15dea5 Use rmake diff output in test 2024-11-29 18:31:37 +00:00
Nikita Popov
fc9f727c7c Fix tests that rely on LLVM IR verification
Pass -Z verify-llvm-ir to tests that rely on it, to make sure they
pass regardless of the value of verify-llvm-ir in config.toml.

Also remove the 109681.rs test, because it is a duplicat of
common-linkage-non-zero-init.rs.
2024-11-29 19:11:34 +01:00
bors
a45391f4dd Auto merge of #133634 - matthiaskrgr:rollup-v7m4j2k, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #131323 (Support `clobber_abi` in AVR inline assembly)
 - #131718 ([rustdoc] Change impl items indent)
 - #133565 (chore: fix 404 status URL)
 - #133575 (Fix typo in RELEASES.md)
 - #133577 (Document s390x machine access via community cloud)
 - #133584 (Update more 2024 tests to remove -Zunstable-options)
 - #133592 (Misc: better instructions for envrc, ignore `/build` instead of `build/`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-11-29 17:06:37 +00:00
lcnr
3465ce5786 fast reject: limit recursion depth 2024-11-29 18:01:21 +01:00
MarcoIeni
5b9a77a09d
CI: split x86_64-mingw job 2024-11-29 16:04:12 +01:00
Matthias Krüger
eabe6db9b1
Rollup merge of #133592 - WaffleLapkin:misc-meowing, r=jieyouxu
Misc: better instructions for envrc, ignore `/build` instead of `build/`

See commits for more information.

r? ``@jieyouxu``
2024-11-29 16:02:24 +01:00
Matthias Krüger
53bc38b3fe
Rollup merge of #133584 - ehuss:more-2024-unstable-options, r=compiler-errors
Update more 2024 tests to remove -Zunstable-options

This removes `-Zunsable-options` from more tests that I missed in https://github.com/rust-lang/rust/pull/133349.
2024-11-29 16:02:23 +01:00
Matthias Krüger
fbad22ea25
Rollup merge of #133577 - uweigand:s390x-doc-cloudaccess, r=jieyouxu
Document s390x machine access via community cloud
2024-11-29 16:02:22 +01:00
Matthias Krüger
271ff44c33
Rollup merge of #133575 - slanterns:typo, r=compiler-errors
Fix typo in RELEASES.md

An additional dot.
2024-11-29 16:02:22 +01:00
Matthias Krüger
11ee1ce973
Rollup merge of #133565 - longxiangqiao:master, r=ehuss
chore: fix 404 status URL
2024-11-29 16:02:21 +01:00
Matthias Krüger
f46ed97009
Rollup merge of #131718 - GuillaumeGomez:impl-items-indent, r=rustdoc
[rustdoc] Change impl items indent

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

| before | after |
|-|-|
| ![image](https://github.com/user-attachments/assets/67679827-6aef-4bdb-93dd-e1a4784566b3) | ![image](https://github.com/user-attachments/assets/8a0e9fbc-794a-4b98-abc6-bbbe178736b1) |

Can be tested [here](https://rustdoc.crud.net/imperio/impl-items-indent/bar/struct.Bar.html).

r? `@notriddle`
2024-11-29 16:02:20 +01:00
Matthias Krüger
6c9e922685
Rollup merge of #131323 - jfrimmel:avr-inline-asm-clobber-abi, r=Amanieu
Support `clobber_abi` in AVR inline assembly

This PR implements the `clobber_abi` part necessary to eventually stabilize the inline assembly for AVR. This is tracked in #93335.
This is heavily inspired by the sibling-PR #131310 for the MSP430. I've explained my reasoning in the first commit message in detail, which is reproduced below for easier reviewing:

This follows the [ABI documentation] of AVR-GCC:

> The [...] call-clobbered general purpose registers (GPRs) are registers that might be destroyed (clobbered) by a function call.
>
> - **R18–R27, R30, R31**
>
>   These GPRs are call clobbered. An ordinary function may use them without restoring the contents. [...]
>
> - **R0, T-Flag**
>
>   The temporary register and the T-flag in SREG are also call-clobbered, but this knowledge is not exposed explicitly to the compiler (R0 is a fixed register).

Therefore this commit lists the aforementioned registers `r18–r27`, `r30` and `r31` as clobbered registers. Since the `r0` register (listed above as well) is not available in inline assembly at all (potentially because the AVR-GCC considers it a fixed register causing the register to never be used in register allocation and LLVM adopting this), there is no need to list it in the clobber list (the `r0`-variant is not even available). A comment was added to ensure, that the `r0` gets added to the clobber-list once the register gets usable in inline ASM.
Since the SREG is normally considered clobbered anyways (unless the user supplies the `preserve_flags`-option), there is no need to explicitly list a bit in this register (which is not possible to list anyways).

Note, that this commit completely ignores the case of interrupts (that are described in the ABI-specification), since every register touched in an ISR need to be saved anyways.

[ABI documentation]: https://gcc.gnu.org/wiki/avr-gcc#Call-Used_Registers

r? ``@Amanieu``

``@rustbot`` label +O-AVR
2024-11-29 16:02:20 +01:00
Zalathar
6fc0fe76e8 coverage: Use a query to identify which counter/expression IDs are used 2024-11-30 00:58:48 +11:00
Zalathar
121a17ccc3 coverage: All counter terms in an unused function are zero
This is currently handled automatically by the fact that codegen doesn't visit
coverage statements in unused functions, but that will no longer be the case
when unused IDs are identified by a separate query instead.
2024-11-30 00:54:53 +11:00
Zalathar
05d95a9841 coverage: Allow niches in counter/expression IDs
There is unlikely to be any practical difference between a counter limit of
2^32 and a counter limit of (2^32 - 256).
2024-11-30 00:54:53 +11:00
Zalathar
58e122fef8 coverage: Hoist and explain the check for coverage_cx 2024-11-30 00:54:53 +11:00
Zalathar
3f65114ffc coverage: Rename CrateCoverageContext to CguCoverageContext
This context is stored in `CodegenCx`, which makes it per-CGU rather than
per-crate. A single crate can have multiple CGUs.
2024-11-30 00:54:53 +11:00
Ralf Jung
6e449e18ad refine mir debuginfo docs 2024-11-29 14:01:53 +01:00
bors
0c4f3a45b8 Auto merge of #133619 - matthiaskrgr:rollup-7ywaheb, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #132782 (improvements on initial sysroot and libdir finding logics)
 - #133466 (Fix typos in pin.rs)
 - #133492 (bootstrap: allow skipping steps with start of path)
 - #133501 (support revealing defined opaque post borrowck)
 - #133530 (Use consistent wording in docs, use is zero instead of is 0)
 - #133538 (Better diagnostic for fn items in variadic functions)
 - #133590 (Rename `-Zparse-only`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-11-29 12:05:41 +00:00
lcnr
de94536553 check local cache even if global is usable
we store overflow errors locally, even if we can otherwise
use the global cache for this goal.
2024-11-29 12:44:01 +01:00
Camille GILLOT
c76f1f0b9b Doc comment custom MIR debuginfo.
and add a test for the constant case
2024-11-29 12:32:55 +01:00
Martin Kröning
27c4c3a978
update link to "C++ Exceptions under the hood" blog
The link was introduced in 0ec321f7b5.
For the old link see https://web.archive.org/web/20170409223244/https://monoinfinito.wordpress.com/series/exception-handling-in-c/.
The blog has migrated from WordPress to Blogger in 2021 and to GitHub pages in 2024.
2024-11-29 11:46:34 +01:00
Matthias Krüger
ce52b7b3d8
Rollup merge of #133590 - nnethercote:rename-parse-only, r=estebank
Rename `-Zparse-only`

It's a misleading name.

r? ````@estebank````
2024-11-29 10:19:00 +01:00
Matthias Krüger
72cf40d9ed
Rollup merge of #133538 - dev-ardi:69232-better-diag, r=compiler-errors
Better diagnostic for fn items in variadic functions

closes #69232
2024-11-29 10:18:59 +01:00
Matthias Krüger
8ca5a907a5
Rollup merge of #133530 - timvisee:master, r=jhpratt
Use consistent wording in docs, use is zero instead of is 0

In documentation, wording of _"`rhs` is zero"_ and _"`rhs` is 0"_ is intermixed. This is especially visible [here](https://doc.rust-lang.org/std/primitive.usize.html#method.div_ceil).

This changes all occurrences to _"`rhs` is zero"_ for better readability.
2024-11-29 10:18:58 +01:00
Matthias Krüger
6863327ecc
Rollup merge of #133501 - lcnr:post-borrowck-analysis, r=compiler-errors
support revealing defined opaque post borrowck

By adding a new `TypingMode::PostBorrowckAnalysis`. Currently only supported with the new solver and I didn't look into the way we replace `ReErased`. ``@compiler-errors`` mentioned that always using existentials may be unsound.

r? ``@compiler-errors``
2024-11-29 10:18:57 +01:00
Matthias Krüger
95560d6fe7
Rollup merge of #133492 - MarcoIeni:bootstrap-path-check, r=onur-ozkan
bootstrap: allow skipping steps with start of path
2024-11-29 10:18:57 +01:00
Matthias Krüger
370fc13298
Rollup merge of #133466 - aksh1618:patch-1, r=thomcc
Fix typos in pin.rs
2024-11-29 10:18:56 +01:00
Matthias Krüger
45fd6b4d99
Rollup merge of #132782 - onur-ozkan:cleanup, r=jieyouxu
improvements on initial sysroot and libdir finding logics

Stabilized initial sysroot and libdir path resolution logic to work without dry-run conditions and utilized initial sysroot more broadly.
2024-11-29 10:18:55 +01:00
bors
5bbbc0938c Auto merge of #133431 - nnethercote:rm-HybridBitSet, r=Mark-Simulacrum
Remove `HybridBitSet`

`HybridBitSet` was introduced under the name `HybridIdxSetBuf` way back in #53383 where it was a big win for NLL borrow checker performance. In #93984 the more flexible `ChunkedBitSet` was added. Uses of `HybridBitSet` have gradually disappeared (e.g. #116152) and there are now few enough that they can be replaced with `BitSet` or `ChunkedBitSet`, and `HybridBitSet` can be removed, cutting more than 700 lines of code.

r? `@Mark-Simulacrum`
2024-11-29 09:03:50 +00:00
Nicholas Nethercote
d626f6a2f4 Remove last vestiges of HybridBitSet.
This is in a test where the arrangement of backticks matters, but the
exact words do not.
2024-11-29 17:23:34 +11:00
Nicholas Nethercote
4846c1922d Remove HybridBitSet.
It's no longer used.
2024-11-29 17:23:34 +11:00
Nicholas Nethercote
b7ff2aedd9 Stop using HybridBitSet in SparseBitMatrix.
Use `ChunkedBitSet` instead.
2024-11-29 17:23:34 +11:00
Nicholas Nethercote
688f28d670 Stop using HybridBitSet in clippy.
The compiler uses `BitSet<Local>`, because the number of locals doesn't
get that high, so clippy should do likewise.
2024-11-29 17:23:34 +11:00
Nicholas Nethercote
0df6a018e1 Stop using HybridBitSet in dataflow diffs.
As part of the larger goal of reducing `HybridBitSet` use in general.
This code is for debugging only and isn't performance sensitive, so
`ChunkedBitSet` should be fine.
2024-11-29 17:23:34 +11:00
Nicholas Nethercote
346929cb80 Remove unused HybridBitSet methods from BitSetExt. 2024-11-29 17:23:34 +11:00
Nicholas Nethercote
ded4dfde19 Speed up ChunkedBitIter
The current implementation is slow because it does an operation for
every bit in the set, even zero bits. So if you have a large bitset with
many zero bits (which is common) it's very slow.

This commit improves the iterator to skip over `Zeros` chunks in a
single step, and uses the fast `BitIter` for `Mixed` chunks. It also
removes the existing `fold` implementation, which was only there because
the old iterator was slow.
2024-11-29 17:23:32 +11:00
Nicholas Nethercote
ff78002566 Tiny ChunkedBitSet improvements.
- Fix a typo in a comment.
- Remove unnecessary `Chunk::` qualifiers.
- Rename `ChunkedBitIter::bitset` as `ChunkedBitIter::bit_set`, because
  `bit_set` is the form used everywhere else.
- Avoid some unnecessary local variables.
2024-11-29 17:01:48 +11:00
Nicholas Nethercote
15b24c46b4 Clarify ChunkSize invariants.
`ChunkedBitSet::is_empty` currently does an unnecessary check. This
commit removes that check and adds clarifying comments and an assertion
that demonstrate why it's unnecessary.
2024-11-29 17:01:48 +11:00
bors
cb2bd2bb06 Auto merge of #133608 - Zalathar:spans-revert, r=jieyouxu
Revert #133418 (Store coverage source regions as `Span`) due to regression #133606

This reverts commit adf9b5fcd1, reversing changes made to af1ca153d4.

Reverting #133418 due to regressions reported at #133606.

r? jieyouxu
2024-11-29 05:38:09 +00:00
Zalathar
9461f4296f Revert "Rollup merge of #133418 - Zalathar:spans, r=jieyouxu"
This reverts commit adf9b5fcd1, reversing
changes made to af1ca153d4.

Reverting due to <https://github.com/rust-lang/rust/issues/133606>.
2024-11-29 14:57:01 +11:00
bors
d6f88291f3 Auto merge of #133409 - RalfJung:target-consistency, r=lcnr
ensure JSON-defined targets are consistent

We have a `check_consistency` check that ensures some invariants which (presumably) the rest of the compiler relies on. However, JSON targets can easily be written in a way that violates those invariants. So this PR applies the same consistency check to JSON targets that we already enforce for built-in targets.

I have converted many of the assertions in that function to new macros that show a nice error instead of a panic; if people are okay with the general approach here, I can do that for the rest of the checks as well.
2024-11-29 01:35:20 +00:00
Orion Gonzalez
1e4817cd33 bless the tests and add a new one 2024-11-29 00:45:14 +01:00
Orion Gonzalez
b36dcc1a38 Improve the diagnostic of fn item in variadic fn 2024-11-29 00:45:14 +01:00
Eric Huss
6005d1c9f7 Update more 2024 tests to remove -Zunstable-options 2024-11-28 14:32:45 -08:00
Sanchith Hegde
d599d5a381
fix: fix codeblocks in PathBuf example 2024-11-29 03:50:26 +05:30
bors
d53f0b1d8e Auto merge of #123244 - Mark-Simulacrum:share-inline-never-generics, r=saethlin
Enable -Zshare-generics for inline(never) functions

This avoids inlining cross-crate generic items when possible that are
already marked inline(never), implying that the author is not intending
for the function to be inlined by callers. As such, having a local copy
may make it easier for LLVM to optimize but mostly just adds to binary
bloat and codegen time. In practice our benchmarks indicate this is
indeed a win for larger compilations, where the extra cost in dynamic
linking to these symbols is diminished compared to the advantages in
fewer copies that need optimizing in each binary.

It might also make sense it expand this with other heuristics (e.g.,
`#[cold]`) in the future, but this seems like a good starting point.

FWIW, I expect that doing cleanup in where we make the decision
what should/shouldn't be shared is also a good idea. Way too
much code needed to be tweaked to check this. But I'm hoping
to leave that for a follow-up PR rather than blocking this on it.
2024-11-28 21:44:34 +00:00