1
Fork 0
Commit graph

278295 commits

Author SHA1 Message Date
onur-ozkan
9e86d76ad9 fix compiler errors
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12 08:43:24 +03:00
onur-ozkan
615131b4d4 migrate generate_smart_stamp_hash
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12 08:43:21 +03:00
onur-ozkan
cacb4fe93a add test coverage for build_stamp implementation
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12 08:43:16 +03:00
onur-ozkan
9e1c9fd654 document build_stamp implementation
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12 08:43:13 +03:00
onur-ozkan
236d5804bf migrate Builder::clear_if_dirty
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12 08:43:11 +03:00
onur-ozkan
9e929754b2 migrate helper stamp functions
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12 08:43:08 +03:00
onur-ozkan
c68c721b50 migrate HashStamp to BuildStamp
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12 08:43:05 +03:00
onur-ozkan
e3de3c767e use BuildStamp instead of std paths and strings
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12 08:43:03 +03:00
onur-ozkan
58306c6a00 implement BuildStamp that is stricter impl for build stamps
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12 08:43:00 +03:00
Ross Sullivan
6f833aa057
re-added regression test for #122638 2025-01-12 14:27:04 +09:00
许杰友 Jieyou Xu (Joe)
1665b80b71 run-make-support: don't use lossy on TARGET_RPATH_DIR 2025-01-12 13:03:22 +08:00
许杰友 Jieyou Xu (Joe)
fec2e3ab1a compiletest: include stage0-sysroot libstd dylib in recipe dylib search path
To fix some of the failures in
`COMPILETEST_FORCE_STAGE0=1 ./x test run-make --stage 0`.
2025-01-12 13:03:22 +08:00
ltdk
e37daf0c86 Add inherent versions of MaybeUninit methods for slices 2025-01-11 23:57:00 -05:00
binarycat
16286cefcf rename 'js-doc-test' to 'rustdoc-js' in compiletest 2025-01-11 20:37:20 -06:00
Antoni Boucher
0d47dc0cf0 Correctly handle the relocation model for LTO 2025-01-11 21:04:38 -05:00
Antoni Boucher
423701a3cf Add comment 2025-01-11 21:04:26 -05:00
Antoni Boucher
3e4df68991 Fix for m68k 2025-01-11 21:03:58 -05:00
Antoni Boucher
93693a52dc Disable the LTO warning for now 2025-01-11 21:03:57 -05:00
Antoni Boucher
34ed154343 Fix LTO 2025-01-11 21:02:43 -05:00
binarycat
a55bc72cea don't use a string constant 2025-01-11 19:27:26 -06:00
github-actions
0f1e253066 cargo update
compiler & tools dependencies:
     Locking 27 packages to latest compatible versions
    Updating bitflags v2.6.0 -> v2.7.0
    Updating clap v4.5.23 -> v4.5.26
    Updating clap_builder v4.5.23 -> v4.5.26
    Updating clap_complete v4.5.40 -> v4.5.42
    Updating clap_derive v4.5.18 -> v4.5.24
    Updating handlebars v6.2.0 -> v6.3.0
    Updating libz-sys v1.1.20 -> v1.1.21
    Updating linux-raw-sys v0.4.14 -> v0.4.15
    Updating phf v0.11.2 -> v0.11.3
    Updating phf_codegen v0.11.2 -> v0.11.3
    Updating phf_generator v0.11.2 -> v0.11.3
    Updating phf_shared v0.11.2 -> v0.11.3
    Updating pin-project-lite v0.2.15 -> v0.2.16
    Updating proc-macro2 v1.0.92 -> v1.0.93
    Updating rustix v0.38.42 -> v0.38.43
    Updating serde_json v1.0.134 -> v1.0.135
      Adding siphasher v1.0.1
    Updating syn v2.0.94 -> v2.0.96
    Updating thiserror v2.0.9 -> v2.0.11
    Updating thiserror-impl v2.0.9 -> v2.0.11
    Updating tokio v1.42.0 -> v1.43.0
    Updating uuid v1.11.0 -> v1.11.1
    Updating wasm-encoder v0.222.0 -> v0.223.0
      Adding wasmparser v0.223.0
    Updating wast v222.0.0 -> v223.0.0
    Updating wat v1.222.0 -> v1.223.0
    Updating xattr v1.3.1 -> v1.4.0
note: pass `--verbose` to see 39 unchanged dependencies behind latest

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

rustbook dependencies:
     Locking 27 packages to latest compatible versions
    Updating bitflags v2.6.0 -> v2.7.0
    Updating cc v1.2.7 -> v1.2.8
    Updating clap v4.5.23 -> v4.5.26
    Updating clap_builder v4.5.23 -> v4.5.26
    Updating clap_complete v4.5.40 -> v4.5.42
    Updating clap_derive v4.5.18 -> v4.5.24
      Adding darling v0.20.10
      Adding darling_core v0.20.10
      Adding darling_macro v0.20.10
      Adding derive_builder v0.20.2
      Adding derive_builder_core v0.20.2
      Adding derive_builder_macro v0.20.2
    Updating handlebars v6.2.0 -> v6.3.0
      Adding ident_case v1.0.1
    Updating linux-raw-sys v0.4.14 -> v0.4.15
    Updating phf v0.11.2 -> v0.11.3
    Updating phf_codegen v0.11.2 -> v0.11.3
    Updating phf_generator v0.11.2 -> v0.11.3
    Updating phf_shared v0.11.2 -> v0.11.3
    Updating proc-macro2 v1.0.92 -> v1.0.93
    Updating rustix v0.38.42 -> v0.38.43
    Updating serde_json v1.0.134 -> v1.0.135
      Adding siphasher v1.0.1
    Updating syn v2.0.94 -> v2.0.96
    Updating thiserror v2.0.9 -> v2.0.11
    Updating thiserror-impl v2.0.9 -> v2.0.11
    Updating winnow v0.6.22 -> v0.6.24
2025-01-12 00:23:37 +00:00
Scott McMurray
7396ec3edb Address PR feedback 2025-01-11 15:56:58 -08:00
Scott McMurray
6e34369ef6 [mir-opt] simplify Repeats that don't actually repeat the operand 2025-01-11 15:56:53 -08:00
binarycat
0962afaa8f clean up code related to the rustdoc-js test suite 2025-01-11 17:50:29 -06:00
Ben Kimock
cda566e226 Add #[inline] to copy_from_slice 2025-01-11 18:00:44 -05:00
Michael Howell
916cfbcd3e rustdoc: use import stability marker in display 2025-01-11 15:04:48 -07:00
bors
12445e0b2c Auto merge of #135360 - RalfJung:structural-partial-eq, r=compiler-errors
update and clarify StructuralPartialEq docs

This apparently hasn't been updated when we finalized the current const pattern matching behavior.

Fixes https://github.com/rust-lang/rust/issues/92454 by providing rationale and context in the docs linked from that error message.
2025-01-11 21:46:43 +00:00
Frank Steffahn
df57d65c70 Make UniqueRc invariant for soundness 2025-01-11 22:36:25 +01:00
Michael Goulet
f1d622678b Make MIR cleanup for functions with impossible predicates into a real MIR pass 2025-01-11 20:50:39 +00:00
binarycat
af2247ce10 allow rustdoc-js tests to be run at stage0
this mirrors the behavior of rustdoc-js-std tests.

previously this required COMPILETEST_FORCE_STAGE0.
2025-01-11 14:00:16 -06:00
Michael Goulet
85c9ce6d79 Remove a bunch of diagnostic stashing that doesn't do anything 2025-01-11 19:22:06 +00:00
Michael Goulet
4486a19007 Suggest typos when trait path expression is typod 2025-01-11 18:44:12 +00:00
binarycat
d4057e8df0 re-add --disable-minification to rustdoc
this also makes the rust.docs-minification option work
as advertised in config.toml

nothing fancy this time, this is intended to be perma-unstable.
it's only really here for the benefit of rustdoc devs.

mitegates https://github.com/rust-lang/rust/issues/135345
2025-01-11 12:33:25 -06:00
bors
eb54a50837 Auto merge of #135370 - matthiaskrgr:rollup-g2w6d5n, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #134030 (add `-Zmin-function-alignment`)
 - #134776 (Avoid ICE: Account for `for<'a>` types when checking for non-structural type in constant as pattern)
 - #135205 (Rename `BitSet` to `DenseBitSet`)
 - #135314 (Eagerly collect mono items for non-generic closures)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-11 18:01:44 +00:00
Mark Rousskov
6f72f13436 Remove allocations from case-insensitive comparison to keywords 2025-01-11 12:39:44 -05:00
Matthias Krüger
076c047fe1
Rollup merge of #135314 - compiler-errors:eagerly-mono-closures, r=wesleywiser
Eagerly collect mono items for non-generic closures

This allows users to use `-Zprint-mono-items=eager` to eagerly monomorphize closures and coroutine bodies, in case they want to inspect the LLVM or ASM for those items.

`-Zprint-mono-items`, which used to be called `-Zprint-trans-items`, was originally added in https://github.com/rust-lang/rust/pull/30900:

> Eager mode is meant to be used in conjunction with incremental compilation
> where a stable set of translation items is more important than a minimal
> one. Thus, eager mode will instantiate drop-glue for every drop-able type
> in the crate, even of no drop call for that type exists (yet). It will
> also instantiate default implementations of trait methods, something that
> otherwise is only done on demand.

Although it remains an unstable option, its purpose has somewhat expanded since then, and as far as I can tell it's generally useful for cases when you want to monomorphize as many items as possible, even if they're unreachable. Specifically, it's useful for debugging since you can look at the codegen'd body of a function, since we don't emit items that are not reachable in monomorphization.

And even more specifically, it would be very to monomorphize the coroutine body of an async fn, since those you can't easily call those without a runtime. This PR enables this usecase since we now monomorphize `DefKind::Closure`.
2025-01-11 18:13:47 +01:00
Matthias Krüger
0bb0f0412f
Rollup merge of #135205 - lqd:bitsets, r=Mark-Simulacrum
Rename `BitSet` to `DenseBitSet`

r? `@Mark-Simulacrum` as you requested this in https://github.com/rust-lang/rust/pull/134438#discussion_r1890659739 after such a confusion.

This PR renames `BitSet` to `DenseBitSet` to make it less obvious as the go-to solution for bitmap needs, as well as make its representation (and positives/negatives) clearer. It also expands the comments there to hopefully make it clearer when it's not a good fit, with some alternative bitsets types.

(This migrates the subtrees cg_gcc and clippy to use the new name in separate commits, for easier review by their respective owners, but they can obvs be squashed)
2025-01-11 18:13:47 +01:00
Matthias Krüger
2bcd5cf1ec
Rollup merge of #134776 - estebank:vanilla-ice, r=lcnr
Avoid ICE: Account for `for<'a>` types when checking for non-structural type in constant as pattern

When we encounter a constant in a pattern, we check if it is non-structural. If so, we check if the type implements `PartialEq`, but for types with escaping bound vars the check would be incorrect as is, so we break early. This is ok because these types would be filtered anyways.

Slight tweak to output to remove unnecessary context as a drive-by.

Fix #134764.
2025-01-11 18:13:46 +01:00
Matthias Krüger
b8e230a824
Rollup merge of #134030 - folkertdev:min-fn-align, r=workingjubilee
add `-Zmin-function-alignment`

tracking issue: https://github.com/rust-lang/rust/issues/82232

This PR adds the `-Zmin-function-alignment=<align>` flag, that specifies a minimum alignment for all* functions.

### Motivation

This feature is requested by RfL [here](https://github.com/rust-lang/rust/issues/128830):

> i.e. the equivalents of `-fmin-function-alignment` ([GCC](https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-fmin-function-alignment_003dn), Clang does not support it) / `-falign-functions` ([GCC](https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-falign-functions), [Clang](https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang1-falign-functions)).
>
> For the Linux kernel, the behavior wanted is that of GCC's `-fmin-function-alignment` and Clang's `-falign-functions`, i.e. align all functions, including cold functions.
>
> There is [`feature(fn_align)`](https://github.com/rust-lang/rust/issues/82232), but we need to do it globally.

### Behavior

The `fn_align` feature does not have an RFC. It was decided at the time that it would not be necessary, but maybe we feel differently about that now? In any case, here are the semantics of this flag:

- `-Zmin-function-alignment=<align>` specifies the minimum alignment of all* functions
- the `#[repr(align(<align>))]` attribute can be used to override the function alignment on a per-function basis: when `-Zmin-function-alignment` is specified, the attribute's value is only used when it is higher than the value passed to `-Zmin-function-alignment`.
- the target may decide to use a higher value (e.g. on x86_64 the minimum that LLVM generates is 16)
- The highest supported alignment in rust is `2^29`: I checked a bunch of targets, and they all emit the `.p2align        29` directive for targets that align functions at all (some GPU stuff does not have function alignment).

*: Only with `build-std` would the minimum alignment also be applied to `std` functions.

---

cc `@ojeda`

r? `@workingjubilee` you were active on the tracking issue
2025-01-11 18:13:45 +01:00
Antoni Boucher
3f23706c6c Cleanup 2025-01-11 10:41:31 -05:00
Antoni Boucher
59afbe0913 Fix for the relocation bug 2025-01-11 10:41:31 -05:00
Antoni Boucher
8bc4863951 Fix for ThinLTO 2025-01-11 10:41:31 -05:00
Antoni Boucher
747924ad86 Debug global variable not initialized bug 2025-01-11 10:41:27 -05:00
Kajetan Puchalski
9ba34f8347 ci: Organise shared helper scripts
Move shared helper scripts used by Docker builds under docker/scripts.
2025-01-11 15:15:11 +00:00
Ralf Jung
471d830106 avoid nesting the user-defined main so deeply on the stack 2025-01-11 15:53:42 +01:00
Ralf Jung
9f7fe81d53 use a single large catch_unwind in lang_start 2025-01-11 15:50:53 +01:00
Yotam Ofek
27b0693464 collect diag suggestions instead of pushing into vector repeatedly 2025-01-11 13:21:15 +00:00
Yotam Ofek
6680bc5554 improve clunky grammar in borrowck diagnostic 2025-01-11 13:20:17 +00:00
Yotam Ofek
86d2129a78 fix it's -> its in doc comment 2025-01-11 13:16:56 +00:00
bors
fb65a3ee57 Auto merge of #135292 - lqd:rustcperfup, r=kobzol
bump `rustc-perf` submodule

This updates the `rustc-perf` submodule to pull in the recent changes, in particular the error handling in https://github.com/rust-lang/rustc-perf/pull/2021 fixing the error we saw in a recent run.

I think I did this correctly, submodules are so annoying.

r? kobzol

(opening as draft to do a perf run and check that nothing has changed indeed)
2025-01-11 11:54:26 +00:00