Commit Graph

265778 Commits

Author SHA1 Message Date
Ding Xiang Fei
f93df1f7dc
rescope temp lifetime in let-chain into IfElse
apply rules by span edition
2024-09-11 04:10:00 +08:00
Paul Menage
3810386bbe Add -Z small-data-threshold
This flag allows specifying the threshold size above which LLVM should
not consider placing small objects in a .sdata or .sbss section.

Support is indicated in the target options via the
small-data-threshold-support target option, which can indicate either an
LLVM argument or an LLVM module flag.  To avoid duplicate specifications
in a large number of targets, the default value for support is
DefaultForArch, which is translated to a concrete value according to the
target's architecture.
2024-09-10 12:19:16 -07:00
onur-ozkan
0a7f9e2134 skip formatting if no files have been modified
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-10 20:34:56 +03:00
onur-ozkan
35ce85e0fd handle GitConfig for tools/compiletest
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-10 20:34:43 +03:00
onur-ozkan
b5d69ba9fb add change entry for "tools" and "library" profile update
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-10 19:07:50 +03:00
onur-ozkan
ed89d9b7a2 force ci-llvm by default on library and tools profiles
It's very rare for developers to need to modify LLVM,
so "if-unchanged" isn't a good default since it fetches
the LLVM submodule to track changes.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-10 19:07:18 +03:00
Matthias Krüger
a42d67e6cc
Rollup merge of #130185 - RalfJung:abi-compat-repr-c-wrappers, r=compiler-errors
abi/compatibility test: remove tests inside repr(C) wrappers

When I wrote the test I assumed we'd guarantee ABI compatibility to be "structural" wrt `repr(C)` types, i.e. if two `repr(C)` types have all their fields be pairwise ABI-compatible then the types are ABI-compatible. That got removed from the ABI compatibility docs before they landed, though, so let's also remove it from this test.
2024-09-10 17:35:16 +02:00
Matthias Krüger
98222a524d
Rollup merge of #130184 - Zalathar:counters, r=compiler-errors
coverage: Clean up terminology in counter creation

Some of the terminology in this module is confusing, or has drifted out of sync with other parts of the coverage code.

This PR therefore renames some variables and methods, and adjusts comments and debug logging statements, to make things clearer and more consistent.

No functional changes, other than some small tweaks to debug logging.
2024-09-10 17:35:15 +02:00
Matthias Krüger
accd77ebd6
Rollup merge of #130175 - nnethercote:rustc_mir_transform-cleanups-3, r=saethlin
`rustc_mir_transform` cleanups 3

More cleanups in the style of https://github.com/rust-lang/rust/pull/129929.

r? `@saethlin`
2024-09-10 17:35:14 +02:00
Matthias Krüger
a204f87de8
Rollup merge of #130173 - fmease:rustdoc-regression-tests, r=notriddle
rustdoc: add two regression tests

They were basically copy/pasted from `tests/ui/` to `tests/rustdoc-ui/`.
Not sure if it's worth adding these, I can just close these issues as is if you want.

This brings the number of https://github.com/rust-lang/rust/labels/T-rustdoc + https://github.com/rust-lang/rust/labels/E-needs-test from 3 down to 1.
The remaining one – #103004 — is a nasty one to retroactively find a proper(!) test for.

Fixes #98250.
Fixes #107872.

r? rustdoc
2024-09-10 17:35:14 +02:00
Matthias Krüger
34c935baf3
Rollup merge of #130143 - RalfJung:miri-test-libstd, r=compiler-errors
miri-test-libstd: add missing BOOTSTRAP_ARGS

Note sure if BOOTSTRAP_ARGS will make any difference here, but all the other x.py invocations have it and I did not *deliberately* leave it away when I added these, so... probably best to add them?

Also don't unnecessarily set BOOTSTRAP_SKIP_TARGET_SANITY while we are at it.
2024-09-10 17:35:13 +02:00
Florian Schmiderer
713828d4f4 Add test for S_OBJNAME and update test for LF_BUILDINFO cl and cmd for
pdb files.
2024-09-10 17:23:05 +02:00
Michael Goulet
5cf117ed05 Don't call closure_by_move_body_def_id on FnOnce async closures in MIR validation 2024-09-10 10:55:05 -04:00
bors
33855f80d4 Auto merge of #130025 - Urgau:missing_docs-expect, r=petrochenkov
Also emit `missing_docs` lint with `--test` to fulfil expectations

This PR removes the "test harness" suppression of the `missing_docs` lint to be able to fulfil `#[expect]` (expectations) as it is now "relevant".

I think the goal was to maybe avoid false-positive while linting on public items under `#[cfg(test)]` but with effective visibility we should no longer have any false-positive.

Another possibility would be to query the lint level and only emit the lint if it's of expect level, but that is even more hacky.

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

try-job: x86_64-gnu-aux
2024-09-10 14:54:09 +00:00
lcnr
7a57a74bf5 generalize: track relevant info in cache key 2024-09-10 15:21:57 +02:00
Folkert de Vries
6ca5ec7b4e disallow naked_asm! outside of #[naked] functions 2024-09-10 15:19:14 +02:00
Ralf Jung
86075759cc abi/compatibility test: remove tests inside repr(C) wrappers 2024-09-10 13:18:20 +02:00
bors
f827364a95 Auto merge of #129337 - EtomicBomb:rfc, r=notriddle
rustdoc rfc#3662 changes under unstable flags

* All new functionality is under unstable options
* Adds `--merge=shared|none|finalize` flags
* Adds `--parts-out-dir=<crate specific directory>` for `--merge=none`
to write cross-crate info file for a single crate
* Adds `--include-parts-dir=<previously specified directory>` for
`--merge=finalize` to write cross-crate info files
* `tests/rustdoc/` tests for the new flags
2024-09-10 11:15:51 +00:00
Zalathar
10cd5e8386 coverage: Avoid referring to "operands" in counter creation 2024-09-10 21:05:29 +10:00
Zalathar
8be70c7b2c coverage: Avoid referring to out-edges as "branches"
This makes the graph terminology a bit more consistent, and avoids potential
confusion with branch coverage.
2024-09-10 21:05:28 +10:00
Zalathar
96d545a33b coverage: Avoid referring to "coverage spans" in counter creation
The counter-creation code needs to know which BCB nodes require counters, but
isn't interested in why, so treat that as an opaque detail.
2024-09-10 21:00:50 +10:00
Marcondiro
c8d9bd488a Bump unicode printable to version 16.0.0 2024-09-10 11:13:35 +02:00
Marcondiro
bdda4ec2f5 Bump unicode_data to version 16.0.0 2024-09-10 10:50:20 +02:00
Ralf Jung
123757ae07 turn errors that should be impossible due to our static checks into ICEs 2024-09-10 10:27:30 +02:00
Ralf Jung
f76f128dc9 const-eval interning: accpt interior mutable pointers in final value (but keep rejecting mutable references) 2024-09-10 10:26:16 +02:00
Ralf Jung
a888905226 miri: treat non-memory local variables properly for data race detection 2024-09-10 10:25:22 +02:00
bors
26b2b8d162 Auto merge of #130179 - workingjubilee:rollup-l78cv44, r=workingjubilee
Rollup of 11 pull requests

Successful merges:

 - #128316 (Stabilize most of `io_error_more`)
 - #129473 (use  `download-ci-llvm=true` in the default compiler config)
 - #129529 (Add test to build crates used by r-a on stable)
 - #129981 (Remove `serialized_bitcode` from `LtoModuleCodegen`.)
 - #130094 (Inform the solver if evaluation is concurrent)
 - #130132 ([illumos] enable SIGSEGV handler to detect stack overflows)
 - #130146 (bootstrap `naked_asm!` for `compiler-builtins`)
 - #130149 (Helper function for formatting with `LifetimeSuggestionPosition`)
 - #130152 (adapt a test for llvm 20)
 - #130162 (bump download-ci-llvm-stamp)
 - #130164 (move some const fn out of the const_ptr_as_ref feature)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-09-10 07:26:27 +00:00
Zalathar
e96b4e479a coverage: Extract executor::block_on from several async coverage tests
By moving `block_on` to an auxiliary crate, we avoid having to keep a separate
copy of it in every async test.

(This also incorporates some small tweaks to the headers in `await_ready.rs`.)
2024-09-10 16:08:36 +10:00
Zalathar
a21f39522c bootstrap: Print more debug info when find_initial_libdir fails 2024-09-10 16:08:31 +10:00
Scott McMurray
51d0f68b78 Update the MIRI tests 2024-09-09 19:39:43 -07:00
Scott McMurray
24c505070c Fix the examples in cg_clif 2024-09-09 19:39:43 -07:00
Scott McMurray
d2309c2a9d Ban non-array SIMD 2024-09-09 19:39:43 -07:00
Jubilee
9749a9801c
Rollup merge of #130164 - RalfJung:const_ptr_as_ref, r=dtolnay
move some const fn out of the const_ptr_as_ref feature

When a `const fn` is still `#[unstable]`, it should generally use the same feature to track its regular stability and const-stability. Then when that feature moves towards stabilization we can decide whether the const-ness can be stabilized as well, or whether it should be moved into a new feature.

Also, functions like `ptr::as_ref` (which returns an `Option<&mut T>`) require `is_null`, which is tricky and blocked on some design concerns (see #74939). So move those to the is_null feature gate, as they should be stabilized together with `ptr.is_null()`.

Affects #91822, #122034, #75402, https://github.com/rust-lang/rust/issues/74939
2024-09-09 19:20:39 -07:00
Jubilee
ca3f4ae20a
Rollup merge of #130162 - onur-ozkan:bump-ci-llvm-stamp, r=Kobzol
bump download-ci-llvm-stamp

This should trigger the download and extraction of the ci-llvm tarball, which should resolve https://github.com/rust-lang/rust/issues/130144.
2024-09-09 19:20:39 -07:00
Jubilee
a26c809e7a
Rollup merge of #130152 - krasimirgg:nsan, r=nikic
adapt a test for llvm 20

No functional changes intended.

``@rustbot`` label: +llvm-main
r? ``@nikic``
2024-09-09 19:20:38 -07:00
Jubilee
68ae3b27f5
Rollup merge of #130149 - GrigorenkoPV:lifetime-suggestion, r=cjgillot
Helper function for formatting with `LifetimeSuggestionPosition`
2024-09-09 19:20:38 -07:00
Jubilee
57273d82a8
Rollup merge of #130146 - folkertdev:bootstrap-naked-asm, r=Amanieu
bootstrap `naked_asm!` for `compiler-builtins`

tracking issue: https://github.com/rust-lang/rust/issues/90957
parent PR: https://github.com/rust-lang/rust/pull/128651

in this PR, `naked_asm!` is added as an alias for `asm!` with one difference: `options(noreturn)` is always enabled by `naked_asm!`. That makes it future-compatible for when `naked_asm!` starts disallowing `options(noreturn)` later.

The `naked_asm!` macro must be introduced first so that we can upgrade `compiler-builtins` to use it, and can then change the implementation of `naked_asm!` in https://github.com/rust-lang/rust/pull/128651

I've added some usages for `naked_asm!` in the tests, so we can be confident that it works, but I've left upgrading the whole test suite to the parent PR.

r? ``@Amanieu``
2024-09-09 19:20:38 -07:00
Jubilee
468089210c
Rollup merge of #130132 - sunshowers:illumos-sigsegv, r=Noratrieb
[illumos] enable SIGSEGV handler to detect stack overflows

Use the same code as Solaris. I couldn't find any tests regarding this, but I did test a stage0 build against my stack-exhaust-test binary [1]. Before:

```
running with use_stacker = No, new_thread = false, make_large_local = false
zsh: segmentation fault (core dumped)  cargo run
```

After:

```
running with use_stacker = No, new_thread = false, make_large_local = false

thread 'main' has overflowed its stack
fatal runtime error: stack overflow
zsh: IOT instruction (core dumped)  cargo +stage0 run
```

Fixes #128568.

[1] https://github.com/sunshowers/stack-exhaust-test/
2024-09-09 19:20:37 -07:00
Jubilee
2859c24e64
Rollup merge of #130094 - workingjubilee:concurrency-is-real, r=lcnr
Inform the solver if evaluation is concurrent

Parallel compilation of a program can cause unexpected event sequencing. Inform the solver when this is true so it can skip invalid asserts.
2024-09-09 19:20:37 -07:00
Jubilee
88a2c62652
Rollup merge of #129981 - nnethercote:rm-serialize_bitcode, r=antoyo,tmiasko
Remove `serialized_bitcode` from `LtoModuleCodegen`.

It's unused.

r? ``@bjorn3``
2024-09-09 19:20:36 -07:00
Jubilee
a4c61048d8
Rollup merge of #129529 - lqd:stable-new-solver, r=Kobzol
Add test to build crates used by r-a on stable

r? ````````@Kobzol````````

I've opened other PRs for this one to work and they've landed already. I cherry-picked your commit, and added the last remaining pieces we needed I think.
2024-09-09 19:20:36 -07:00
Jubilee
5c91cc5d4c
Rollup merge of #129473 - Urgau:fix-llvm-if-unchanged, r=onur-ozkan
use  `download-ci-llvm=true` in the default compiler config

1ca2708e77 made it so that the `src/llvm-project` submodule has to be checkout for `download-ci-llvm = "if-unchanged"` to know if the submodule has been changed, but that is not required, if the submodule hasn't been checkout it cannot have been modified.

~~This PR restore the previous behavior by only updating the submodule if it has already been checkout.~~

This PR makes `download-ci-llvm = true` check if CI llvm is available and make it the default for the compiler profile, as to prevent unnecessarily checking out `src/llvm-project` with `"if-unchanged"`.

r? `````@onur-ozkan`````
2024-09-09 19:20:35 -07:00
Jubilee
1392965e05
Rollup merge of #128316 - GrigorenkoPV:io_error_a_bit_more, r=dtolnay
Stabilize most of `io_error_more`

Sadly, venting my frustration with t-libs-api is not a constructive way to solve problems and get things done, so I will try to stick to stuff that actually matters here.

- Tracking issue for this feature was opened 3 years ago: #86442
- FCP to stabilize it was completed 19(!!) months ago: https://github.com/rust-lang/rust/issues/86442#issuecomment-1368082102
- A PR with stabilization was similarly open for 19 months: #106375, but nothing ever came out of it. Presumably (it is hard to judge given the lack of communication) because a few of the variants still had some concerns voiced about them, even after the FCP.

So, to highlight a common sentiment:

> Maybe uncontroversial variants can be stabilised first and other variants (such as `QuotaExceeded` or `FilesystemLoop`) later? [^1]

[^1]: https://github.com/rust-lang/rust/issues/106375#issuecomment-1435762236

> I would like to voice support stabilization of the uncontroversial variants. This would get those variants to stable and focus the discussion around the more controversial ones. I don't see any particular reason that all of these must be stabilized at the same time. [...] [^2]

[^2]: https://github.com/rust-lang/rust/pull/106375#issuecomment-1742661555

> Maybe some less-controversial subset could be stabilized sooner? What’s blocking this issue from making progress? [^3]

[^3]: https://github.com/rust-lang/rust/issues/86442#issuecomment-1691187483 (got 30 upvotes btw) (and no response)

So this is exactly what this PR does. It stabilizes the non-controversial variants now, leaving just a few of them behind.

Namely, this PR stabilizes:

- `HostUnreachable`
- `NetworkUnreachable`
- `NetworkDown`
- `NotADirectory`
- `IsADirectory`
- `DirectoryNotEmpty`
- `ReadOnlyFilesystem`
- `StaleNetworkFileHandle`
- `StorageFull`
- `NotSeekable`
- `FileTooLarge`
- `ResourceBusy`
- `ExecutableFileBusy`
- `Deadlock`
- `TooManyLinks`
- `ArgumentListTooLong`
- `Unsupported`

This PR does not stabilize:
- `FilesystemLoop`
- `FilesystemQuotaExceeded`
- `CrossesDevices`
- `InvalidFilename`

Hopefully, this will allow us to move forward with this highly and long awaited addition to std, both allowing to still polish the less clear parts of it and not leading to stagnation.

r? joshtriplett
because they seem to be listed as a part of t-libs-api and were one of the most responsive persons previously
2024-09-09 19:20:34 -07:00
bors
304b7f801b Auto merge of #129778 - RalfJung:interp-lossy-typed-copy, r=saethlin
interpret: make typed copies lossy wrt provenance and padding

A "typed copy" in Rust can be a lossy process: when copying at type `usize` (or any other non-pointer type), if the original memory had any provenance, that provenance is lost. When copying at pointer type, if the original memory had partial provenance (i.e., not the same provenance for all bytes), that provenance is lost. When copying any type with padding, the contents of padding are lost.

This PR equips our validity-checking pass with the ability to reset provenance and padding according to those rules. Can be reviewed commit-by-commit. The first three commits are just preparation without any functional change.

Fixes https://github.com/rust-lang/miri/issues/845
Fixes https://github.com/rust-lang/miri/issues/2182
2024-09-10 02:18:51 +00:00
bors
712463de61 Auto merge of #129789 - notriddle:notriddle/inline-stmt-local, r=GuillaumeGomez
rustdoc: use strategic boxing to shrink `clean::Item`

* `inline_stmt_id` is never a cross-crate DefId, so save space by not storing it.
* Instead of two inner boxes for `Item`, use one.
2024-09-09 23:16:56 +00:00
Nicholas Nethercote
8949b443d5 Make check_live_drops into a MirLint.
It's a thin wrapper around `check_live_drops`, but it's enough to fix
the FIXME comment.
2024-09-10 09:11:17 +10:00
Nicholas Nethercote
7023402691 Remove references from some structs.
In all cases the struct can own the relevant thing instead of having a
reference to it. This makes the code simpler, and in some cases removes
a struct lifetime.
2024-09-10 09:11:17 +10:00
Nicholas Nethercote
d1c55a305e Use IndexVec::from_raw to construct a const IndexVec. 2024-09-10 09:11:17 +10:00
Nicholas Nethercote
51e1c3958d Add a useful comment about PromoteTemps.
This was non-obvious to me.
2024-09-10 08:54:45 +10:00
Nicholas Nethercote
e26692d559 Add a useful comment. 2024-09-10 08:54:22 +10:00