Commit graph

298901 commits

Author SHA1 Message Date
Jakub Beránek
3a1dd440de Make git_dir required in several git functions
It was always called with `Some`, so no need to complicate it with `Option`.
2025-04-20 09:35:42 +02:00
Jakub Beránek
c32c076f34 Return PathFreshness::MissingUpstream from detect_[gcc|llvm]_freshness functions 2025-04-20 09:35:42 +02:00
Jakub Beránek
6ca2a0dd26 Extend ci_rustc_if_unchanged tests 2025-04-20 09:35:42 +02:00
Jakub Beránek
f414afbf9f Move freshness test to bootstrap 2025-04-20 09:35:42 +02:00
Jakub Beránek
432c4a80e9 Remove the add_dummy_commit.sh hack
The new git tests should be enough to check this scenario. We should ideally not be creating dummy commits on CI.
2025-04-20 09:35:39 +02:00
Trevor Gross
22f44df8bd Set the musl submodule to 61399d4b ("loongarch64: add TLSDESC support")
Set the submodule to the same version we had been using in
rust-lang/libm. This is a downgrade from the current version but it
avoids some new deviations that show up, which can be corrected later.
2025-04-20 03:22:27 -04:00
Trevor Gross
9c96f245b8 ci: Enable testing of libm crates
Update `run.sh` to start testing `libm`. Currently this is somewhat
inefficient because `builtins-test` gets run more than once on some
targets; this can be cleaned up later.
2025-04-20 03:22:27 -04:00
Jakub Beránek
64795ecb87 Remove setup-upstream-remote.sh and upstream handling.
It shouldn't be needed anymore.
2025-04-20 09:13:56 +02:00
Jakub Beránek
8515d7e257 Cache result of check_path_modifications 2025-04-20 09:13:56 +02:00
Jakub Beránek
1f5320e57b Unify usages of path modifications and log them in verbose mode 2025-04-20 09:13:55 +02:00
Jakub Beránek
1dabb76f40 Explicitly model missing upstream
It shouldn't really happen, but if it does, at least we will have an explicit record of it.
2025-04-20 09:13:55 +02:00
Jakub Beránek
22280337f6 Use check_path_modifications for detecting local rustc changes
And get rid of `get_closest_merge_commit`.
2025-04-20 09:13:55 +02:00
Jakub Beránek
0396f0e522 Use check_path_modifications for detecting local LLVM changes 2025-04-20 09:13:55 +02:00
Jakub Beránek
1d1f248093 Use check_path_modifications for detecting local GCC changes 2025-04-20 09:13:29 +02:00
Jakub Beránek
082ab9c6d8 Implement a new unified function for figuring out how if a set of paths have been modified locally
Also adds several git tests to make sure that the behavior works in common cases (PR CI, auto CI, local usage).
2025-04-20 09:11:21 +02:00
Jakub Beránek
de9d8e9f71 Remove stray newline from post-merge report 2025-04-20 08:57:28 +02:00
Trevor Gross
d0e0134dc5 ci: Add extensive tests from rust-lang/libm 2025-04-20 02:33:17 -04:00
xizheyin
3a372e39ca
std: mention remove_dir_all can emit DirectoryNotEmpty when concurrently written into
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-04-20 14:32:33 +08:00
Trevor Gross
9919218493 ci: Add a libm MSRV check
Add the job from rust-lang/libm
2025-04-20 02:23:28 -04:00
The Miri Cronjob Bot
669d51106f Merge from rustc 2025-04-20 04:59:54 +00:00
Trevor Gross
d02b25fd6e Fix the libm-test logfile path
This was broken since the crate's location relative to the target
directory had changed.
2025-04-20 00:58:50 -04:00
Trevor Gross
0d0d317242 Enable icount benchmarks in CI 2025-04-20 00:58:50 -04:00
The Miri Cronjob Bot
32fe60bc57 Preparing for merge from rustc 2025-04-20 04:52:36 +00:00
Trevor Gross
141c7b06c4 Add remaining libm crates to the workspace
These are still not yet covered in CI since we always name explicit
packages there, but all crates are now part of the workspace.
2025-04-19 23:20:13 -04:00
Jack Wrenn
957b5488a5 transmutability: remove NFA intermediate representation
Prior to this commit, the transmutability analysis used an intermediate
NFA representation of type layout. We then determinized this
representation into a DFA, upon which we ran the core transmutability
analysis. Unfortunately, determinizing NFAs is expensive. In this
commit, we avoid NFAs entirely by observing that Rust `union`s are the
only source of nondeterminism and that it is comparatively cheap to
compute the DFA union of DFAs.

We also implement Graphviz DOT debug formatting of DFAs.

Fixes rust-lang/project-safe-transmute#23
Fixes rust-lang/project-safe-transmute#24
2025-04-20 03:06:59 +00:00
Trevor Gross
a48de6950c Move builtins-test-intrinsics out of the workspace
This crate doesn't need to be a default member since it requires the
opposite settings from everything else. Exclude it from the workspace
and run it only when explicitly requested.

This also makes `cargo t --no-default-features` work without additional
qualifiers. `--no-default-features` still needs to be passed to ensure
`#![compiler_builtins]` does not get set.

compiler-builtins needs doctests disabled in order for everything to
work correctly, since this causes an error running rustdoc that is
unrelated to features (our `compiler_builtins` is getting into the crate
graph before that from the sysroot, but `#![compiler_builtins]` is not
set).

We can also remove `test = false` and `doctest = false` in
`builtins-test` since these no longer cause issues. This is unlikely to
be used but it is better to not quietly skip if anything ever gets added
by accident.
2025-04-19 22:30:58 -04:00
bors
49e5e4e3a5 Auto merge of #140043 - ChrisDenton:rollup-vwf0s9j, r=ChrisDenton
Rollup of 8 pull requests

Successful merges:

 - #138934 (support config extensions)
 - #139091 (Rewrite on_unimplemented format string parser.)
 - #139753 (Make `#[naked]` an unsafe attribute)
 - #139762 (Don't assemble non-env/bound candidates if projection is rigid)
 - #139834 (Don't canonicalize crate paths)
 - #139868 (Move `pal::env` to `std::sys::env_consts`)
 - #139978 (Add citool command for generating a test dashboard)
 - #139995 (Clean UI tests 4 of n)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-04-20 02:08:02 +00:00
Trevor Gross
c35cccd676 Move the libm .editorconfig to root 2025-04-19 20:42:40 -04:00
Trevor Gross
9b8065decb Combine the libm .gitignore 2025-04-19 20:42:40 -04:00
Trevor Gross
98acedc914 Remove libm CI dockerfiles
These are identical to what already exists in compiler-builtins except
for some base image changes, so we can eliminate the duplicates.
2025-04-19 20:42:40 -04:00
Trevor Gross
8d70be87e6 Run cargo fmt on all projects
Apply the same formatting rules to both `libm` and `compiler-builtins`.
2025-04-19 19:05:49 -04:00
Trevor Gross
569b40209d Add a .rustfmt.toml with style edition 2024
Use the 2024 style edition for all crates and enable import sorting.
2024 already applies some smaller heuristics that look good in
compiler-builtins, I have dropped `use_small_heuristics` that was set in
`libm` because it seems to negatively affect the readibility of anything
working with numbers (e.g. collapsing multiple small `if` expressions
into a single line).
2025-04-19 19:05:49 -04:00
Trevor Gross
66fa4fd265 Add libm and libm-macros to the workspace
These should build and test correctly. `libm-test` and others that
depend on it are excluded since the necessary CI is not yet set up.
2025-04-19 19:05:49 -04:00
Trevor Gross
cab8700e84 libm: Fix crate compilation
Update paths and submodules to fix `libm-test` and `util` building so we
will be able to add them to the workspace.
2025-04-19 18:23:45 -04:00
Onè
648653824b
docs: fix typo change from inconstants to invariants 2025-04-19 17:57:06 -04:00
Trevor Gross
ca5c4ed8d7 Fix the release-plz job 2025-04-19 17:31:43 -04:00
Trevor Gross
8b8bd8a0fd libm: Flatten the libm/libm directory 2025-04-19 17:20:24 -04:00
Trevor Gross
911a70381a libm: Reorganize into compiler-builtins
Distribute everything from `libm/` to better locations in the repo.
`libm/libm/*` has not moved yet to avoid Git seeing the move as an edit
to `Cargo.toml`.

Files that remain to be merged somehow are in `etc/libm`.
2025-04-19 17:20:24 -04:00
Trevor Gross
806bb4fa6e libm: Remove compiler-builtins-smoke-test
Since `libm` is now part of the `compiler-builtins` repo, the crate to
test that they work together is no longer needed.
2025-04-19 17:20:24 -04:00
bors
90fd16eb5b Auto merge of #140053 - ChrisDenton:rollup-tt00skl, r=ChrisDenton
Rollup of 7 pull requests

Successful merges:

 - #139042 (Do not remove trivial `SwitchInt` in analysis MIR)
 - #139533 (add next_index to Enumerate)
 - #139843 (Setup editor file associations for non-rs extensions)
 - #140000 (skip llvm-config in autodiff check builds, when its unavailable)
 - #140008 (Improve `clean_maybe_renamed_item` function code a bit)
 - #140024 (Remove early exits from JumpThreading.)
 - #140039 (Add option for stable backport poll)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-04-19 21:01:27 +00:00
Trevor Gross
83a8482f91 Update .git-blame-ignore-revs after the libm merge 2025-04-19 20:18:22 +00:00
Trevor Gross
1af955be9a Update path to libm after the merge 2025-04-19 20:18:22 +00:00
Trevor Gross
d794bb3492 Update submodules after the libm merge 2025-04-19 20:18:22 +00:00
Trevor Gross
e646c73c28 Merge remote-tracking branch 'libm/merge-into-builtins-prep' into absorb-libm
Absorb the libm repository into `compiler-builtins`.

This was done using `git-filter-repo` to ensure hashes mentioned in
commit messages were correctly rewritten, I used the same strategy to
merge `ctest` into `libc` [1] and it worked quite well. Approximately:

    # `git filter-repo` requires a clean clone
    git clone https://github.com/rust-lang/libm.git

    # Move all code to a `libm` subdirectory for all history
    git filter-repo --to-subdirectory-filter libm

    # The default merge messages are "merge pull request #nnn from
    # user/branch". GH links these incorrectly in the new repo, so
    # rewrite messages from `#nnn` to `rust-lang/libm#nnn`.
    echo 'regex:(^|\s)(#\d+)==>\1rust-lang/libm\2' > messages.txt
    git filter-repo --replace-message messages.txt

    # Re-add a remote and push as a new branch
    git remote add upstream https://github.com/rust-lang/libm.git
    git switch -c merge-into-builtins-prep
    git push --set-upstream upstream merge-into-builtins-prep

    # Now in a compiler-builtins, add `libm` as a remote
    git remote add libm https://github.com/rust-lang/libm.git
    git fetch libm

    # Do the merge that creates this commit
    git merge libm/merge-into-builtins-prep --allow-unrelated-histories

The result should be correct git history and blame for all files, with
messages that use correct rewritten hashes when they are referenced.
There is some reorganization and CI work needed, but that will be a
follow up.

After this merges I will need to push tags from `libm`, which I have
already rewritten to include a `libm-` prefix. Old tags in
compiler-builtins should likely also be rewritten to add a prefix (we
already have this for newer tags), but this can be done at any point.

* Original remote: https://github.com/rust-lang/libm.git
* Default HEAD: c94017af75c3ec4616d5b7f9b6b1b3826b934469 ("Migrate all
  crates except `libm` to edition 2024")
* HEAD after rewriting history: 15fb6307f6dc295fb965d1c4f486571cc18ab6b3
  ("Migrate all crates except `libm` to edition 2024")

[1]: https://github.com/rust-lang/libc/pull/4283#issuecomment-2773986492
2025-04-19 20:17:07 +00:00
Trevor Gross
1947f328a7 Remove the libm submodule 2025-04-19 20:16:40 +00:00
Chris Denton
4c36aeda27
Rollup merge of #140039 - apiraino:add-option-for-stable-backport-poll, r=aDotInTheVoid
Add option for stable backport poll

When creating polls on Zulip about stable backport ("Do we approve the backport of `#12345`"?), stable backports should have the option of "approving, but only is a dot release is planned" (this is a hint to t-release about how the team think important - or not - is backporting some patch).

Discussed on [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/stable-nominated.3A.20.23139328/near/510037866)[#t-rustdoc > stable-nominated: #139328 @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/stable-nominated.3A.20.23139328/near/510037866)

r? `@aDotInTheVoid`  (feel free to adjust the wording!)
2025-04-19 19:30:50 +00:00
Chris Denton
98515864d2
Rollup merge of #140024 - cjgillot:continue-jumping, r=compiler-errors
Remove early exits from JumpThreading.

This removes early exits from https://github.com/rust-lang/rust/pull/131203 as I asked during review.

The correctness of the backtracking is `mutated_statement` clearing all relevant conditions. If `process_statement` fails to insert a new condition, for instance by const-eval failure, `mutated_statement`  still removes the obsolete conditions from the state.

r? `@compiler-errors`
2025-04-19 19:30:49 +00:00
Chris Denton
91a88256b1
Rollup merge of #140008 - GuillaumeGomez:cleanup-clean_maybe_renamed_item, r=nnethercote
Improve `clean_maybe_renamed_item` function code a bit

Follow-up of #139846.

This is what I tried to say in there: the `name` variable can be unwrapped in most cases so better do it directly once and for all if possible and move the cases where it's not possible above.

r? `@nnethercote`
2025-04-19 19:30:48 +00:00
Chris Denton
c9c25c876c
Rollup merge of #140000 - EnzymeAD:autodiff-check-builds, r=onur-ozkan
skip llvm-config in autodiff check builds, when its unavailable

As you suggested, this indeed fixes `./x.py check` builds when autodiff is enabled.

r? ```@onur-ozkan```

closes #139936

Tracking:

- https://github.com/rust-lang/rust/issues/124509
2025-04-19 19:30:48 +00:00
Chris Denton
8955c6c6ee
Rollup merge of #139843 - thaliaarchi:editor-file-associations, r=Mark-Simulacrum
Setup editor file associations for non-rs extensions

.gitattributes lists `*.fixed`, `*.pp`, and `*.mir` as file extensions which should be treated as Rust source code. Do the same for VS Code and Zed. This only does syntax highlighting, which is appropriate, as MIR isn't really Rust code.

At the same time, consistently order `rust-analyzer.linkedProjects` between editors. For some reason, Eglot didn't include `library/Cargo.toml`.

I have tested this with VS Code and Zed. I have not implemented it for Emacs/Eglot or Helix.
2025-04-19 19:30:47 +00:00