about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2025-06-29Auto merge of #143160 - ehuss:update-cargo, r=ehussbors-0/+0
Update cargo 7 commits in 409fed7dc1553d49cb9a8c0637d12d65571346ce..930b4f62cfcd1f0eabdb30a56d91bf6844b739bf 2025-06-23 15:55:04 +0000 to 2025-06-28 14:58:43 +0000 - Use a different lint for the `fix_only_once_for_duplicates` test (rust-lang/cargo#15713) - chore: bump to 0.91.0; update changelog (rust-lang/cargo#15710) - Add `http.proxy-cainfo` config for proxy certs (rust-lang/cargo#15374) - chore(deps): update msrv (3 versions) to v1.86 (rust-lang/cargo#15709) - chore(deps): update msrv (1 version) to v1.88 (rust-lang/cargo#15706) - Rework `cargo-test-support` & `testsuite` to use `CARGO_BIN_EXE_*` for Cargo (rust-lang/cargo#15692) - fix: Expand error messages around path dependency on `cargo package` and `cargo publish` (rust-lang/cargo#15705)
2025-06-28Update cargoEric Huss-0/+0
2025-06-28Rollup merge of #143114 - leopardracer:master, r=RalfJungMatthias Krüger-3/+3
Minor Documentation Improvements --- ## Description - Fixed typos and improved clarity in comments and documentation. ---
2025-06-28Rollup merge of #143031 - mati865:push-mutywntmvomx, r=Mark-SimulacrumMatthias Krüger-1/+3
Add windows-gnullvm hosts to the manifest I made a mistake testing https://github.com/rust-lang/rust/pull/140772 only with `rustup-toolchain-install-master` which doesn't care about the manifests. This means windows-gnullvm self-hosting will have to wait one more release, unless this change is backported to beta and a new beta release is made, which doesn't seem worth the trouble.
2025-06-28Rollup merge of #142963 - Kobzol:try-build-skip, r=jieyouxuMatthias Krüger-2/+25
Skip unnecessary components in x64 try builds We unnecessarily rebuild `wasm-component-ld`, `llvm-bitcode-linker` and Cranelift during the intermediate PGO builds several times times, which is unnecessarily and increases the duration of try builds. This PR also disables some unnecessary dist components. r? `````@jieyouxu`````
2025-06-28Auto merge of #141759 - 1c3t3a:discriminants-query, r=saethlinbors-1/+1
Insert checks for enum discriminants when debug assertions are enabled Similar to the existing null-pointer and alignment checks, this checks for valid enum discriminants on creation of enums through unsafe transmutes. Essentially this sanitizes patterns like the following: ```rust let val: MyEnum = unsafe { std::mem::transmute<u32, MyEnum>(42) }; ``` An extension of this check will be done in a follow-up that explicitly sanitizes for extern enum values that come into Rust from e.g. C/C++. This check is similar to Miri's capabilities of checking for valid construction of enum values. This PR is inspired by saethlin@'s PR https://github.com/rust-lang/rust/pull/104862. Thank you so much for keeping this code up and the detailed comments! I also pair-programmed large parts of this together with vabr-g@. r? `@saethlin`
2025-06-27Auto merge of #143116 - matthiaskrgr:rollup-zy9ez06, r=matthiaskrgrbors-27/+27
Rollup of 9 pull requests Successful merges: - rust-lang/rust#139858 (New const traits syntax) - rust-lang/rust#140809 (Reduce special casing for the panic runtime) - rust-lang/rust#142730 (suggest declaring modules when file found but module not defined) - rust-lang/rust#142806 (Normalize before computing ConstArgHasType goal in new solver) - rust-lang/rust#143046 (const validation: properly ignore zero-sized UnsafeCell) - rust-lang/rust#143092 (const checks for lifetime-extended temporaries: avoid 'top-level scope' terminology) - rust-lang/rust#143096 (tag_for_variant: properly pass TypingEnv) - rust-lang/rust#143104 (hir_analysis: prohibit `dyn PointeeSized`) - rust-lang/rust#143106 (gce: don't ICE on non-local const) Failed merges: - rust-lang/rust#143036 (Remove support for `dyn*` from the compiler) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-27Rollup merge of #143046 - RalfJung:zst-unsafe-cell, r=lcnr,oli-obkMatthias Krüger-4/+4
const validation: properly ignore zero-sized UnsafeCell Fixes https://github.com/rust-lang/rust/issues/142948 r? `@oli-obk`
2025-06-27Rollup merge of #140809 - bjorn3:panic_runtime_cleanup, r=petrochenkovMatthias Krüger-1/+2
Reduce special casing for the panic runtime See the individual commits for more info.
2025-06-27Rollup merge of #139858 - oli-obk:new-const-traits-syntax, r=fee1-deadMatthias Krüger-22/+21
New const traits syntax This PR only affects the AST and doesn't actually change anything semantically. All occurrences of `~const` outside of libcore have been replaced by `[const]`. Within libcore we have to wait for rustfmt to be bumped in the bootstrap compiler. This will happen "automatically" (when rustfmt is run) during the bootstrap bump, as rustfmt converts `~const` into `[const]`. After this we can remove the `~const` support from the parser Caveat discovered during impl: there is no legacy bare trait object recovery for `[const] Trait` as that snippet in type position goes down the slice /array parsing code and will error r? ``@fee1-dead`` cc ``@nikomatsakis`` ``@traviscross`` ``@compiler-errors``
2025-06-27Auto merge of #143064 - flip1995:clippy-subtree-update, r=GuillaumeGomezbors-843/+3158
Clippy subtree update r? `@Manishearth` Cargo.lock update due to version bump
2025-06-27Update dangling_pointer_to_raw_pointer.rsleopardracer-1/+1
2025-06-27Update README.mdleopardracer-1/+1
2025-06-27Update ui.rsleopardracer-1/+1
2025-06-27broken_links: Fix rustdoc API usagePhilipp Krones-1/+1
2025-06-27Merge commit 'c5dbd1de07e0407b9687619a868384d6de06253f' into ↵Philipp Krones-843/+3158
clippy-subtree-update
2025-06-27Add InterpCx::layout_of with tracing, shadowing LayoutOfStypox-12/+1
2025-06-27Insert checks for enum discriminants when debug assertions are enabledBastian Kersting-1/+1
Similar to the existing nullpointer and alignment checks, this checks for valid enum discriminants on creation of enums through unsafe transmutes. Essentially this sanitizes patterns like the following: ```rust let val: MyEnum = unsafe { std::mem::transmute<u32, MyEnum>(42) }; ``` An extension of this check will be done in a follow-up that explicitly sanitizes for extern enum values that come into Rust from e.g. C/C++. This check is similar to Miri's capabilities of checking for valid construction of enum values. This PR is inspired by saethlin@'s PR https://github.com/rust-lang/rust/pull/104862. Thank you so much for keeping this code up and the detailed comments! I also pair-programmed large parts of this together with vabr-g@.
2025-06-27Auto merge of #143074 - compiler-errors:rollup-cv64hdh, r=compiler-errorsbors-3/+3
Rollup of 18 pull requests Successful merges: - rust-lang/rust#137843 (make RefCell unstably const) - rust-lang/rust#140942 (const-eval: allow constants to refer to mutable/external memory, but reject such constants as patterns) - rust-lang/rust#142549 (small iter.intersperse.fold() optimization) - rust-lang/rust#142637 (Remove some glob imports from the type system) - rust-lang/rust#142647 ([perf] Compute hard errors without diagnostics in impl_intersection_has_impossible_obligation) - rust-lang/rust#142700 (Remove incorrect comments in `Weak`) - rust-lang/rust#142927 (Add note to `find_const_ty_from_env`) - rust-lang/rust#142967 (Fix RwLock::try_write documentation for WouldBlock condition) - rust-lang/rust#142986 (Port `#[export_name]` to the new attribute parsing infrastructure) - rust-lang/rust#143001 (Rename run always ) - rust-lang/rust#143010 (Update `browser-ui-test` version to `0.20.7`) - rust-lang/rust#143015 (Add `sym::macro_pin` diagnostic item for `core::pin::pin!()`) - rust-lang/rust#143033 (Expand const-stabilized API links in relnotes) - rust-lang/rust#143041 (Remove cache for citool) - rust-lang/rust#143056 (Move an ACE test out of the GCI directory) - rust-lang/rust#143059 (Fix 1.88 relnotes) - rust-lang/rust#143067 (Tracking issue number for `iter_macro`) - rust-lang/rust#143073 (Fix some fixmes that were waiting for let chains) Failed merges: - rust-lang/rust#143020 (codegen_fn_attrs: make comment more precise) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-26Fix some fixmes that were waiting for let chainsYotam Ofek-3/+3
2025-06-26Rollup merge of #141648 - GuillaumeGomez:redundant_explicit_links-expansion, ↵Matthias Krüger-2/+2
r=lolbinarycat [rustdoc] Do not emit redundant_explicit_links lint if the doc comment comes from expansion Fixes https://github.com/rust-lang/rust/issues/141553. The problem was that we change the context for the attributes in some cases to get better error output, preventing us to detect if the attribute comes from expansion. Most of the changes are about keeping track of the "does this span comes from expansion" information. r? ```@Manishearth```
2025-06-26Rollup merge of #141311 - folkertdev:tidy-natural-sort, r=jieyouxuMatthias Krüger-2/+204
make `tidy-alphabetical` use a natural sort The idea here is that these lines should be correctly sorted, even though a naive string comparison would say they are not: ``` foo2 foo10 ``` This is the ["natural sort order"](https://en.wikipedia.org/wiki/Natural_sort_order). There is more discussion in [#t-compiler/help > tidy natural sort](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/tidy.20natural.20sort/with/519111079) Unfortunately, no standard sorting tools are smart enough to to this automatically (casting some doubt on whether we should make this change). Here are some sort outputs: ``` > cat foo.txt | sort foo foo1 foo10 foo2 mp mp1e2 np", np1e2", > cat foo.txt | sort -n foo foo1 foo10 foo2 mp mp1e2 np", np1e2", > cat foo.txt | sort -V foo foo1 foo2 foo10 mp mp1e2 np1e2", np", ``` Disappointingly, "numeric" sort does not actually have the behavior we want. It only sorts by numeric value if the line starts with a number. The "version" sort looks promising, but does something very unintuitive if you look at the final 4 values. None of the other options seem to have the desired behavior in all cases: ``` -b, --ignore-leading-blanks ignore leading blanks -d, --dictionary-order consider only blanks and alphanumeric characters -f, --ignore-case fold lower case to upper case characters -g, --general-numeric-sort compare according to general numerical value -i, --ignore-nonprinting consider only printable characters -M, --month-sort compare (unknown) < 'JAN' < ... < 'DEC' -h, --human-numeric-sort compare human readable numbers (e.g., 2K 1G) -n, --numeric-sort compare according to string numerical value -R, --random-sort shuffle, but group identical keys. See shuf(1) --random-source=FILE get random bytes from FILE -r, --reverse reverse the result of comparisons --sort=WORD sort according to WORD: general-numeric -g, human-numeric -h, month -M, numeric -n, random -R, version -V -V, --version-sort natural sort of (version) numbers within text ``` r? ```@Noratrieb``` (it sounded like you know this code?)
2025-06-26Rename `tilde const` test files to `conditionally const`Oli Scherer-1/+0
2025-06-26Change const trait bound syntax from ~const to [const]Oli Scherer-21/+21
2025-06-26make size_and_align_of_mplace work on all projectableRalf Jung-4/+4
2025-06-26Add windows-gnullvm hosts to the manifestMateusz Mikuła-1/+3
2025-06-25make `tidy-alphabetical` use a natural sortFolkert de Vries-2/+204
2025-06-25Rollup merge of #142809 - KMJ-007:ad-type-analysis-flag, r=ZuseZ4Jana Dönszelmann-0/+0
Add PrintTAFn flag for targeted type analysis printing ## Summary This PR adds a new `PrintTAFn` flag to the `-Z autodiff` option that allows printing type analysis information for a specific function, rather than all functions. ## Changes ### New Flag - Added `PrintTAFn=<function_name>` option to `-Z autodiff` - Usage: `-Z autodiff=Enable,PrintTAFn=my_function_name` ### Implementation Details - **Rust side**: Added `PrintTAFn(String)` variant to `AutoDiff` enum - **Parser**: Updated `parse_autodiff` to handle `PrintTAFn=<function_name>` syntax with proper error handling - **FFI**: Added `set_print_type_fun` function to interface with Enzyme's `FunctionToAnalyze` command line option - **Documentation**: Updated help text and documentation for the new flag ### Files Modified - `compiler/rustc_session/src/config.rs`: Added `PrintTAFn(String)` variant - `compiler/rustc_session/src/options.rs`: Updated parser and help text (now shows `PrintTAFn` in the list) - `compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs`: Added FFI function and static variable - `compiler/rustc_codegen_llvm/src/back/lto.rs`: Added handling for new flag - `src/doc/rustc-dev-guide/src/autodiff/flags.md`: Updated documentation - `src/doc/unstable-book/src/compiler-flags/autodiff.md`: Updated documentation ## Testing The flag can be tested with: ```bash rustc +enzyme -Z autodiff=Enable,PrintTAFn=square test.rs ``` This will print type analysis information only for the function named "square" instead of all functions. ## Error Handling The parser includes proper error handling: - Missing argument: `PrintTAFn` without `=<function_name>` will show an error - Unknown options: Invalid autodiff options will be reported r? ```@ZuseZ4```
2025-06-25Remove `mut`Jakub Beránek-2/+2
2025-06-25Skip more dist componentsJakub Beránek-0/+5
2025-06-25Skip unnecessary components in x64 try buildsJakub Beránek-4/+22
2025-06-25Auto merge of #142997 - workingjubilee:rollup-6lxec87, r=workingjubileebors-3/+24
Rollup of 15 pull requests Successful merges: - rust-lang/rust#135731 (Implement parsing of pinned borrows) - rust-lang/rust#138780 (Add `#[loop_match]` for improved DFA codegen) - rust-lang/rust#142453 (Windows: make `read_dir` stop iterating after the first error is encountered) - rust-lang/rust#142633 (Error on invalid signatures for interrupt ABIs) - rust-lang/rust#142768 (Avoid a bitcast FFI call in transmuting) - rust-lang/rust#142825 (Port `#[track_caller]` to the new attribute system) - rust-lang/rust#142844 (Enable short-ice for Windows) - rust-lang/rust#142934 (Tweak `-Zmacro-stats` measurement.) - rust-lang/rust#142955 (Couple of test suite fixes for cg_clif) - rust-lang/rust#142977 (rustdoc: Don't mark `#[target_feature]` functions as ⚠) - rust-lang/rust#142980 (Reduce mismatched-lifetime-syntaxes suggestions to MaybeIncorrect) - rust-lang/rust#142982 (Corrected spelling mistake in c_str.rs) - rust-lang/rust#142983 (Taint body on invalid call ABI) - rust-lang/rust#142988 (Update wasm-component-ld to 0.5.14) - rust-lang/rust#142993 (Update cargo) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-24Rollup merge of #142993 - ehuss:update-cargo, r=ehussJubilee-0/+0
Update cargo 2 commits in 84709f085062cbf3c51fa507527c1b2334015178..409fed7dc1553d49cb9a8c0637d12d65571346ce 2025-06-22 23:58:39 +0000 to 2025-06-23 15:55:04 +0000 - Fix potential deadlock in `CacheState::lock` (rust-lang/cargo#15698) - feat(toml): Parse support for multiple build scripts (rust-lang/cargo#15630)
2025-06-24Rollup merge of #142988 - alexcrichton:update-wasm-component-ld, ↵Jubilee-1/+2
r=Mark-Simulacrum Update wasm-component-ld to 0.5.14 This brings in a few updates to the bundled `wasm-component-ld` dependency used by the `wasm32-wasip2` target. This primarily includes support for upcoming component model async/WASIp3 support which will be convenient to have native support for a few months from now.
2025-06-24Rollup merge of #142825 - jdonszelmann:track-caller, r=oli-obkJubilee-2/+3
Port `#[track_caller]` to the new attribute system r? ``@oli-obk`` depends on https://github.com/rust-lang/rust/pull/142493 Closes rust-lang/rust#142783 (didn't add a test for this, this situation should simply never come up again, the code was simply wrong. lmk if I should add it, but it won't test something very useful)
2025-06-24Rollup merge of #135731 - frank-king:feature/pin-borrow, r=eholk,traviscrossJubilee-0/+19
Implement parsing of pinned borrows This PR implements part of #130494. EDIT: It introduces `&pin mut $place` and `&pin const $place` as sugars for `std::pin::pin!($place)` and its shared reference equivalent, except that `$place` will not be moved when borrowing. The borrow check will be in charge of enforcing places cannot be moved or mutably borrowed since being pinned till dropped. ### Implementation steps: - [x] parse the `&pin mut $place` and `&pin const $place` syntaxes - [ ] borrowck of `&pin mut|const` - [ ] support autoref of `&pin mut|const` when needed
2025-06-25submodule updateKaran Janthe-0/+0
Signed-off-by: Karan Janthe <karanjanthe@gmail.com>
2025-06-25Auto merge of #140999 - hkBst:update-escaper, r=nnethercotebors-4/+5
update to literal-escaper 0.0.4 for better API without `unreachable` and faster string parsing This is the replacement for just the part of https://github.com/rust-lang/rust/pull/138163 dealing with the changed API of unescape functionality, since that got moved into its own crate. <del>This uses an unpublished version of literal-escaper (https://github.com/rust-lang/literal-escaper/pull/8).</del> r? `@nnethercote`
2025-06-24Update cargoEric Huss-0/+0
2025-06-24Update wasm-component-ld to 0.5.14Alex Crichton-1/+2
This brings in a few updates to the bundled `wasm-component-ld` dependency used by the `wasm32-wasip2` target. This primarily includes support for upcoming component model async/WASIp3 support which will be convenient to have native support for a few months from now.
2025-06-24fix clippyJana Dönszelmann-2/+3
2025-06-24Avoid exporting panic_unwind as stdlib cargo featurebjorn3-1/+1
There is already panic-unwind to enable it.
2025-06-24Add all rustc_std_internal_symbol to symbols.objorn3-0/+1
rustc_std_internal_symbol is meant to call functions from crates where there is no direct dependency on said crate. As they either have to be added to symbols.o or rustc has to introduce an implicit dependency on them to avoid linker errors. The latter is done for some things like the panic runtime, but adding these symbols to symbols.o allows removing those implicit dependencies.
2025-06-24Auto merge of #142959 - bjorn3:sync_cg_clif-2025-06-24, r=bjorn3bors-0/+3
Subtree sync for rustc_codegen_cranelift The main highlight this time is a Cranelift update. r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
2025-06-24Rollup merge of #142843 - dpaoliello:reproducible-build-2, r=jieyouxuGuillaume Gomez-1/+7
Enable reproducible-build-2 for Windows MSVC Works with MSVC if instructing the linker to avoid timestamps and deleting the PDB between compilations. Addresses item in rust-lang/rust#128602 --- try-job: x86_64-mingw-* try-job: x86_64-msvc-* try-job: i686-msvc-*
2025-06-24Rollup merge of #142704 - tgross35:remove-concat_idents, r=fee1-deadGuillaume Gomez-3/+1
Remove the deprecated unstable `concat_idents!` macro In [rust-lang/rust#137653], the lang and libs-API teams did a joint FCP to deprecate and eventually remove the long-unstable `concat_idents!` macro. The deprecation is landing in 1.88, so do the removal here (target version 1.90). This macro has been superseded by the more recent `${concat(...)}` metavariable expression language feature, which avoids some of the limitations of `concat_idents!`. The metavar expression is unstably available under the [`macro_metavar_expr_concat`] feature. History is mildly interesting here: `concat_idents!` goes back to 2011 when it was introduced with 513276e595f8 ("Add #concat_idents[] and #ident_to_str[]"). The syntax looks a bit different but it still works about the same: let asdf_fdsa = "<.<"; assert(#concat_idents[asd,f_f,dsa] == "<.<"); assert(#ident_to_str[use_mention_distinction] == "use_mention_distinction"); (That test existed from introduction until its removal here.) Closes: https://github.com/rust-lang/rust/issues/29599 [rust-lang/rust#137653]: https://github.com/rust-lang/rust/pull/137653 [`macro_metavar_expr_concat`]: https://github.com/rust-lang/rust/issues/124225
2025-06-24Update tidy exceptionsbjorn3-0/+3
2025-06-24Move some `issues-*` tests to better homesTrevor Gross-3/+1
These tests were updated in the previous commit; while they are being cleaned up, move them to a non-issue directory.
2025-06-24Rollup merge of #140622 - petrochenkov:annusexp, r=jieyouxuGuillaume Gomez-76/+159
compiletest: Improve diagnostics for line annotation mismatches When some line annotations are missing or misplaced, compiletest reports an error, but the error is not very convenient. This PR attempts to improve the user experience. - The "expected ... not found" messages are no longer duplicated. - The `proc_res.status` and `proc_res.cmdline` message is no longer put in the middle of other messages describing the annotation mismatches, it's now put into the end. - Compiletest now makes suggestions if there are fuzzy matches between expected and actually reported errors (e.g. the annotation is put on a wrong line). - Missing diagnostic kinds are no longer produce an error eagerly, but instead treated as always mismatching kinds, so they can produce suggestions telling the right kind. I'll post screenshots in the thread below, but the behavior shown on the screenshots can be reproduced locally using the new test `tests/ui/compiletest-self-test/line-annotation-mismatches.rs`. This also fixes https://github.com/rust-lang/rust/issues/140940. r? ``@jieyouxu``
2025-06-23Enable reproducible-build-2 for WindowsDaniel Paoliello-1/+7