1
Fork 0
Commit graph

278008 commits

Author SHA1 Message Date
onur-ozkan
1fa66573cd fix an invalid prefix usage on enzyme
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12 08:43:26 +03:00
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
binarycat
a55bc72cea don't use a string constant 2025-01-11 19:27:26 -06: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
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
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
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
Ross Sullivan
dc11857ee7
ci: added ci format to test_render 2025-01-11 20:43:17 +09:00
Rémy Rakic
95cbb3b964 migrate clippy to the DenseBitSet name 2025-01-11 11:34:04 +00:00
Rémy Rakic
afa1943b32 migrate rustc_codegen_gcc to the DenseBitSet name 2025-01-11 11:34:03 +00:00
Rémy Rakic
d1f8a2c109 document the use-cases of DenseBitSet a bit more 2025-01-11 11:34:03 +00:00
Rémy Rakic
a13354bea0 rename BitSet to DenseBitSet
This should make it clearer that this bitset is dense, with the
advantages and disadvantages that it entails.
2025-01-11 11:34:01 +00:00
Ralf Jung
41857a3d42 update and clarify StructuralPartialEq docs 2025-01-11 11:00:41 +01:00
bors
ce55b2052d Auto merge of #135357 - jhpratt:rollup-gs00yt3, r=jhpratt
Rollup of 6 pull requests

Successful merges:

 - #134074 (bootstrap: `std::io::ErrorKind::CrossesDevices` is finally stable)
 - #135236 (Update a bunch of library types for MCP807)
 - #135301 (re-add a warning for old master branch, but with much simpler logic)
 - #135324 (Initial fs module for uefi)
 - #135326 (support target specific `optimized-compiler-builtins`)
 - #135347 (Use `NonNull::without_provenance` within the standard library)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-11 09:17:06 +00:00
Jacob Pratt
46222ce6f8
Rollup merge of #135347 - samueltardieu:push-qvyxtxsqyxyr, r=jhpratt
Use `NonNull::without_provenance` within the standard library

This API removes the need for several `unsafe` blocks, and leads to clearer code. It uses feature `nonnull_provenance` (#135243).

Close #135343
2025-01-11 01:55:09 -05:00
Jacob Pratt
538d5dcbf5
Rollup merge of #135326 - onur-ozkan:target-specific-compiler-builtins, r=jieyouxu
support target specific `optimized-compiler-builtins`

Makes it possible to control `optimized-compiler-builtins` for per target.

This was raised in the [zulip discussion](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Building.20and.20packaging.20Rust.20with.20x86_64-unknown-uefi.20support/near/492765883) yesterday.
2025-01-11 01:55:08 -05:00
Jacob Pratt
23c22a6627
Rollup merge of #135324 - Ayush1325:uefi-fs-unsupported, r=joboet
Initial fs module for uefi

- Just a copy of unsupported fs right now to reduce the noise from future PRs to allow for easier review.
- For the full working version of fs on uefi, see [0]
- This is an effort to break the original PR (#129700) into much smaller chunks for faster upstreaming.

[0]: https://github.com/Ayush1325/rust/tree/uefi-file-full
2025-01-11 01:55:07 -05:00
Jacob Pratt
8c3e9d7c62
Rollup merge of #135301 - lolbinarycat:bootstrap-old-master-resurected, r=onur-ozkan
re-add a warning for old master branch, but with much simpler logic

instead of calling into git or checking the modification time of files, simply print the warning if there is a very large number of "modified" files.

also make the wording much softer, so false positives are less alarming.

(warning was removed in https://github.com/rust-lang/rust/issues/134935)
2025-01-11 01:55:06 -05:00
Jacob Pratt
351e6188a8
Rollup merge of #135236 - scottmcm:more-mcp807-library-updates, r=ChrisDenton
Update a bunch of library types for MCP807

This greatly reduces the number of places that actually use the `rustc_layout_scalar_valid_range_*` attributes down to just 3:
```
library/core\src\ptr\non_null.rs
68:#[rustc_layout_scalar_valid_range_start(1)]

library/core\src\num\niche_types.rs
19:        #[rustc_layout_scalar_valid_range_start($low)]
20:        #[rustc_layout_scalar_valid_range_end($high)]
```

Everything else -- PAL Nanoseconds, alloc's `Cap`, niched FDs, etc -- all just wrap those `niche_types` types.

r? ghost
2025-01-11 01:55:05 -05:00