1
Fork 0
Commit graph

277282 commits

Author SHA1 Message Date
bjorn3
8e51a89420 Update tidy 2025-01-05 15:54:55 +00:00
bjorn3
a94e2d513b Merge commit '918acafef6' into sync_cg_clif-2025-01-05 2025-01-05 15:44:46 +00:00
bjorn3
918acafef6 Fix rustc test suite 2025-01-05 15:28:26 +00:00
bjorn3
62d3654327 Rustup to rustc 1.86.0-nightly (1891c2866 2025-01-04) 2025-01-05 15:11:06 +00:00
bjorn3
36376f5572 Sync from rust 1891c28669 2025-01-05 15:00:29 +00:00
okaneco
03c2ac248f Mark slice::reverse unstably const 2025-01-05 08:01:50 -05:00
Zalathar
f50721ebad Explain why the DW_TAG_* constants remain as-is for now 2025-01-05 22:16:49 +11:00
Zalathar
1b62645418 Use constants for DWARF opcodes, instead of FFI calls 2025-01-05 22:16:25 +11:00
Zalathar
e267106104 Use gimli to get the values of DWARF constants needed by codegen
The `gimli` crate is already a dependency of `thorin-dwp`, which is already a
dependency of `rustc_codegen_ssa`.
2025-01-05 22:07:48 +11:00
ranger-ross
6243c0f818
Clarified the documentation on core::iter::from_fn and core::iter::successors 2025-01-05 19:25:24 +09:00
bors
dcfa38fe23 Auto merge of #135109 - rust-lang:cargo_update, r=tgross35
Weekly `cargo update`

Automation to keep dependencies in `Cargo.lock` current.

The following is the output from `cargo update`:

```txt

compiler & tools dependencies:
     Locking 4 packages to latest compatible versions
    Updating bstr v1.11.1 -> v1.11.3
    Updating spdx v0.10.7 -> v0.10.8
    Updating syn v2.0.93 -> v2.0.94
    Updating tempfile v3.14.0 -> v3.15.0
note: pass `--verbose` to see 35 unchanged dependencies behind latest

library dependencies:
     Locking 0 packages to latest compatible versions
note: pass `--verbose` to see 3 unchanged dependencies behind latest

rustbook dependencies:
     Locking 5 packages to latest compatible versions
    Updating bstr v1.11.1 -> v1.11.3
    Updating cc v1.2.6 -> v1.2.7
    Updating syn v2.0.93 -> v2.0.94
    Updating tempfile v3.14.0 -> v3.15.0
    Updating winnow v0.6.20 -> v0.6.22
```
2025-01-05 09:49:57 +00:00
Ralf Jung
2e64b5352b add dedicated type for ABI target feature constraints 2025-01-05 10:46:30 +01:00
Trevor Gross
74d2d4bfa4 Expand the select_unpredictable test for ZSTs
For ZSTs there is no selection that needs to take place, so assert that
no `select` statement is emitted.
2025-01-05 08:51:15 +00:00
bors
7270e73b62 Auto merge of #135074 - wzssyqa:mips-mti, r=oli-obk
Target: Add mips mti baremetal support

Do the same thing as gcc, which use the vendor `mti` to mark the toolchain as MIPS32r2 default.

We support both big endian and little endian flavor:
  mips-mti-none-elf
  mipsel-mti-none-elf
2025-01-05 07:01:38 +00:00
YunQiang Su
1a82287070
Update src/doc/rustc/src/platform-support/mips-mti-none-elf.md
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
2025-01-05 14:46:54 +08:00
kirk
ff7f818fc7 change to static relocation model 2025-01-05 05:04:34 +00:00
YunQiang Su
51dc350178 fix tests 2025-01-05 13:00:26 +08:00
bors
8417f8311f Auto merge of #135113 - workingjubilee:rollup-yy6nxel, r=workingjubilee
Rollup of 4 pull requests

Successful merges:

 - #134925 (deny usage of special FileCheck prefixes as revision names)
 - #134996 (Add UWP (msvc) target support page)
 - #135104 (do not in-place-iterate over flatmap/flatten)
 - #135110 (library: fix adler{ -> 2}.debug)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-05 03:40:44 +00:00
Jubilee
bfd7ac17f9
Rollup merge of #135110 - matthiaskrgr:adler, r=workingjubilee
library: fix adler{ -> 2}.debug

Fixes
```
Checking stage0 library artifacts {alloc, core, panic_abort, panic_unwind, proc_macro, std, sysroot, test, unwind} (x86_64-unknown-linux-gnu)
warning: profile package spec `adler` in profile `release` did not match any packages

	Did you mean `adler2`?
```
r? `@bjorn3`
2025-01-04 17:23:17 -08:00
Jubilee
5be6c9bc12
Rollup merge of #135104 - the8472:disable-in-place-iter-for-flatten, r=Mark-Simulacrum
do not in-place-iterate over flatmap/flatten

The implementation is unsound when a partially consumed iterator has some elements buffered in the front/back parts and cloning the Iterator removes the capacity from the backing vec::IntoIter.

This is a fix for #135103 that removes the specialization trait impls without removing some supporting parts. I've kept it small so it can be easily backported. I'll either remove the remaining parts or think of a way to recover the optimization in a separate PR.
2025-01-04 17:23:16 -08:00
Jubilee
dcb8be8934
Rollup merge of #134996 - bdbai:uwp-support, r=jieyouxu,ChrisDenton
Add UWP (msvc) target support page

- Added Platform Support page for `x86_64-uwp-windows-msvc`, `i686-uwp-windows-msvc`, `thumbv7a-uwp-windows-msvc` and `aarch64-uwp-windows-msvc`
  - Adding myself as a maintainer
  - Removing the ticks for `thumbv7a-pc-windows-msvc` and `thumbv7a-uwp-windows-msvc` as they do not currently build due to #134565 and https://github.com/rust-lang/backtrace-rs/pull/685
- Fixed a few minor issues to let most of the UWP targets compile
- Happy new year to all!

r? jieyouxu
2025-01-04 17:23:16 -08:00
Jubilee
78e681ac74
Rollup merge of #134925 - DavisRayM:130982-deny-special-filecheck-prefixes, r=jieyouxu
deny usage of special FileCheck prefixes as revision names

Adds a check that ensures special FileCheck prefixes are not used as revision names.

Fix #130982
2025-01-04 17:23:15 -08:00
Trevor Gross
d42c3ae02f Merge the intrinsic and user tests for select_unpredictable
[1] mentions that having a single test with `-Zmerge-functions=disabled`
is preferable to having two separate tests.  Apply that to the new
`select_unpredicatble` test here.

[1]: https://github.com/rust-lang/rust/pull/133964#issuecomment-2569693325
2025-01-05 01:17:07 +00:00
Trevor Gross
37f2875588 Add doc aliases for libm and IEEE names
Searching "fma" in the Rust documentation returns results for
`intrinsics::fma*`, but does not point to the user-facing `mul_add`. Add
aliases for `fma*` and the IEEE operation name `fusedMultiplyAdd`. Add
the IEEE name to `sqrt` as well, `squareRoot`.
2025-01-05 01:03:32 +00:00
Matthias Krüger
e30369fcb4 library: fix adler{-> 2}.debug
Fixes
```
Checking stage0 library artifacts {alloc, core, panic_abort, panic_unwind, proc_macro, std, sysroot, test, unwind} (x86_64-unknown-linux-gnu)
warning: profile package spec `adler` in profile `release` did not match any packages

	Did you mean `adler2`?
```
2025-01-05 01:40:09 +01:00
github-actions
7bcf985334 cargo update
compiler & tools dependencies:
     Locking 4 packages to latest compatible versions
    Updating bstr v1.11.1 -> v1.11.3
    Updating spdx v0.10.7 -> v0.10.8
    Updating syn v2.0.93 -> v2.0.94
    Updating tempfile v3.14.0 -> v3.15.0
note: pass `--verbose` to see 35 unchanged dependencies behind latest

library dependencies:
     Locking 0 packages to latest compatible versions
note: pass `--verbose` to see 3 unchanged dependencies behind latest

rustbook dependencies:
     Locking 5 packages to latest compatible versions
    Updating bstr v1.11.1 -> v1.11.3
    Updating cc v1.2.6 -> v1.2.7
    Updating syn v2.0.93 -> v2.0.94
    Updating tempfile v3.14.0 -> v3.15.0
    Updating winnow v0.6.20 -> v0.6.22
2025-01-05 00:22:51 +00:00
bors
3dc3c524f7 Auto merge of #133990 - Walnut356:static_const, r=workingjubilee
[Debuginfo] Force enum `DISCR_*` to `static const u64` to allow for inspection via LLDB

see [here](https://rust-lang.zulipchat.com/#narrow/channel/317568-t-compiler.2Fwg-debugging/topic/Revamping.20Debuginfo/near/486614878) for more info.

This change mainly helps `*-msvc` debugged with LLDB. Currently, LLDB cannot inspect `static` struct fields, so the intended visualization for enums is only borderline functional, and niche enums with ranges of discriminant cannot be determined at all .

LLDB *can* inspect `static const` values (though for whatever reason, non-enum/non-u64 consts don't work).

This change adds the `LLVMRustDIBuilderCreateQualifiedType` to the rust FFI layer to wrap the discr type with a `const` modifier, as well as forcing all generated integer enum `DISCR_*` values to be u64's. Those values will only ever be used by debugger visualizers anyway, so it shouldn't be a huge deal, but I left a fixme comment for it just in case.. The `tag` also still properly reflects the discriminant type, so no information is lost.
2025-01-04 23:56:29 +00:00
bors
1891c28669 Auto merge of #135101 - workingjubilee:rollup-owp3czl, r=workingjubilee
Rollup of 6 pull requests

Successful merges:

 - #135046 (turn rustc_box into an intrinsic)
 - #135061 (crashes: add latest batch of tests)
 - #135070 (std: sync to dep versions of backtrace)
 - #135088 (Force code generation in assembly generation smoke-tests)
 - #135091 (Bump backtrace to 0.3.75)
 - #135094 (bootstrap: If dir_is_empty fails, show the non-existent directory path)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-04 21:11:28 +00:00
knickish
139ca10f65
Apply suggestions from workingjubilee's code review
Co-authored-by: Jubilee <workingjubilee@gmail.com>
2025-01-04 12:52:19 -06:00
The 8472
1ed0ea459d add regression test for unsound Flatten/FlatMap specialization 2025-01-04 19:44:49 +01:00
The 8472
3d871b3ced do not in-place-iterate over flatmap/flatten
The implementation is unsound when a partially consumed iterator has
some elements buffered in the front/back parts and cloning the Iterator
removes the capacity from the backing vec::IntoIter.
2025-01-04 19:26:58 +01:00
bors
ead4a8f536 Auto merge of #135096 - jieyouxu:fix-doc-submodule-handling, r=onur-ozkan
bootstrap: correctly handle doc paths within submodules

Fixes #135041 by passing the correct submodule path when requiring submodules. This PR changes `is_path_in_submodule` to `submodule_path_of`. `submodule_path_of` returns the path of the containing submodule when given a path nested inside a submodule we handle, and `None` otherwise.

I tested this manually locally by unregistering the `src/tools/cargo` submodule, then running `./x doc src/tools/cargo/src/doc`. This command fails on master with

```
thread 'main' panicked at src/bootstrap/src/utils/helpers.rs:441:5:
std::fs::read_dir(dir) failed with No such file or directory (os error 2)
```

since the require submodule fails as `src/tools/cargo/src/doc` is not a known submodule. Now we use the submodule path if such a nested-in-submodule-path is passed, and thus running this command with cargo submodule unregistered still succeeds:

```
Rustbook (x86_64-unknown-linux-gnu) - cargo
Doc path: /home/joe/repos/rust/build/x86_64-unknown-linux-gnu/doc/cargo/index.html
Build completed successfully in 0:00:11
```

r? `@onur-ozkan`
2025-01-04 18:26:14 +00:00
Jubilee
e2983d843c
Rollup merge of #135094 - joshtriplett:bootstrap-show-nonexistent-dir, r=jieyouxu
bootstrap: If dir_is_empty fails, show the non-existent directory path

This should help when trying to debug issues.
2025-01-04 07:57:36 -08:00
Jubilee
1318a39c28
Rollup merge of #135091 - workingjubilee:backtrace-0.3.75, r=workingjubilee
Bump backtrace to 0.3.75

I prefer when we can ship the same version of backtrace on crates.io, and this will be the next published version.

Compare: https://github.com/rust-lang/backtrace-rs/compare/4d7906b...0.3.75

Mostly internal-to-backtrace changes, plus a tiny code size win.

r? `@ghost`
2025-01-04 07:57:35 -08:00
Jubilee
030333a456
Rollup merge of #135088 - maurer:force-asm, r=nikic
Force code generation in assembly generation smoke-tests

In llvm/llvm-project@7b23f413d1 , `.text` started being suppressed from LLVM assembly in cases where it wasn't strictly necessary. Currently, the sample functions in these two tests are frequently decided to be IR-only functions, resulting in no code generation, so LLVM drops the `.text` directive.

Adding `#[no_mangle]` forces these tests back to their original intent - assembly code is generated, and so a `.text` directive is generated as well.

`@rustbot` label: +llvm-main
r? `@workingjubilee`

I'll attach a buildbot link once it finishes consuming this PR
2025-01-04 07:57:35 -08:00
Jubilee
6adcdc368a
Rollup merge of #135070 - klensy:backtrace-deps, r=workingjubilee
std: sync to dep versions of backtrace

Minor versions from backtrace desynced with std (they still differs in patch numbers, but still better):
4d7906bb24/Cargo.toml (L44-L48)

There is hidden bug here, let's see if CI can find it.

cc `@workingjubilee`
2025-01-04 07:57:34 -08:00
Jubilee
0da5bb405d
Rollup merge of #135061 - matthiaskrgr:crashes_jan, r=lqd
crashes: add latest batch of tests

try-job: aarch64-apple
try-job: x86_64-msvc
try-job: x86_64-gnu
try-job: dist-i586-gnu-i586-i686-musl
2025-01-04 07:57:34 -08:00
Jubilee
7cf3b96a83
Rollup merge of #135046 - RalfJung:rustc_box_intrinsic, r=compiler-errors
turn rustc_box into an intrinsic

I am not entirely sure why this was made a special magic attribute, but an intrinsic seems like a more natural way to add magic expressions to the language.
2025-01-04 07:57:33 -08:00
bors
2a8af4f7c8 Auto merge of #133955 - bjorn3:cc_pass_arch_only, r=ChrisDenton
Pass the arch rather than full target name to windows_registry::find_tool

The full target name can be anything with custom target specs. Passing just the arch wasn't possible before cc 1.2, but is now thanks to https://github.com/rust-lang/cc-rs/pull/1285.

try-job: i686-msvc
2025-01-04 15:42:31 +00:00
许杰友 Jieyou Xu (Joe)
4406f42a18 bootstrap: make is_path_in_submodule return optional submodule path instead 2025-01-04 23:14:27 +08:00
Matthias Krüger
9444195e92 crashes: add latest batch of tests 2025-01-04 14:38:06 +01:00
bors
fd127a3a84 Auto merge of #135031 - RalfJung:intrinsics-without-body, r=oli-obk
rustc_intrinsic: support functions without body

We synthesize a HIR body `loop {}` but such bodyless intrinsics.

Most of the diff is due to turning `ItemKind::Fn` into a brace (named-field) enum variant, because it carries a `bool`-typed field now. This is to remember whether the function has a body. MIR building panics to avoid ever translating the fake `loop {}` body, and the intrinsic logic uses the lack of a body to implicitly mark that intrinsic as must-be-overridden.

I first tried actually having no body rather than generating the fake body, but there's a *lot* of code that assumes that all function items have HIR and MIR, so this didn't work very well. Then I noticed that even `rustc_intrinsic_must_be_overridden` intrinsics have MIR generated (they are filled with an `Unreachable` terminator) so I guess I am not the first to discover this. ;)

r? `@oli-obk`
2025-01-04 12:50:38 +00:00
Ralf Jung
3cd3649c6c rustc_intrinsic: support functions without body; they are implicitly marked as must-be-overridden 2025-01-04 11:41:51 +01:00
Ralf Jung
be65012aa3 turn hir::ItemKind::Fn into a named-field variant 2025-01-04 11:35:31 +01:00
bors
f17cf744f5 Auto merge of #135095 - matthiaskrgr:rollup-tmgxckq, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #133964 (core: implement `bool::select_unpredictable`)
 - #135001 (Allow using self-contained LLD in bootstrap)
 - #135055 (Report impl method has stricter requirements even when RPITIT inference gets in the way)
 - #135064 (const-in-pattern: test that the PartialEq impl does not need to be const)
 - #135066 (bootstrap: support `./x check run-make-support`)
 - #135069 (remove unused function params)
 - #135084 (Update carrying_mul_add test to tolerate `nuw`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-04 10:02:59 +00:00
Matthias Krüger
75e412b8d1
Rollup merge of #135084 - maurer:nuw, r=nikic
Update carrying_mul_add test to tolerate `nuw`

LLVM 20 adds nuw to GEP operations in this code, tolerate them.

`@rustbot` label: +llvm-main

r? `@durin42`
2025-01-04 09:54:40 +01:00
Matthias Krüger
725b799478
Rollup merge of #135069 - matthiaskrgr:param_rec_usage, r=jieyouxu
remove unused function params
2025-01-04 09:54:39 +01:00
Matthias Krüger
e4cc2db519
Rollup merge of #135066 - jieyouxu:check-run-make-support, r=clubby789
bootstrap: support `./x check run-make-support`

Mostly for working on `src/tools/run-make-support` locally.
2025-01-04 09:54:39 +01:00
Matthias Krüger
966a5be559
Rollup merge of #135064 - RalfJung:const-in-pat-partial-eq-not-const, r=compiler-errors
const-in-pattern: test that the PartialEq impl does not need to be const

Fixes https://github.com/rust-lang/rust/issues/119398 by adding a test.

`@compiler-errors`  is there some place in the code where we could add a comment saying "as a backcompat hack, here we only require `PartialEq` and not `const PartialEq`"?

r? `@compiler-errors`
2025-01-04 09:54:38 +01:00
Matthias Krüger
b0b54f2f8b
Rollup merge of #135055 - compiler-errors:rpitit-infer-in-stricter-impl, r=estebank
Report impl method has stricter requirements even when RPITIT inference gets in the way

See the comment I added in the code. Fixes #122506.
2025-01-04 09:54:38 +01:00