| Age | Commit message (Collapse) | Author | Lines |
|
Rollup of 14 pull requests
Successful merges:
- rust-lang/rust#142139 (Include additional hashes in src/stage0)
- rust-lang/rust#146745 (Clarified error note for usize range matching)
- rust-lang/rust#146763 (cg_llvm: Replace some DIBuilder wrappers with LLVM-C API bindings (part 5))
- rust-lang/rust#146788 (chore: removes deprecated discord.)
- rust-lang/rust#146942 ([rustdoc] Finish getting rid of usages `write_str`)
- rust-lang/rust#147061 (fix rebasing cycle heads when not reaching a fixpoint)
- rust-lang/rust#147066 (Fix tracking issue number for feature(macro_attr))
- rust-lang/rust#147081 (doc: fix a typo in platform-support.md)
- rust-lang/rust#147082 (formatting_options: fix alternate docs 0b/0o mixup)
- rust-lang/rust#147086 (compiletest: Use `PanicHookInfo::payload_as_str` now that it's stable in beta)
- rust-lang/rust#147093 (redox: switch to colon as path separator)
- rust-lang/rust#147095 (Library: Remove remaining private `#[repr]` workarounds)
- rust-lang/rust#147098 (Add auto extra-checks in pre-push hook)
- rust-lang/rust#147110 (Fix typo)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Fix typo
Noticed this when looking at the source on doc.rust-lang.org
|
|
Add auto extra-checks in pre-push hook
Fixes rust-lang/rust#147088
This PR adds auto py, cpp, and js extra checks into the pre-push script.
- It checks those non-Rust files only if they are modified in the commit
- Thanks to auto mode, the pre-push doesn't check them if none of them are modified. It means that it doesn't build venv, nor install node_packages under build/
Note that this PR doesn't add shellcheck and spellcheck, because
- Currently shellcheck isn't installed by the tidy command unlike venv/node_modules. So it forces developers to take a extra task to enable pre-push hook
- Spellcheck is built whenever I kick test tidy with the option. If I enables it, developers should wait extra time for running pre-push hook
|
|
Library: Remove remaining private `#[repr]` workarounds
With https://github.com/rust-lang/rust/pull/116882 finally merged, gating these `repr`s behind cfg `not(doc)` is no longer necessary to achieve a private repr.
Follow up to https://github.com/rust-lang/rust/pull/128046 (that was enabled via https://github.com/rust-lang/rust/pull/115439). With that, https://github.com/rust-lang/rust/pull/116743 is now fully realized at long last.
cc ``@dtolnay``
|
|
redox: switch to colon as path separator
We recently changed this in order to better comply with assumptions about Unix-like systems. The current PATH is set to `/usr/bin` with no separators in order to ease the transition.
|
|
compiletest: Use `PanicHookInfo::payload_as_str` now that it's stable in beta
Nice little FIXME cleanup after the bootstrap beta bump to 1.91 in https://github.com/rust-lang/rust/pull/146636.
r? jieyouxu
|
|
r=Noratrieb
formatting_options: fix alternate docs 0b/0o mixup
The descriptions of the alternate forms of Octal and Binary were swapped in the doc comment for FormattingOptions::alternate().
|
|
doc: fix a typo in platform-support.md
Fix a typo.
|
|
Fix tracking issue number for feature(macro_attr)
The ability to define an attribute macro with `macro_rules!` is tracked at https://github.com/rust-lang/rust/issues/143547, not https://github.com/rust-lang/rust/issues/83527
|
|
fix rebasing cycle heads when not reaching a fixpoint
fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/232
annoyingly subtle, imagine the following proof tree
- A (no cycle head usages, final result Y)
- *ignored* B (depends on A with provisional result X)
- A (cycle, provisional result X)
- B (using the cache entry here incorrectly assumes A has final result X)
r? ``@BoxyUwU``
|
|
r=GuillaumeGomez
[rustdoc] Finish getting rid of usages `write_str`
This PR, along with rust-lang/rust#146933 , get rid of all the last usages of the `write_str` fn that was introduced back in rust-lang/rust#136784 .
This *shouldn't* be rolled up along with rust-lang/rust#146933 , since the later of the two to be merged will need to delete the no-longer-used `write_str` fn.
Commits can be reviewed separately.
|
|
chore: removes deprecated discord.
This PR just changes the wording of the contributing document to remove the deprecated Discord.
Fixes https://github.com/rust-lang/rust/issues/146756.
|
|
cg_llvm: Replace some DIBuilder wrappers with LLVM-C API bindings (part 5)
- Part of rust-lang/rust#134001
- Follow-up to rust-lang/rust#146673
---
This is another batch of LLVMDIBuilder binding migrations, replacing some our own LLVMRust bindings with bindings to upstream LLVM-C APIs.
Some of these are a little more complex than most of the previous migrations, because they split one LLVMRust binding into multiple LLVM bindings, but nothing too fancy.
This appears to be the last of the low-hanging fruit. As noted in https://github.com/rust-lang/rust/issues/134001#issuecomment-2524979268, the remaining bindings are difficult or impossible to migrate at present.
|
|
Clarified error note for usize range matching
Fixes rust-lang/rust#146476
This is kinda rough, but it gets the point across a little better and stays short.
|
|
Include additional hashes in src/stage0
This patch changes `bump-stage0` to include:
* The sha256 hash of the channel manifest used to create `src/stage0`.
* The rust and rustfmt git commit in `src/stage0`.
* Hashes of all the artifacts, like the source tarball, in `src/stage0`.
Combined this will allow for:
* Projects that bootstrap their own compiler, such as Fuchsia, or users of [bootstrap], to build their compilers offline without needing to communicate with static.rust-lang.org.
* Auditors to detect if the channel manifest, and all the artifacts inside the manifest, were modified after it was used to generate `src/stage0`. Furthermore, if they did find modified artifacts, they could determine if the Rust Signing Key was compromised by checking if any modified file was signed properly.
finally, it allows regeneration of `src/stage0` when specifying both the day of the build for rust, and the day of the build for rustfmt, which can allow a maintainer to regenerate `src/stage0` to verify nothing changed.
[bootstrap]: https://github.com/dtolnay/bootstrap
[mrustc]: https://github.com/thepowersgang/mrustc
|
|
rustdoc-search: use the same ID for entry and path to same item
This decreases the size of the compiler-doc from 57MiB to 56MiB.
r? `@GuillaumeGomez`
|
|
Remove most `#[track_caller]` from allocating Vec methods
They cause significant binary size overhead while contributing little value.
closes rust-lang/rust#146963, see that issue for more details.
|
|
|
|
Rollup of 8 pull requests
Successful merges:
- rust-lang/rust#146037 (Introduce CoerceShared lang item and trait, and basic Reborrow tests)
- rust-lang/rust#146732 (tests: relax expectations after llvm change 902ddda120a5)
- rust-lang/rust#147018 (re-order normalizations in run-make linker-warning test)
- rust-lang/rust#147032 (Fix doctest compilation time display)
- rust-lang/rust#147046 (Rename `rust.use-lld` to `rust.bootstrap-override-lld`)
- rust-lang/rust#147050 (PassWrapper: update for new PGOOptions args in LLVM 22)
- rust-lang/rust#147075 (Make `def_path_hash_to_def_id` not panic when passed an invalid hash)
- rust-lang/rust#147076 (update issue number for more_float_constants)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Make it possible to `x install` Cranelift and LLVM bitcode linker
It was not possible to install these before, as they were not in the install step description list.
Fixes: https://github.com/rust-lang/rust/issues/140331
r? `@jieyouxu`
|
|
update issue number for more_float_constants
Update issue number from https://github.com/rust-lang/rust/issues/103883 to https://github.com/rust-lang/rust/issues/146939
r? ``@tgross35``
|
|
Make `def_path_hash_to_def_id` not panic when passed an invalid hash
I'm using this function in a third-party application (Creusot) to access private items (by reverse engineering their hash). This works in the happy path, but it panics when an item does not exist. There is no way to hack it downstream because the hook `def_path_hash_to_def_id_extern` must always return a `DefId` and its implementation uses `def_path_hash_to_def_index` which is internal and which is where the panic happens.
|
|
PassWrapper: update for new PGOOptions args in LLVM 22
This changed in upstream change https://github.com/llvm/llvm-project/commit/a5569b4bd7f8d2696f962e4edaa5179895228e42.
``@rustbot`` label llvm-main
|
|
Rename `rust.use-lld` to `rust.bootstrap-override-lld`
First part of https://github.com/rust-lang/rust/issues/146640. The old option is kept for backwards compatibility, we can remove it in ~6 months, as usually.
I'm not sure if the bootstrap prefix is ideal, after all we have a bunch of other configs that only affect bootstrap's behavior and not the built artifacts. Maybe `build.override-lld`? But I don't think it matters that much, as long as it's clear that it is an override, and how does it differ from `rust.lld`.
r? ``@jieyouxu``
|
|
GuillaumeGomez:fix-doctest-compilation-time-display, r=lolbinarycat
Fix doctest compilation time display
Fixes rust-lang/rust#146960.
Small corner case that happened in case everything went fine and there was only merged doctests.
r? lolbinarycat
|
|
Fabian-Gruenbichler:mr/fix-linker-warning-test-normalization, r=jieyouxu
re-order normalizations in run-make linker-warning test
otherwise a buildroot containing `rustc[^/_-]*` or `libpanic_abort` would be mangled before being replaced by the build root placeholder value..
e.g., running `./x.py test --verbose tests/run-make/linker-warning` with rustc checked out in ~/ext/rustcfoobar will result in
```
running 1 tests
test [run-make] tests/run-make/linker-warning ... FAILED
failures:
---- [run-make] tests/run-make/linker-warning stdout ----
------rustc stdout------------------------------
------rustc stderr------------------------------
------------------------------------------
error: rmake recipe failed to complete
status: exit status: 101
command: cd "/home/user/ext/rustcfoobar/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out" && env -u RUSTFLAGS -u __RUSTC_DEBUG_ASSERTIONS_ENABLED -u __STD_DEBUG_ASSERTIONS_ENABLED AR="ar" BUILD_ROOT="/home/user/ext/rustcfoobar/build/x86_64-unknown-linux-gnu" CC="cc" CC_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64" CXX="c++" CXX_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64" HOST_RUSTC_DYLIB_PATH="/home/user/ext/rustcfoobar/build/x86_64-unknown-linux-gnu/stage1/lib" LD_LIBRARY_PATH="/home/user/ext/rustcfoobar/build/x86_64-unknown-linux-gnu/bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/home/user/ext/rustcfoobar/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" LD_LIB_PATH_ENVVAR="LD_LIBRARY_PATH" LLVM_BIN_DIR="/home/user/ext/rustcfoobar/build/x86_64-unknown-linux-gnu/ci-llvm/bin" LLVM_COMPONENTS="<..>" LLVM_FILECHECK="/home/user/ext/rustcfoobar/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" NODE="/usr/bin/node" PYTHON="/usr/bin/python3" RUSTC="/home/user/ext/rustcfoobar/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" RUSTDOC="/home/user/ext/rustcfoobar/build/x86_64-unknown-linux-gnu/stage1/bin/rustdoc" SOURCE_ROOT="/home/user/ext/rustcfoobar" TARGET="x86_64-unknown-linux-gnu" TARGET_EXE_DYLIB_PATH="/home/user/ext/rustcfoobar/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/user/ext/rustcfoobar/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake"
stdout: none
--- stderr -------------------------------
thread 'main' panicked at /home/user/ext/rustcfoobar/tests/run-make/linker-warning/rmake.rs:74:14:
test failed: `short-error.txt` is different from `(linker error)`
--- short-error.txt
+++ (linker error)
``@@`` -1,6 +1,6 ``@@``
error: linking with `./fake-linker` failed: exit status: 1
|
- = note: "./fake-linker" "-m64" "/symbols.o" "<2 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "/build-root/test/run-make/linker-warning/rmake_out/{libfoo,libbar}.rlib" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,libcfg_if-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/build-root/test/run-make/linker-warning/rmake_out" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "main" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "run_make_error"
+ = note: "./fake-linker" "-m64" "/symbols.o" "<2 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "/home/user/ext/rustc/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out/{libfoo,libbar}.rlib" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,libcfg_if-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/home/user/ext/rustc/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "main" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "run_make_error"
= note: some arguments are omitted. use `--verbose` to show all linker arguments
= note: error: baz
[..]
```
without this fix.
Note: this affected Debian's automated builds, since the buildroot contains the package name and version. while that particular issue got fixed in the meantime by accident by making the RE more strict in 77232fb9350dbe09821df27f184301475829f1e4 , other buildroot paths are still affected without a full fix.
|
|
tests: relax expectations after llvm change 902ddda120a5
LLVM 22 is able to drop assumes that seem to not help further optimizations, which actually seems to dramatically _help_ further optimizations in some of our small test cases.
I'm a little unclear how to fix the last failure, in `tests/codegen-llvm/issues/issue-122600-ptr-discriminant-update.rs`:
```
-; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: write) uwtable
+; Function Attrs: mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: readwrite, inaccessiblemem: write) uwtable
define void ``@update(ptr`` noundef captures(none) %s) unnamed_addr #0 {
start:
- %_3.sroa.0.0.copyload = load i8, ptr %s, align 1
- %0 = trunc nuw i8 %_3.sroa.0.0.copyload to i1
- %1 = xor i1 %0, true
- tail call void ``@llvm.assume(i1`` %1)
store i8 1, ptr %s, align 1
ret void
}
```
I'm just not conversant enough in LLVM IR to follow the changes here.
``@rustbot`` label llvm-main
r? nikic
|
|
Introduce CoerceShared lang item and trait, and basic Reborrow tests
Part of rust-lang/rust#145612: This introduces the `CoerceShared` trait which is the `Reborrow` equivalent of a `&mut T` -> `&T` coercion. The trait has a `Target` GAT which makes this (currently) unique in the `core/src/marker.rs`; I'm not sure if this can be considered problematic. Maybe this is not the way such things should be done at the marker trait level? Or maybe it is fine.
Improtantly, this PR introduces a battery of basic `Reborrow` and `CoerceShared` tests. These test the very basics of the feature; custom marker types intended to have exclusive semantics (`Custom<'a>(PhantomData<&'a mut ()>)`), custom exclusive reference wrappers, and standard library exclusive reference wrappers (`Pin<&mut T>` and `Option<&mut T>`). None of these of course work since the implementation for `Reborrow` and `CoerceShared` is entirely missing, but this is the first step towards making these work.
Future PRs will introduce more tests, such as "recursive" reborrowing (ie. reborrowing structs that contain multiple reborrowable fields) and checks around the lifetime semantics of reborrowing ie. that a reborrow produces a new type with the same lifetime as the original.
|
|
It enables automatic check changes of Python/C++/JS
before pushing the changes to remote repository.
Those checks happen only when the target type of file is changed.
Otherwise it does not install any dependencies (venv and/or node_modules).
Note that shellcheck and spellcheck are not included in this change, because:
1. Unlike venv/node_modules, shellcheck is not installed automatically by the command, and
2. spellcheck is built whenever pre-push script is run, it forces developer to wait extra time
So not to break the current productivity, this commit skips them.
|
|
r=fmease,camelid,Manishearth,lolbinarycat
Implement RFC 3631: add rustdoc doc_cfg features
Implementation of https://github.com/rust-lang/rfcs/pull/3631.
This implementation actually resulted in a lot of simplifications:
* All `cfg` computation is now done in one place: `propagate_doc_cfg.rs`. Because (trait) `impl`s are not retrieved at the same time as the other items, we cannot perform this computation in the clean process, it needs to be after.
* Because there is `cfg` inheritance, we can keep track of them in one place (in `propagate_doc_cfg.rs`), meaning we don't need to copy an item's attributes to its children anymore. Only exception: impl items. For them we clone only `cfg` attributes.
* `propagate_doc_cfg.rs` is also now much simpler, much less need to keep track of parents, since everything we need is handled by the new `CfgInfo` type.
* I also suspect that `Cfg::simplify_with` could either be removed or at least used directly into `propagate_doc_cfg.rs` when we compute `cfg`s. Considering how big the PR already is, I'll do it in a follow-up.
I didn't remove the `doc_cfg*` features in this PR because some dependencies used in `rustc` (like `stdarch`) are using it, so we need to have a nightly released with this PR before I can switch to the new feature.
r? ghost
|
|
Co-authored-by: David Tolnay <dtolnay@gmail.com>
|
|
|
|
|
|
This patch changes `bump-stage0` to include:
* The sha256 hash of the channel manifest used to create `src/stage0`.
* The rust and rustfmt git commit in `src/stage0`.
* Hashes of all the artifacts, like the source tarball, in `src/stage0`.
Combined this will allow for:
* Projects that bootstrap their own compiler, such as Fuchsia, or users
of [bootstrap], to build their compilers offline without needing to
communicate with static.rust-lang.org.
* Auditors to detect if the channel manifest, and all the artifacts
inside the manifest, were modified after it was used to generate
`src/stage0`. Furthermore, if they did find modified artifacts, they
could determine if the Rust Signing Key was compromised by checking if
any modified file was signed properly.
Finally, it allows regeneration of `src/stage0` when specifying both the
day of the build for rust, and the day of the build for rustfmt, which
can allow a maintainer to regenerate `src/stage0` to verify nothing
changed.
[bootstrap]: https://github.com/dtolnay/bootstrap
[mrustc]: https://github.com/thepowersgang/mrustc
|
|
JumpThreading: Avoid computing dominators to identify loop headers.
JumpThreading tries to avoid threading through loop headers to avoid creating irreducible CFGs.
However, computing dominators is expensive, and accounts up to 20 % of the runtime of the JumpThreading pass for some cases like serde.
This PR proposes to approximate according to the post-order traversal order. We define a "maybe" loop header as a block which is visited after its predecessor in post-order.
|
|
|
|
|
|
|
|
|
|
|
|
`#![feature(doc_cfg)]`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|