Commit Graph

265651 Commits

Author SHA1 Message Date
Matthias Krüger
ee8fd33f60
Rollup merge of #130022 - nnethercote:dataflow-borrowck-lifetimes, r=oli-obk
Dataflow/borrowck lifetime cleanups

These commits remove a bunch of unnecessary lifetimes from structs involved in dataflow/borrowck.

r? ``@lqd``
2024-09-09 20:20:17 +02:00
Matthias Krüger
3e3b14845d
Rollup merge of #129929 - nnethercote:rustc_mir_transform-cleanups-2, r=cjgillot
`rustc_mir_transform` cleanups, round 2

More cleanups in the style of #129738.

r? ``@cjgillot``
2024-09-09 20:20:17 +02:00
Ralf Jung
e10224a7c3 move const fn with a null check into const_ptr_is_null gate 2024-09-09 20:09:13 +02:00
onur-ozkan
12998c2e11 handle GitConfig for tools/suggest-tests
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-09 21:03:51 +03:00
Ralf Jung
720bd0dd6c move some const fn out of the const_ptr_as_ref feature 2024-09-09 19:59:16 +02:00
onur-ozkan
667cf22f48 bump download-ci-llvm-stamp
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-09 20:31:58 +03:00
onur-ozkan
9aa823cc67 replace get_closest_merge_base_commit with get_closest_merge_commit
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-09 20:19:29 +03:00
onur-ozkan
dc9c5f251c implement build_helper::git::get_closest_merge_commit
Compare to `get_git_merge_base`, this doesn't require configuring the upstream remote.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-09 20:18:06 +03:00
onur-ozkan
05043a370a add git_merge_commit_email into GitConfig
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-09 20:17:34 +03:00
James C. Wise
99cad123ed
Fix slice::first_mut docs
pointer -> reference
2024-09-09 13:13:45 -04:00
rustbot
8b052eaad1 Update books 2024-09-09 13:00:45 -04:00
bors
d7522d8726 Auto merge of #128939 - bjorn3:windows_cg_clif_component, r=albertlarsan68
Distribute rustc_codegen_cranelift for Windows

With support for raw-dylib recently added to cg_clif, and inline assembly support working on Windows for quite a while now, all blockers for distributing cg_clif on Windows that I mentioned in https://github.com/rust-lang/rust/pull/81746#issuecomment-1774099637 are fixed now.
2024-09-09 16:09:06 +00:00
onur-ozkan
13ea104798 update rust.verbose-tests doc in config.example.toml
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-09 18:56:37 +03:00
okaneco
bc70fa2f22 Stabilize char::MIN 2024-09-09 11:48:12 -04:00
onur-ozkan
19b8f9e17c use verbose flag as a default value for rust.verbose-tests
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-09 18:47:38 +03:00
Ralf Jung
0a70924c21 fix UB in a test
also add an explicit test for the fact that a Option<WidePtr> has padding when it is None
2024-09-09 16:17:34 +02:00
Krasimir Georgiev
383f506227 adapt a test for llvm 20
No functional changes intended.
2024-09-09 13:29:47 +00:00
Urgau
0f9cb070bc Add test about missing docs at crate level 2024-09-09 14:51:39 +02:00
Urgau
a1a8627dd7 Allow missing_docs lint on the generated test harness 2024-09-09 14:51:39 +02:00
Ralf Jung
65c70900ce union padding computation: add fast-path for ZST
Also avoid even tracking empty ranges, and add fast-path for arrays of scalars
2024-09-09 14:46:26 +02:00
Mads Marquart
dd35398545 Pass deployment target when linking with cc on Apple targets
When linking macOS targets with cc, pass the `-mmacosx-version-min=.`
option to specify the desired deployment target. Also, no longer pass
`-m32`/`-m64`, these are redundant since we already pass `-arch`.

When linking with cc on other Apple targets, always pass `-target`.
(We assume for these targets that cc => clang).
2024-09-09 13:57:17 +02:00
Mads Marquart
97df8fb7ec Fix default/minimum deployment target for Aarch64 simulator targets
The minimum that `rustc` encoded did not match the version in Clang, and
that meant that that when linking, we ended up bumping the version.

Specifically, this sets the correct deployment target of the following
simulator and Mac Catalyst targets:
- `aarch64-apple-ios-sim` from 10.0 to 14.0
- `aarch64-apple-tvos-sim` from 10.0 to 14.0
- `aarch64-apple-watchos-sim` from 5.0 to 7.0
- `aarch64-apple-ios-macabi` from 13.1 to 14.0

I have chosen to not document the simulator target versions in the
platform support docs, as it is fundamentally uninteresting; the normal
targets (e.g. `aarch64-apple-ios`, `aarch64-apple-tvos`) still have the
same deployment target as before, and that's what developers should
actually target.
2024-09-09 13:55:14 +02:00
bors
38e3a5771c Auto merge of #130135 - Kobzol:bootstrap-check-linker, r=onur-ozkan
Do not skip linker configuration for `check` builds

This essentially reverts a part of https://github.com/rust-lang/rust/pull/128871, to fix https://github.com/rust-lang/rust/issues/130108. This is mostly a hotfix until we can figure out a better way to both avoid rebuilds and avoid configuring the linker for `x check`.

Skipping linker for check builds was causing unexpected rebuilds.

Fixes: https://github.com/rust-lang/rust/issues/130108
2024-09-09 11:49:07 +00:00
Urgau
843708a32e Add missing #[allow(missing_docs)] on hack functions in alloc 2024-09-09 13:44:09 +02:00
Pavel Grigorenko
db6361184e Helper function for formatting with LifetimeSuggestionPosition 2024-09-09 14:39:04 +03:00
Eduardo Sánchez Muñoz
0b20ffcb63 Remove needless returns detected by clippy in the compiler 2024-09-09 13:32:22 +02:00
Folkert de Vries
02378997ea bootstrap naked_asm! for compiler-builtins
in this commit, `naked_asm!` is 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.
2024-09-09 12:47:40 +02:00
Ralf Jung
62d196feb1 bootstrap/Makefile.in: miri: add missing BOOTSTRAP ARGS
also don't unnecessarily set BOOTSTRAP_SKIP_TARGET_SANITY while we are at it
2024-09-09 12:12:14 +02:00
bors
1f44f0a66f Auto merge of #130133 - workingjubilee:rollup-t5o827k, r=workingjubilee
Rollup of 14 pull requests

Successful merges:

 - #119229 (Update mingw-w64 + GNU toolchain)
 - #128345 (added support for GNU/Hurd on x86_64)
 - #128667 (rustdoc: normalise type/field names)
 - #129876 (Use sysroot crates maximally in `rustc_codegen_gcc`.)
 - #130034 ( Fix enabling wasm-component-ld to match other tools )
 - #130048 (run-make-support: Add llvm-pdbutil)
 - #130068 (Test codegen when setting deployment target)
 - #130070 (Rename variant `AddrOfRegion` of `RegionVariableOrigin` to `BorrowRegion`)
 - #130087 (remove 'const' from 'Option::iter')
 - #130090 (make Result::copied unstably const)
 - #130092 (Fixes typo in wasm32-wasip2 doc comment)
 - #130107 (const: make ptr.is_null() stop execution on ambiguity)
 - #130115 (Remove needless returns detected by clippy in libraries)
 - #130130 (Miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-09-09 09:24:11 +00:00
Folkert de Vries
e186cc6df8 do PolyFnSig -> FnSig conversion later 2024-09-09 11:09:22 +02:00
Jakub Beránek
c33aa863f8
Do not skip linker configuration for check builds
It was causing unexpected rebuilds.
2024-09-09 10:07:22 +02:00
Jubilee
3e01a5da6e
Rollup merge of #130130 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2024-09-09 00:17:52 -07:00
Jubilee
2f1cf6feb0
Rollup merge of #130115 - eduardosm:needless-returns-libs, r=workingjubilee
Remove needless returns detected by clippy in libraries
2024-09-09 00:17:52 -07:00
Jubilee
fad44c424f
Rollup merge of #130107 - RalfJung:const-ptr-is-null, r=oli-obk
const: make ptr.is_null() stop execution on ambiguity

This seems better than saying `false` -- saying `false` is in fact actively unsound if `NonNull` then uses this to permit putting this pointer inside of it, but at runtime it turns out to be null.

Part of https://github.com/rust-lang/rust/issues/74939
Cc ```@rust-lang/wg-const-eval```
2024-09-09 00:17:51 -07:00
Jubilee
a7c5797c90
Rollup merge of #130092 - zslayton:master, r=jieyouxu
Fixes typo in wasm32-wasip2 doc comment
2024-09-09 00:17:51 -07:00
Jubilee
4a26f3b0ba
Rollup merge of #130090 - RalfJung:result-copied, r=Noratrieb
make Result::copied unstably const

The corresponding `Option::copied` is unstably const, so seems reasonable to do the same here.
2024-09-09 00:17:50 -07:00
Jubilee
38520aed18
Rollup merge of #130087 - RalfJung:option-const-iter, r=workingjubilee
remove 'const' from 'Option::iter'

This is kind of pointless to be a `const fn` since you can't do anything with the iterator. It is also the only `const fn iter*` in the entire standard library. It probably got constified when `~const` traits got added everywhere, and then was forgotten to be de-constified when that was undone.

The rest of the const_option feature seems like it can reasonably be stabilized, but this one IMO should not be stabilized, and it's not worth creating a new tracking issue.

Cc https://github.com/rust-lang/rust/issues/67441
2024-09-09 00:17:50 -07:00
Jubilee
09373b997d
Rollup merge of #130070 - gurry:rename-regionkind-addof-to-ref, r=compiler-errors
Rename variant `AddrOfRegion` of `RegionVariableOrigin` to `BorrowRegion`

because "Borrow" is the more idiomatic Rust term than "AddrOf".
2024-09-09 00:17:49 -07:00
Jubilee
fd938c7441
Rollup merge of #130068 - madsmtm:deployment-target-test, r=jieyouxu
Test codegen when setting deployment target

Test our codegen in different scenarios when setting the deployment target. There are many places here where this is still incorrect, these will be fixed in https://github.com/rust-lang/rust/pull/129342, https://github.com/rust-lang/rust/pull/129367 and https://github.com/rust-lang/rust/pull/129369. See https://github.com/rust-lang/rust/issues/129432 for the bigger picture.

Tested locally using:
```console
./x test tests/run-make/apple-deployment-target --target="aarch64-apple-darwin,aarch64-apple-ios,aarch64-apple-ios-macabi,aarch64-apple-ios-sim,aarch64-apple-tvos,aarch64-apple-tvos-sim,aarch64-apple-visionos,aarch64-apple-visionos-sim,aarch64-apple-watchos,aarch64-apple-watchos-sim,arm64_32-apple-watchos,armv7s-apple-ios,i386-apple-ios,x86_64-apple-darwin,x86_64-apple-ios,x86_64-apple-ios-macabi,x86_64-apple-tvos,x86_64-apple-watchos-sim,x86_64h-apple-darwin"
```

The only Apple targets that aren't tested by the above command are:
- `arm64e-apple-darwin`, failed to build, see https://github.com/rust-lang/cc-rs/issues/1205.
- `armv7k-apple-watchos`, failed to link, see https://github.com/rust-lang/rust/issues/130071.
- `arm64e-apple-ios`, failed to link, see https://github.com/rust-lang/rust/issues/130085.
- `i686-apple-darwin`, requires a bit of setup and an older machine, see [the docs](https://doc.rust-lang.org/nightly/rustc/platform-support/i686-apple-darwin.html).
- `i386-apple-ios` requires you to set `IPHONEOS_DEPLOYMENT_TARGET=10.0` for the test helpers to work, will be fixed by https://github.com/rust-lang/cc-rs/issues/1030.

But all of this is as it was before this PR.

Fixes https://github.com/rust-lang/rust/issues/47825, since we now have a test that compiles a `dylib` for `aarch64-apple-ios`.

Split out from https://github.com/rust-lang/rust/pull/129342, see that for a little bit of the review that this has gone through already.

r? petrochenkov

```@rustbot``` label O-apple
2024-09-09 00:17:49 -07:00
Jubilee
97d62ac2e1
Rollup merge of #130048 - nebulark:runmake_llvm_pdbutil, r=jieyouxu
run-make-support: Add llvm-pdbutil

Add llvm-pdbutil to run-make-support, so we can write better unit tests for PDB specific features.

r? ````@jieyouxu````
````@rustbot```` label: +O-windows
2024-09-09 00:17:48 -07:00
Jubilee
c21d31a61a
Rollup merge of #130034 - alexcrichton:fix-some-wasm-component-ld-comments, r=onur-ozkan
Fix enabling wasm-component-ld to match other tools

It was [pointed out recently][comment] that enabling `wasm-component-ld` as a host tool is different from other host tools. This commit refactors the logic to match by deduplicating selection of when to build other tools and then using the same logic for `wasm-component-ld`.

While here I also fixed a typo pointed out in https://github.com/rust-lang/rust/pull/126967#pullrequestreview-2285267534

[comment]: https://github.com/rust-lang/rust/pull/127866#issuecomment-2333434720
2024-09-09 00:17:48 -07:00
Jubilee
15c7d2715a
Rollup merge of #129876 - nnethercote:more-sysroot-rustc_codegen_gcc, r=Mark-Simulacrum
Use sysroot crates maximally in `rustc_codegen_gcc`.

This shrinks `compiler/rustc_codegen_gcc/Cargo.lock` quite a bit. The only remaining dependencies in `compiler/rustc_codegen_gcc/Cargo.lock` are `gccjit`, `lang_tester`, and `boml`, all of which aren't used in any other compiler crates.

The commit also reorders and adds comments to the `extern crate` items so they match those in miri.

r? ```@Mark-Simulacrum```
2024-09-09 00:17:47 -07:00
Jubilee
4cfb1c3154
Rollup merge of #128667 - its-the-shrimp:rustdoc_json_types_rename, r=aDotInTheVoid
rustdoc: normalise type/field names

Updates #100961

- `Import` -> `Use`, to better reflect the terminology of Rust & its syntax
- `TypeBinding` -> `AssocItemConstraint`, to sync up with `clean`
- `FnDecl` -> `FunctionSignature`, because that's what it is
- `Header` -> `FunctionHeader`, because `Header` is a very word that's very heavily loaded with different meanings
- `ItemEnum::AssocType`: `default` -> `type`, because those items appear in `impl` blocks as well, where they're _not_ the "default"
- `ItemEnum::AssocConst`: `default` -> `value`, see the previous point
- `ForeignType` -> `ExternType`, because "foreign" is not the right word there
- boolean fields' names made to consistently be a phrase that can be a yes/no answer, e.g. `async` -> `is_async`

The docs of `ItemEnum::AssocType::type_` & of `ItemEnum::AssocConst::value` are also updated to be up to date with the clarification of the name of the fields
2024-09-09 00:17:47 -07:00
Jubilee
2cce01ee62
Rollup merge of #128345 - sthibaul:hurd-amd64, r=Urgau
added support for GNU/Hurd on x86_64
2024-09-09 00:17:46 -07:00
Jubilee
1ea466bdce
Rollup merge of #119229 - mati865:update-mingw-toolchain, r=jieyouxu,petrochenkov
Update mingw-w64 + GNU toolchain

The list of packaged tools and their versions is available at: https://github.com/niXman/mingw-builds-binaries/releases/tag/14.1.0-rt_v12-rev0

Fixes: https://github.com/rust-lang/rust/issues/112368
2024-09-09 00:17:46 -07:00
Rain
54672ac392 [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 07:00:05 +00:00
bors
263a3aeeb8 Auto merge of #129788 - onur-ozkan:incompatibility-check-for-llvm, r=Kobzol
detect incompatible CI LLVM options more precisely

Previously, the logic here was simply checking whether the option was set in `config.toml`. This approach was not manageable in our CI runners as we set so many options in config.toml. In reality, those values are not incompatible since they are usually the same value used to generate the CI llvm. Now, the new logic compares the configuration values with the values used to generate the CI llvm, so we get more precise results and make the process more manageable.

Fixes #129153
2024-09-09 06:59:43 +00:00
Gurinder Singh
0f8efb3b5c Fix ICE caused by missing span in a region error 2024-09-09 12:27:36 +05:30
Nicholas Nethercote
5c3502772a Remove unnecessary lifetime from StorageConflictVisitor. 2024-09-09 16:44:01 +10:00
Nicholas Nethercote
0b032f8f83 Remove Elaborator.
It's a trivial wrapper around `ElaborateDropsCtxt` that serves no
apparent purpose.
2024-09-09 16:33:29 +10:00