about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-06-20Auto merge of #142794 - tgross35:rollup-iae7okj, r=tgross35bors-757/+997
Rollup of 9 pull requests Successful merges: - rust-lang/rust#142331 (Add `trim_prefix` and `trim_suffix` methods for both `slice` and `str` types.) - rust-lang/rust#142491 (Rework #[cold] attribute parser) - rust-lang/rust#142494 (Fix missing docs in `rustc_attr_parsing`) - rust-lang/rust#142495 (Better template for `#[repr]` attributes) - rust-lang/rust#142497 (Fix random failure when JS code is executed when the whole file was not read yet) - rust-lang/rust#142575 (Ensure copy* intrinsics also perform the static self-init checks) - rust-lang/rust#142650 (Refactor Translator) - rust-lang/rust#142713 (mbe: Refactor transcription) - rust-lang/rust#142755 (rustdoc: Remove `FormatRenderer::cache`) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-20Fix false positive of `borrow_deref_ref` (#14967)Timo-4/+137
If a reborrow is itself borrowed mutably, do not propose to replace it by the original reference. Fixes: rust-lang/rust-clippy#14934 changelog: [`borrow_deref_ref`]: do not propose replacing a reborrow by the original reference if the reborrow is itself mutably borrowed
2025-06-20`Sugg`: do not parenthesize a double unary operator (#14983)Jason Newcomb-3/+23
For example, adding `*` in front of `*expression` is best shown as `**expression` rather than `*(*expression)`. This is not perfect, as it checks whether the operator is already a prefix of the expression, but it is better than it was before. For example, `&`+`&mut x` will get `&&mut x` but `&mut `+`&x` will get `&mut (&x)` as it did before this change. changelog: none
2025-06-20[PERF] Don't spawn so many compilers (3/2) (19m -> 250k) (#15030)Timo-4/+150
Optimize `needless_doctest_main`, make it short-circuit, make sure that we don't spin up a new compiler on EVERY code block. --- The old implementation was creating a new compiler, new parser, new thread, new SessionGlobals, new everything for each code block. No matter if they actually didn't even contain `fn main()` or anything relevant. On callgrind, seems that we're reducing about a 6.7242% de cycle count (which turns out to be a 38 million instruction difference, great!). Benchmarked in `bumpalo-3.16.0`. Also on bumpalo we spawn 78 less threads. This moves `SessionGlobals::new` from the top time-consuming function by itself in some benchmarks, into one not even in the top 500. Also, populate the test files. changelog:[`needless_doctest_main`]: Avoid spawning so many threads in unnecessary circumstances
2025-06-20Fix `manual_ok_err` suggests wrongly with references (#15053)Jason Newcomb-4/+108
Closes rust-lang/rust-clippy#15051 changelog: [`manual_ok_err`] fix wrong suggestions with references
2025-06-20Fix `branches_sharing_code` suggests misleadingly when in assignment (#15076)Jason Newcomb-3/+71
The lint will note `the end suggestion probably needs some adjustments to use the expression result correctly` when the expr's is not unit. So I extend this note to also appear when the expr is in an assignment. changelog: [`branches_sharing_code`] fix misleading suggestions when in assignment
2025-06-20configure.py: fix edge casebinarycat-1/+1
2025-06-20lint Option::get_or_insert and Result::map_or tooklensy-44/+124
2025-06-20Add an attribute-related parenthesization edge caseDavid Tolnay-0/+6
2025-06-20Insert parentheses around binary operation with attributeDavid Tolnay-12/+38
2025-06-20Add AST pretty-printer tests involving attr on binary operationDavid Tolnay-0/+9
This test currently fails (as expected). --- stderr ------------------------------- Pretty-printer lost necessary parentheses BEFORE: #[attr] (1 + 1) AFTER: #[attr] 1 + 1 Pretty-printer lost necessary parentheses BEFORE: #[attr] (1 as T) AFTER: #[attr] 1 as T Pretty-printer lost necessary parentheses BEFORE: #[attr] (x = 1) AFTER: #[attr] x = 1 Pretty-printer lost necessary parentheses BEFORE: #[attr] (x += 1) AFTER: #[attr] x += 1 ------------------------------------------
2025-06-20fmtNia Espera-7/+6
2025-06-20Update src/shims/trace/parent.rsNia-4/+5
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
2025-06-20error reworkNia Espera-33/+17
2025-06-20Recover from semicolon field separatorCameron Steffen-24/+27
2025-06-20Make fail-fast unstableMartin Pool-1/+3
2025-06-20nonnullsNia Espera-22/+18
2025-06-20libtest: expose --fail-fastMartin Pool-1/+13
2025-06-20cfg ifNia Espera-4/+1
2025-06-20fix dumb mistakeNia Espera-1/+6
2025-06-20supervisor bits of ffi ptracingNia Espera-81/+606
2025-06-20Auto merge of #142795 - Kobzol:rollup-vvnnjno, r=Kobzolbors-261/+550
Rollup of 10 pull requests Successful merges: - rust-lang/rust#142629 (Add config builder for bootstrap tests) - rust-lang/rust#142715 (correct template for `#[align]` attribute) - rust-lang/rust#142720 (De-dup common code from `ExternalCrate` methods) - rust-lang/rust#142736 (add issue template for rustdoc) - rust-lang/rust#142743 (rustc-dev-guide subtree update) - rust-lang/rust#142744 (Add a mailmap entry for y21) - rust-lang/rust#142758 (Make sure to rebuild rustdoc if `src/rustdoc-json-types` is changed) - rust-lang/rust#142764 (Convert `ilog(10)` to `ilog10()`) - rust-lang/rust#142767 (Some symbol and PathRoot cleanups) - rust-lang/rust#142769 (remove equivalent new method on context) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-20Port `#[may_dangle]` to the new attribute systemPavel Grigorenko-3/+33
2025-06-20Make some `use _` tests multi-editionEsteban Küber-13/+104
2025-06-20Use gen blocks in the compiler instead of from_coroutineMichael Goulet-154/+139
2025-06-20Collapse Analysis|Borrowck|PostBorrowckAnalysis when there are no opaquesMichael Goulet-3/+11
2025-06-20integer docs: remove extraneous textTshepang Mbambo-455/+0
"Basic usage" implies there is an example that shows advanced usage, but these APIs are extra simple.
2025-06-20Merge pull request #716 from FractalFir/abi-cafeantoyo-2/+5
Fixed some clippy warnings.
2025-06-20Rollup merge of #142769 - jdonszelmann:remove-useless-new-method, r=tgross35Jakub Beránek-9/+3
remove equivalent new method on context Noticed the two had converged so much they literally became equivalent. So one could go hehe
2025-06-20Rollup merge of #142767 - nnethercote:symbol-cleanups, r=petrochenkovJakub Beránek-1/+1
Some symbol and PathRoot cleanups I'm looking into unifying how we join and print paths. Here are some preliminary cleanups. r? ``@petrochenkov``
2025-06-20Rollup merge of #142767 - nnethercote:symbol-cleanups, r=petrochenkovJakub Beránek-24/+29
Some symbol and PathRoot cleanups I'm looking into unifying how we join and print paths. Here are some preliminary cleanups. r? ``@petrochenkov``
2025-06-20Rollup merge of #142764 - ChaiTRex:ilog_10_to_ilog10, r=workingjubileeJakub Beránek-7/+7
Convert `ilog(10)` to `ilog10()` Except in tests, convert `integer.ilog(10)` to `integer.ilog10()` for better speed and to provide better examples of code that efficiently counts decimal digits. I couldn't find any instances of `integer.ilog(2)`.
2025-06-20Rollup merge of #142758 - jieyouxu:rustdoc-json-types, r=KobzolJakub Beránek-1/+1
Make sure to rebuild rustdoc if `src/rustdoc-json-types` is changed I think `rustdoc-json-types` was more recently split out, so this download-rustc logic became outdated as it wasn't tracked. This PR adds `src/rustdoc-json-types` to be tracked for difference versus upstream, so that we properly rebuild rustdoc if it has changes versus upstream. Fixes rust-lang/rust#142738. ### Local testing This is not so easy to test locally because it requires download-rustc. To test this, you need to: 1. Disable `download-rustc` inhibition from bootstrap changes versus upstream, by including `:!src/bootstrap` in https://github.com/rust-lang/rust/blob/255aa220821c05c3eac7605fce4ea1c9ab2cbdb4/src/bootstrap/src/core/config/config.rs#L67-L74. 2. Then, use a config like `profile = "tools"` which by default uses `download-rustc = "if-unchanged"`. 3. Run `./x test tests/rustdoc-json` one time, to "prime" initial build caches. 4. Change the `FORMAT_VERSION` in `src/rustdoc-json-types`, i.e. ```diff diff --git a/src/rustdoc-json-types/lib.rs b/src/rustdoc-json-types/lib.rs index 1f93895ae07..72a3720c7b4 100644 --- a/src/rustdoc-json-types/lib.rs +++ b/src/rustdoc-json-types/lib.rs ``@@`` -38,7 +38,7 ``@@`` // are deliberately not in a doc comment, because they need not be in public docs.) // // Latest feature: Pretty printing of inline attributes changed -pub const FORMAT_VERSION: u32 = 48; +pub const FORMAT_VERSION: u32 = 666; ``` 5. Observe that without this patch, `rustdoc-json` tests fail because `FORMAT_VERSION` mismatch. Observe that with this patch, rustdoc gets properly rebuilt and `rustdoc-json` tests pass. cc ``@aDotInTheVoid`` r? Kobzol
2025-06-20Rollup merge of #142744 - tgross35:y21-mailmap, r=y21Jakub Beránek-0/+1
Add a mailmap entry for y21
2025-06-20Rollup merge of #142743 - tshepang:rdg-push, r=jieyouxuJakub Beránek-96/+252
rustc-dev-guide subtree update r? ``@ghost``
2025-06-20Rollup merge of #142736 - lolbinarycat:rustdoc-issue-template, ↵Jakub Beránek-0/+54
r=GuillaumeGomez,fmease add issue template for rustdoc ~~This also expands the scope of the "diagnostic issue" template to include rustdoc lints, meaning diagnostic issues will need triaging again. I think this is preferable to the alternative of cramming even more cases under a single issue template.~~ r? t-rustdoc
2025-06-20Rollup merge of #142720 - yotamofek:pr/rustdoc/ext-crate-cleanup, ↵Jakub Beránek-71/+53
r=GuillaumeGomez De-dup common code from `ExternalCrate` methods Also, return an `impl Iterator` instead of collecting into a `Vec`. Not sure if that'll have a measurable perf impact, but I think this PR still cleans up the two methods it touches quite nicely. (I'm having trouble finding a name for the common method I extracted, currently called `foobar`, would love suggestions!)
2025-06-20Rollup merge of #142715 - folkertdev:fn-align-corrections, r=jdonszelmannJakub Beránek-34/+36
correct template for `#[align]` attribute Tracking issue: https://github.com/rust-lang/rust/issues/82232 related: https://github.com/rust-lang/rust/pull/142507 I didn't fully understand what `template!` did, clearly. An empty `#[align]` attribute was still rejected later, but without this change it does get suggested in certain cases. I've also updated some outdated references to `#[repr(align)]` on functions. r? ``@jdonszelmann``
2025-06-20Rollup merge of #142629 - Kobzol:bootstrap-tests-builder, r=jieyouxuJakub Beránek-19/+114
Add config builder for bootstrap tests I started writing a bunch of snapshot tests for build/check steps, and quickly realized that the current interface for defining them won't be enough, so I created a simple builder, which can scale to pretty much any kind of configuration in the future.
2025-06-20rust-analyzer: Rename LayoutS to LayoutData in commentsZachary S-1/+1
2025-06-20compiler: Rename LayoutS to LayoutData in commentsZachary S-8/+8
2025-06-20Factor out seen_comma variableCameron Steffen-15/+3
2025-06-20Rollup merge of #142755 - aDotInTheVoid:rdj-shattrs, r=GuillaumeGomezTrevor Gross-12/+1
rustdoc: Remove `FormatRenderer::cache` We only called it it one place, which isn't generic and can be replaced with a field access.
2025-06-20Rollup merge of #142713 - tgross35:mbe-transcribe-refactor, r=petrochenkovTrevor Gross-363/+404
mbe: Refactor transcription Introduce `MacroTcbCtx` that holds everything relevant to transcription. This allows for the following changes: * Split `transcribe_sequence` and `transcribe_metavar` out of the heavily nested `transcribe` * Split `metavar_expr_concat` out of `transcribe_metavar_expr` This is a nonfunctional change.
2025-06-20Rollup merge of #142650 - camsteffen:refactor-translator, r=petrochenkovTrevor Gross-3/+2
Refactor Translator My main motivation was to simplify the usage of `SilentEmitter` for users like rustfmt. A few refactoring opportunities arose along the way. * Replace `Translate` trait with `Translator` struct * Replace `Emitter: Translate` with `Emitter::translator` * Split `SilentEmitter` into `FatalOnlyEmitter` and `SilentEmitter`
2025-06-20Rollup merge of #142650 - camsteffen:refactor-translator, r=petrochenkovTrevor Gross-303/+221
Refactor Translator My main motivation was to simplify the usage of `SilentEmitter` for users like rustfmt. A few refactoring opportunities arose along the way. * Replace `Translate` trait with `Translator` struct * Replace `Emitter: Translate` with `Emitter::translator` * Split `SilentEmitter` into `FatalOnlyEmitter` and `SilentEmitter`
2025-06-20Rollup merge of #142575 - oli-obk:sneaky-self-init, r=RalfJungTrevor Gross-1/+45
Ensure copy* intrinsics also perform the static self-init checks fixes rust-lang/rust#142532 r? `@RalfJung`
2025-06-20Rollup merge of #142497 - GuillaumeGomez:fix-random-search-failure, ↵Trevor Gross-37/+41
r=lolbinarycat Fix random failure when JS code is executed when the whole file was not read yet Very randomly (and rarely), when I arrived on a page with `?search=something` in the URL, I got this error: ![Screenshot From 2025-06-14 11-27-46](https://github.com/user-attachments/assets/4b61b067-4e80-49c1-9a45-cff1509bf86a) Moving the `initSearch` function at the bottom to ensure everything has been loaded fixes the issue. PS: Sorry for the noise. Pushed to the wrong branch and https://github.com/rust-lang/rust/pull/142496 closed. ><
2025-06-20Rollup merge of #142495 - jdonszelmann:better-repr-template, r=oli-obkTrevor Gross-6/+7
Better template for `#[repr]` attributes
2025-06-20Rollup merge of #142494 - jdonszelmann:missing-attr-parsing-docs, r=oli-obkTrevor Gross-0/+19
Fix missing docs in `rustc_attr_parsing`