summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2025-02-17change `literal_string_with_formatting_args` lint category to nursery (#14014)Alex Macleod-1/+1
This PR changes literal_string_with_formatting_args category from `suspicious` to `nursery` since there are thousands of false positive on GitHub. Closes #13989 since it's no longer problematic with such false positive with ~~`pedantic`~~ `nursery` category. changelog: [`literal_string_with_formatting_args` ] change category to `nursery` from `suspicious`
2025-02-06Revert "Auto merge of #134330 - scottmcm:no-more-rvalue-len, r=matthewjasper"Rémy Rakic-1/+1
This reverts commit e108481f74ff123ad98a63bd107a18d13035b275, reversing changes made to 303e8bd768526a5812bb1776e798e829ddb7d3ca. (cherry picked from commit ca1c17c88d1f625763859396ba7a50f36ac45cc0)
2025-02-01Rollup merge of #136312 - compiler-errors:overflow_delimited_expr-2024, r=ytmimiJacob Pratt-37/+51
Disable `overflow_delimited_expr` in edition 2024 This reverts the style guide changes and sets the default to "false" in rustfmt for style edition 2024. r? `@ytmimi` cc `@rust-lang/style` `@rust-lang/rustfmt`
2025-02-01Disable some incorrect rust-analyzer diagnostics on betaLukas Wirth-4/+4
2025-01-16Backport rust-lang/rust-analyzer#18760: internal: Workaround salsa cycles ↵Lukas Wirth-5/+10
leaking
2025-01-07rustfmt: drop nightly-gating of the `--style-edition` flag registration许杰友 Jieyou Xu (Joe)-6/+6
2025-01-03Rollup merge of #131729 - Urgau:check-cfg-test-userspace, r=petrochenkovMatthias Krüger-2/+3
Make the `test` cfg a userspace check-cfg This PR implements MCP https://github.com/rust-lang/compiler-team/issues/785, which makes the `test` cfg a "userspace" check-cfg, i.e. no longer included in the well known cfg list. Things to do: - [x] Accept the MCP (https://github.com/rust-lang/compiler-team/issues/785#issuecomment-2424121886) - [x] Mark `test` in Cargo (https://github.com/rust-lang/cargo/pull/14963) `@rustbot` labels +S-waiting-on-MCP +F-check_cfg r? `@petrochenkov`
2025-01-02Auto merge of #122565 - Zoxc:atomic-panic-msg, r=the8472bors-0/+58
Try to write the panic message with a single `write_all` call This writes the panic message to a buffer before writing to stderr. This allows it to be printed with a single `write_all` call, preventing it from being interleaved with other outputs. It also adds newlines before and after the message ensuring that only the panic message will have its own lines. Before: ``` thread 'thread 'thread 'thread 'thread '<unnamed>thread 'thread 'thread 'thread '<unnamed><unnamed>thread '<unnamed>' panicked at ' panicked at <unnamed><unnamed><unnamed><unnamed><unnamed>' panicked at <unnamed>' panicked at src\heap.rssrc\heap.rs' panicked at ' panicked at ' panicked at ' panicked at ' panicked at src\heap.rs' panicked at src\heap.rs::src\heap.rssrc\heap.rssrc\heap.rssrc\heap.rssrc\heap.rs:src\heap.rs:455455:::::455:455::455455455455455:455:99:::::9:9: : 999: 999: assertion failed: size <= (*queue).block_size: : assertion failed: size <= (*queue).block_size: assertion failed: size <= (*queue).block_size: : : assertion failed: size <= (*queue).block_sizeassertion failed: size <= (*queue).block_sizeassertion failed: size <= (*queue).block_size assertion failed: size <= (*queue).block_size assertion failed: size <= (*queue).block_sizeassertion failed: size <= (*queue).block_sizeerror: process didn't exit successfully: `target\debug\direct_test.exe` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN) ``` After: ``` thread '<unnamed>' panicked at src\heap.rs:455:9: assertion failed: size <= (*queue).block_size thread '<unnamed>' panicked at src\heap.rs:455:9: assertion failed: size <= (*queue).block_size thread '<unnamed>' panicked at src\heap.rs:455:9: assertion failed: size <= (*queue).block_size error: process didn't exit successfully: `target\debug\direct_test.exe` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN) ``` --- try-jobs: x86_64-gnu-llvm-18
2025-01-02Make the `test` cfg a "userspace" check-cfgUrgau-2/+3
2025-01-01Rollup merge of #134973 - ericlehong:fix-typo, r=GuillaumeGomezMatthias Krüger-3/+3
Fix typos This PR fixes typos errors in comments and docs. Thank you very much.
2025-01-01Try to write the panic message with a single `write_all` callJohn Kåre Alsaker-0/+58
2025-01-01Auto merge of #134988 - tgross35:rollup-s59bx7c, r=tgross35bors-0/+3
Rollup of 8 pull requests Successful merges: - #132474 (Add more mailmap entries) - #133486 (borrowck diagnostics: make `add_move_error_suggestions` use the HIR rather than `SourceMap`) - #134861 (Add GUI test for item info elements color) - #134968 (Print how to rebless Python formatting in tidy) - #134971 (chore: fix typos) - #134972 (add .mailmap entry for myself) - #134974 (Revert #119515 single line where clause style guide) - #134975 (Revert style guide rhs break) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-31Rollup merge of #134968 - Kobzol:tidy-bless-log, r=NoratriebTrevor Gross-0/+3
Print how to rebless Python formatting in tidy Suggested [here](https://github.com/rust-lang/rust/pull/134964#discussion_r1900124882). r? ``@Noratrieb``
2024-12-31Update cargoWeihang Lo-0/+0
2024-12-31Print how to rebless Python formatting in tidyJakub Beránek-0/+3
2024-12-31Rollup merge of #134918 - ChrisDenton:issue-70093, r=jieyouxuMatthias Krüger-2/+0
Windows: Enable issue 70093 link tests Tracking issue for `-Z link-native-libraries`: #134948 Tracking issue for `-Z link-directives`: #134947 `-Zlink-native-libraries=no` and `-Zlink-directives=no` *should* work on Windows, at least for msvc. The fly in ointment is that `default-linker-libraries` doesn't. On unixy platforms rustc calls another compiler which in turn calls the linker along with the default libraries. On MSVC rustc calls the linker directly therefore it would need to be the one to implement `default-linker-libraries`. Except it doesn't so we workaround that in the test by using `-C link-arg` to talk to the linker.
2024-12-31Fix typosericlehong-3/+3
Signed-off-by: ericlehong <193237094+ericlehong@users.noreply.github.com>
2024-12-31Auto merge of #134929 - compiler-errors:style-edition-2024, r=ytmimibors-10/+6
Stabilize `style_edition = "2024"` in-tree This PR stabilizes the `style_edition` flag in rustfmt. **Why am I doing this in-tree?** The beta release cut is imminent (according to forge, on January 3) and this is the most lightweight approach to getting this flag stable on nightly. It's imperative (as far as I can tell -- `@traviscross` can verify or disagree) that we stabilize the `style_edition` flag so that users can control their style edition separately from the edition. I'm happy to move this PR to the rustfmt repo and subsequently prepare a subtree sync if someone on `@rust-lang/rustfmt` believes that we should get this landed on the rustfmt side then synced. If this is the right recourse, I'd like to note that this is still quite time-sensitive. However, I'm happy to dedicate time to get this done if necessary, since I'd really like to un-jeopardize the style edition. Tracking: - https://github.com/rust-lang/rust/issues/123799
2024-12-31Stabilize style_edition 2024 in-treeMichael Goulet-10/+6
2024-12-30Auto merge of #134757 - RalfJung:const_swap, r=scottmcmbors-10/+60
stabilize const_swap libs-api FCP passed in https://github.com/rust-lang/rust/issues/83163. However, I only just realized that this actually involves an intrinsic. The intrinsic could be implemented entirely with existing stable const functionality, but we choose to make it a primitive to be able to detect more UB. So nominating for `@rust-lang/lang` to make sure they are aware; I leave it up to them whether they want to FCP this. While at it I also renamed the intrinsic to make the "nonoverlapping" constraint more clear. Fixes #83163
2024-12-30Windows: Enable issue 70093 link testsChris Denton-2/+0
2024-12-30Rollup merge of #134922 - ericlehong:fix/typos, r=lqdMatthias Krüger-1/+1
Fix typos This PR fixes typos errors in comments, docs and logs. Thank you very much.
2024-12-30Rollup merge of #134911 - HigherOrderLogic:master, r=onur-ozkanMatthias Krüger-3/+3
chore: fix typos This PR fixes typos errors in docstring only, so functionality wise, it should stay the same.
2024-12-30fmtRalf Jung-2/+2
Co-authored-by: scottmcm <scottmcm@users.noreply.github.com>
2024-12-30Fix typosericlehong-1/+1
Signed-off-by: ericlehong <193237094+ericlehong@users.noreply.github.com>
2024-12-30chore: fix typosHoru-3/+3
2024-12-30Auto merge of #134865 - clubby789:proc-macro-tls, r=onur-ozkanbors-4/+75
bootstrap: Don't apply -Ztls-model=initial-exec to deps of proc-macros Fixes #134863 1. Checks if a crate name is in a static list before applying the flag 2. Adds a tidy check that gathers transitive deps of proc macros and ensures the list is up to date cc `@bjorn3` - the issue specifies `rustc_fluent_macro` but I assume this applies to all proc macro crates.
2024-12-29Add tidy check for list of proc-macro crate transitive dependenciesclubby789-4/+75
2024-12-29Auto merge of #134867 - rust-lang:cargo_update, r=clubby789bors-14/+14
Weekly `cargo update` Automation to keep dependencies in `Cargo.lock` current. The following is the output from `cargo update`: ```txt compiler & tools dependencies: Locking 8 packages to latest compatible versions Updating anyhow v1.0.94 -> v1.0.95 Updating glob v0.3.1 -> v0.3.2 Updating quote v1.0.37 -> v1.0.38 Updating rustversion v1.0.18 -> v1.0.19 Updating serde v1.0.216 -> v1.0.217 Updating serde_derive v1.0.216 -> v1.0.217 Updating syn v2.0.90 -> v2.0.93 Updating unicase v2.8.0 -> v2.8.1 note: pass `--verbose` to see 36 unchanged dependencies behind latest library dependencies: Locking 0 packages to latest compatible versions note: pass `--verbose` to see 5 unchanged dependencies behind latest rustbook dependencies: Locking 7 packages to latest compatible versions Updating anyhow v1.0.94 -> v1.0.95 Updating cc v1.2.5 -> v1.2.6 Updating quote v1.0.37 -> v1.0.38 Updating serde v1.0.216 -> v1.0.217 Updating serde_derive v1.0.216 -> v1.0.217 Updating syn v2.0.90 -> v2.0.93 Updating unicase v2.8.0 -> v2.8.1 ```
2024-12-29cargo updategithub-actions-14/+14
compiler & tools dependencies: Locking 8 packages to latest compatible versions Updating anyhow v1.0.94 -> v1.0.95 Updating glob v0.3.1 -> v0.3.2 Updating quote v1.0.37 -> v1.0.38 Updating rustversion v1.0.18 -> v1.0.19 Updating serde v1.0.216 -> v1.0.217 Updating serde_derive v1.0.216 -> v1.0.217 Updating syn v2.0.90 -> v2.0.93 Updating unicase v2.8.0 -> v2.8.1 note: pass `--verbose` to see 36 unchanged dependencies behind latest library dependencies: Locking 0 packages to latest compatible versions note: pass `--verbose` to see 5 unchanged dependencies behind latest rustbook dependencies: Locking 7 packages to latest compatible versions Updating anyhow v1.0.94 -> v1.0.95 Updating cc v1.2.5 -> v1.2.6 Updating quote v1.0.37 -> v1.0.38 Updating serde v1.0.216 -> v1.0.217 Updating serde_derive v1.0.216 -> v1.0.217 Updating syn v2.0.90 -> v2.0.93 Updating unicase v2.8.0 -> v2.8.1
2024-12-29Simplify `DebuggerCommands::parse_from` to only take one prefixZalathar-20/+11
2024-12-29Remove the unused `cdbg-*` debugger directive prefixZalathar-7/+1
There are no tests in `tests/debuginfo` that use this prefix.
2024-12-28Rollup merge of #134840 - Zalathar:normalize, r=jieyouxuStuart Cook-22/+25
compiletest: Only pass the post-colon value to `parse_normalize_rule` Addresses one of the FIXMEs noted in #134759. I started working on the other FIXME, but it became complex enough that I wanted to split it off from this PR. r? jieyouxu
2024-12-28Rollup merge of #134829 - jieyouxu:migrate-libs-through-symlinks, r=lqdStuart Cook-1/+0
Migrate `libs-through-symlink` to rmake.rs Part of https://github.com/rust-lang/rust/issues/121876. This PR migrates `tests/run-make/libs-through-symlink/` to use rmake.rs. - Regression test for #13890. - Original fix PR is #13903. - Document test intent, backlink to #13890 and fix PR #13903. - Fix the test logic: the `Makefile` version seems to not actually be exercising the "library search traverses symlink" logic, because the actual symlinked-to-library is present under the `$(TMPDIR)` directory tree when `bar.rs` is compiled, because the `$(RUSTC)` invocation has an implicit `-L $(TMPDIR)`. The symlink itself was actually broken, i.e. it should've been `ln -nsf $(TMPDIR)/outdir/$(NAME) $(TMPDIR)` but it used `ln -nsf outdir/$(NAME) $(TMPDIR)`. The rmake.rs version now explicitly separates the two directory trees and sets the CWD of the `bar.rs` rustc invocation so that the actual library is *not* present under its CWD tree. I.e. it is now ``` $test_output/ # rustc foo.rs -o actual_lib_dir/libfoo.rlib actual_lib_dir/ libfoo.rlib symlink_lib_dir/ # CWD set; rustc -L . bar.rs libfoo.rlib --> $test_output/actual_lib_dir/libfoo.rlib ``` Partially supersedes #129011. This PR is co-authored with `@Oneirical.` r? compiler
2024-12-28tests: migrate `branch-protection-check-IBT` to rmake.rs许杰友 Jieyou Xu (Joe)-1/+0
- The Makefile version *never* ran because of Makefile syntax confusion. - The test would've always failed because precompiled std is not built with `-Z cf-protection=branch`, but linkers require all input object files to indicate IBT support in order to enable IBT for the executable, which is not the case for std. - Thus, the test input file is instead changed to a `no_std` + `no_core` program. Co-authored-by: Jerry Wang <jerrylwang123@gmail.com> Co-authored-by: Oneirical <manchot@videotron.ca>
2024-12-28tests: migrate `libs-through-symlink` to rmake.rs许杰友 Jieyou Xu (Joe)-1/+0
- Document test intent, backlink to #13890 and fix PR #13903. - Fix the test logic: the `Makefile` version seems to not actually be exercising the "library search traverses symlink" logic, because the actual symlinked-to-library is present under the directory tree when `bar.rs` is compiled, because the `$(RUSTC)` invocation has an implicit `-L $(TMPDIR)`. The symlink itself was actually broken, i.e. it should've been `ln -nsf $(TMPDIR)/outdir/$(NAME) $(TMPDIR)` but it used `ln -nsf outdir/$(NAME) $(TMPDIR)`. Co-authored-by: Oneirical <manchot@videotron.ca>
2024-12-28compiletest: Make a FIXME for escaped newlines less confusingZalathar-1/+3
The old FIXME implies that we don't support escaped newlines, but in fact it was added in the same patch that added support for escaped newlines. The new FIXME makes it clear that we do currently support this, and that the FIXME is for doing so in a less ad-hoc way.
2024-12-28compiletest: Only pass the post-colon value to `parse_normalize_rule`Zalathar-21/+22
2024-12-27Rollup merge of #134809 - clubby789:nocapture, r=jieyouxuMatthias Krüger-1/+7
Add `--no-capture`/`--nocapture` as bootstrap arguments I often try `x test ... --nocapture` => 'unknown argument' => `x test ... -- --nocapture`. As we forward several other compiletest flags, let's recognise this one in bootstrap as well.
2024-12-27Rollup merge of #134808 - clubby789:compiletest-remove-stderr, r=jieyouxuMatthias Krüger-37/+81
compiletest: Remove empty 'expected' files when blessing Fixes #134793 Fixes #134196 This also refactors `compare_output` to return an enum; returning a usize was done for convenience but is misleading
2024-12-27Rollup merge of #134816 - Integral-Tech:pathbuf-refactor, r=lqd许杰友 Jieyou Xu (Joe)-2/+2
tools: fix build failure caused by PR #134420 Someone reports build failure after merging pull request #134420: https://github.com/rust-lang/rust/pull/134420#discussion_r1898081258 This pull request fixes the build failure.
2024-12-27compiletest: Remove/don't write empty 'expected' filesclubby789-37/+81
2024-12-27compiletest: Replace `--nocapture` with `--no-capture`clubby789-1/+7
2024-12-27Remove the `-test` suffix from normalize directivesZalathar-8/+7
2024-12-27Don't use `parse_cfg_name_directive` for normalize directivesZalathar-16/+49
This is a little more verbose, but also more explicit, and avoids invoking the full condition engine when only the pointer-width conditions are used.
2024-12-27tools: fix build failure caused by PR #134420Integral-2/+2
2024-12-26Auto merge of #134795 - GuillaumeGomez:rollup-9x8n7pi, r=GuillaumeGomezbors-1/+0
Rollup of 4 pull requests Successful merges: - #134656 (Migrate `incr-add-rust-src-component` to rmake) - #134664 (Account for removal of multiline span in suggestion) - #134772 (Improve/cleanup rustdoc code) - #134781 (Add more `begin_panic` normalizations to panic backtrace tests) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-26Rollup merge of #134656 - jieyouxu:migrate-incr-add-rust-src-component, ↵Guillaume Gomez-1/+0
r=wesleywiser Migrate `incr-add-rust-src-component` to rmake This PR partially supersedes #128562, and ports the Makefile-based `tests/run-make/incr-add-rust-src-component` to use rmake.rs infra. Part of #121876. This run-make test is a regression test for https://github.com/rust-lang/rust/issues/70924. It (tries to) checks that if we add the `rust-src` component in between two incremental compiles, that the compiler doesn't ICE on the second invocation. - Original issue:https://github.com/rust-lang/rust/issues/70924 - Fix PR: https://github.com/rust-lang/rust/pull/72767 - PR adding this regression test: https://github.com/rust-lang/rust/pull/72952 However, the Makefile version of this used `$SYSROOT/lib/rustlib/src/rust/src/libstd/lib.rs`, but that actually got moved around and reorganized over the years. As of Dec 2024, the `rust-src` component is more like (specific for our purposes): ``` $SYSROOT/lib/rustlib/src/rust/ library/std/src/lib.rs src/ ``` However, this run-make test is ancient and it exercises incr-comp system logic. I'm not sure if this test would actually catch the original regression. This PR was co-authored with `@Oneirical.` r? incremental try-job: i686-msvc try-job: x86_64-mingw-1 try-job: x86_64-msvc try-job: aarch64-apple
2024-12-26Auto merge of #134788 - flip1995:clippy-subtree-update, r=matthiaskrgrbors-1415/+6002
Clippy subtree update r? `@Manishearth`
2024-12-26Merge commit '609cd310be44677ae31d452a17b0f8207e1abfe1' into ↵Philipp Krones-1415/+6002
clippy-subtree-update