about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-07-03Rollup merge of #143329 - folkertdev:minicore-diagnostic-on-unimplemented, ↵Jana Dönszelmann-21/+67
r=jieyouxu minicore: use core's `diagnostic::on_unimplemented` messages Without these attributes, the error message is different. Keeping the diagnostics up-to-date seems related to https://github.com/rust-lang/rust/issues/137531. The modified test files are reported in https://github.com/rust-lang/rust/issues/143319 as failing for `--target=riscv64gc-unknown-linux-gnu`. Using `minicore` for them makes it easier to troubleshoot this sort of issue. r? ``@jieyouxu``
2025-07-03Rollup merge of #143283 - marcoieni:document-optional, r=jieyouxuJana Dönszelmann-0/+7
document optional jobs
2025-07-03Rollup merge of #143083 - JonathanBrouwer:rustdoc-fix, r=jdonszelmannJana Dönszelmann-1/+15
Fix rustdoc not correctly showing attributes on re-exports Fixes attributes not being shown correctly in rustdoc on re-exports Does this need to be backported to beta? r? ``@jdonszelmann``
2025-07-03Rollup merge of #143038 - Qelxiros:142676-private-dependency-traits, r=tgross35Jana Dönszelmann-11/+98
avoid suggesting traits from private dependencies fixes rust-lang/rust#142676 fixes rust-lang/rust#138191 r? ``@tgross35``
2025-07-03Rollup merge of #142876 - JonathanBrouwer:target_feature_parser, r=oli-obkJana Dönszelmann-310/+438
Port `#[target_feature]` to new attribute parsing infrastructure Ports `target_feature` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197 r? ``@jdonszelmann``
2025-07-03Rollup merge of #134006 - klensy:typos, r=nnethercoteJana Dönszelmann-175/+326
setup typos check in CI This allows to check typos in CI, currently for compiler only (to reduce commit size with fixes). With current setup, exclude list is quite short, so it worth trying? Also includes commits with actual typo fixes. MCP: https://github.com/rust-lang/compiler-team/issues/817 typos check currently turned for: * ./compiler * ./library * ./src/bootstrap * ./src/librustdoc After merging, PRs which enables checks for other crates (tools) can be implemented too. Found typos will **not break** other jobs immediately: (tests, building compiler for perf run). Job will be marked as red on completion in ~ 20 secs, so you will not forget to fix it whenever you want, before merging pr. Check typos: `python x.py test tidy --extra-checks=spellcheck` Apply typo fixes: `python x.py test tidy --extra-checks=spellcheck:fix` (in case if there only 1 suggestion of each typo) Current fail in this pr is expected and shows how typo errors emitted. Commit with error will be removed after r+.
2025-07-03minicore: use core's `diagnostic::on_unimplemented` messagesFolkert de Vries-21/+67
2025-07-03setup CI and tidy to use typos for spellchecking and fix few typosklensy-175/+326
2025-07-03Auto merge of #143294 - ChrisDenton:rename-mingw, r=Kobzolbors-81/+80
Rename `mingw-*` CI jobs to `pr-*` The name `mingw` confuses people because these CI jobs now do much more than just cross-compile to mingw. This is basically a find/replace. I chose the name `pr-` because it's job is to do general PR checks,
2025-07-03Port `#[target_feature]` to the new attribute parsing infrastructureJonathan Brouwer-310/+438
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-03Auto merge of #143350 - matthiaskrgr:rollup-zcuvkve, r=matthiaskrgrbors-325/+716
Rollup of 9 pull requests Successful merges: - rust-lang/rust#143192 (Improve CSS for source code block line numbers) - rust-lang/rust#143251 (bootstrap: add build.tidy-extra-checks option) - rust-lang/rust#143273 (Make the enum check work for negative discriminants) - rust-lang/rust#143292 (Explicitly handle all nodes in `generics_of` when computing parent) - rust-lang/rust#143316 (Add bootstrap check snapshot tests) - rust-lang/rust#143321 (byte-addresses memory -> byte-addressed memory) - rust-lang/rust#143324 (interpret: move the native call preparation logic into Miri) - rust-lang/rust#143325 (Use non-global interner in `test_string_interning` in bootstrap) - rust-lang/rust#143327 (miri: improve errors for type validity assertion failures) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-03Rollup merge of #143327 - RalfJung:miri-type-validity-error, r=oli-obkMatthias Krüger-107/+82
miri: improve errors for type validity assertion failures Miri has pretty nice errors for type validity violations, printing which field in the type the problem occurs at and so on. However, we don't see these errors when using e.g. `mem::zeroed` as that uses `assert_zero_valid` to bail out before Miri can detect the UB. Similar to what we did with `@saethlin's` UB checks, I think we should disable such language UB checks in Miri so that we can get better error messages. If we go for this we should probably say this in the intrinsic docs as well so that people don't think they can rely on these intrinsics catching anything. Furthermore, I slightly changed `MaybeUninit::assume_init` so that the `.value` field does not show up in error messages any more. `@rust-lang/miri` what do you think?
2025-07-03Rollup merge of #143325 - Kobzol:bootstrap-interner, r=clubby789Matthias Krüger-4/+7
Use non-global interner in `test_string_interning` in bootstrap Just a small cleanup that we found on our GSoC call. CC `@Shourya742`
2025-07-03Rollup merge of #143324 - RalfJung:native-call-prep, r=oli-obkMatthias Krüger-61/+67
interpret: move the native call preparation logic into Miri `@nia-e` has to do a bunch of changes to this logic for her native call ptrace work, and it's getting annoying that the logic is split between Miri and rustc. So this moves the logic to Miri, keeping just the generic traversal part in rustc. It is unfortunate that this means we have to expose `get_alloc_raw`/`get_alloc_raw_mut`... I hope the function name is scary enough to reduce the risk of misuse. r? `@oli-obk`
2025-07-03Rollup merge of #143321 - hkBst:typo-1, r=compiler-errorsMatthias Krüger-1/+1
byte-addresses memory -> byte-addressed memory Small typo fix
2025-07-03Rollup merge of #143316 - Kobzol:bootstrap-check-tests, r=jieyouxuMatthias Krüger-63/+373
Add bootstrap check snapshot tests Split off from https://github.com/rust-lang/rust/pull/143048, so that we get a baseline of how check behaved before we make changes to it. Note that the output of the check snapshot tests is suboptimal in many places, as we're missing information about stages and the build compiler. That will be changed in https://github.com/rust-lang/rust/pull/143048. r? `@jieyouxu`
2025-07-03Rollup merge of #143292 - compiler-errors:explicit-generic, r=oli-obkMatthias Krüger-5/+16
Explicitly handle all nodes in `generics_of` when computing parent If we, for example, forget to feed `generics_of` then it'll silently fall back to empty generics. Make this a bit more explicit.
2025-07-03Rollup merge of #143273 - 1c3t3a:enum-check-negative, r=SparrowLiiMatthias Krüger-4/+93
Make the enum check work for negative discriminants The discriminant check was not working correctly for negative numbers. This change fixes that by masking out the relevant bits correctly. Fixes rust-lang/rust#143218.
2025-07-03Rollup merge of #143251 - lolbinarycat:bootstrap-toml-tidy-extra-checks, ↵Matthias Krüger-2/+22
r=Kobzol bootstrap: add build.tidy-extra-checks option split off from rust-lang/rust#142924 r? `@Kobzol`
2025-07-03Rollup merge of #143192 - GuillaumeGomez:code-line-number, r=lolbinaryMatthias Krüger-78/+55
Improve CSS for source code block line numbers Extract some changes from https://github.com/rust-lang/rust/pull/137229 to make the PR smaller (thanks `@yotamofek` for the suggestion!). r? notriddle
2025-07-02avoid suggesting traits from private dependenciesJeremy Smart-32/+28
2025-07-02Auto merge of #143338 - matthiaskrgr:rollup-ykaxh04, r=matthiaskrgrbors-974/+1532
Rollup of 11 pull requests Successful merges: - rust-lang/rust#131923 (Derive `Copy` and `Hash` for `IntErrorKind`) - rust-lang/rust#138340 (Remove some unsized tuple impls now that we don't support unsizing tuples anymore) - rust-lang/rust#141219 (Change `{Box,Arc,Rc,Weak}::into_raw` to only work with `A = Global`) - rust-lang/rust#142212 (bootstrap: validate `rust.codegen-backends` & `target.<triple>.codegen-backends`) - rust-lang/rust#142237 (Detect more cases of unused_parens around types) - rust-lang/rust#142964 (Attribute rework: a parser for single attributes without arguments) - rust-lang/rust#143070 (Rewrite `macro_rules!` parser to not use the MBE engine itself) - rust-lang/rust#143235 (Assemble const bounds via normal item bounds in old solver too) - rust-lang/rust#143261 (Feed `explicit_predicates_of` instead of `predicates_of`) - rust-lang/rust#143276 (loop match: handle opaque patterns) - rust-lang/rust#143306 (Add `track_caller` attributes to trace origin of Clippy lints) r? `@ghost` `@rustbot` modify labels: rollup try-job: aarch64-apple try-job: x86_64-msvc-1 try-job: x86_64-gnu try-job: dist-i586-gnu-i586-i686-musl try-job: test-various
2025-07-02Auto merge of #143337 - matthiaskrgr:rollup-lqwhe0i, r=matthiaskrgrbors-132/+306
Rollup of 9 pull requests Successful merges: - rust-lang/rust#141847 (Explain `TOCTOU` on the top of `std::fs`, and reference it in functions) - rust-lang/rust#142138 (Add `Vec::into_chunks`) - rust-lang/rust#142321 (Expose elf abi on ppc64 targets) - rust-lang/rust#142886 (ci: aarch64-gnu: Stop skipping `panic_abort_doc_tests`) - rust-lang/rust#143194 (fix bitcast of single-element SIMD vectors) - rust-lang/rust#143231 (Suggest use another lifetime specifier instead of underscore lifetime) - rust-lang/rust#143232 ([COMPILETEST-UNTANGLE 3/N] Use "directives" consistently within compiletest) - rust-lang/rust#143258 (Don't recompute `DisambiguatorState` for every RPITIT in trait definition) - rust-lang/rust#143274 (ci: support optional jobs) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-02Rollup merge of #143306 - samueltardieu:track-clippy-lints-emission, ↵Matthias Krüger-0/+60
r=petrochenkov Add `track_caller` attributes to trace origin of Clippy lints This allows the use of `-Z track-diagnostics` to see the origin of Clippy lints emission, as is already the case for lints coming from rustc.
2025-07-02Rollup merge of #143276 - folkertdev:loop-match-opaque-pattern, r=NadrierilMatthias Krüger-156/+270
loop match: handle opaque patterns tracking issue https://github.com/rust-lang/rust/issues/132306 fixes https://github.com/rust-lang/rust/issues/143203 I believe the `Opaque` comes up because the range pattern is invalid? Because we do handle float patterns already so those should be fine. r? `@Nadrieril`
2025-07-02Rollup merge of #143261 - compiler-errors:explicit-pred, r=oli-obkMatthias Krüger-3/+1
Feed `explicit_predicates_of` instead of `predicates_of` Tiny nitpick, just avoiding needing to mark the `predicates_of` query as feedable since it's derived from `explicit_predicates_of`.
2025-07-02Rollup merge of #143235 - compiler-errors:const-item-bound, r=oli-obkMatthias Krüger-1/+85
Assemble const bounds via normal item bounds in old solver too Fixes the first example in https://rust-lang.zulipchat.com/#narrow/channel/144729-t-types/topic/elaboration.20of.20const.20bounds.3F/with/526378135 The code duplication here is not that nice, but it's at least very localized. cc `@davidtwco` r? oli-obk
2025-07-02Rollup merge of #143070 - joshtriplett:macro-rules-parse, r=petrochenkovMatthias Krüger-217/+73
Rewrite `macro_rules!` parser to not use the MBE engine itself The `macro_rules!` parser was written to match the series of rules using the macros-by-example (MBE) engine and a hand-written equivalent of the left-hand side of a MBE macro. This was complex to read, difficult to extend, and produced confusing error messages. Because it was using the MBE engine, any parse failure would be reported as if some macro was being applied to the `macro_rules!` invocation itself; for instance, errors would talk about "macro invocation", "macro arguments", and "macro call", when they were actually about the macro *definition*. And in practice, the `macro_rules!` parser only used the MBE engine to extract the left-hand side and right-hand side of each rule as a token tree, and then parsed the rest using a separate parser. Rewrite it to parse the series of rules using a simple loop, instead. This makes it more extensible in the future, and improves error messages. For instance, omitting a semicolon between rules will result in "expected `;`" and "unexpected token", rather than the confusing "no rules expected this token in macro call". This work was greatly aided by pair programming with Vincenzo Palazzo (`@vincenzopalazzo)` and Eric Holk (`@eholk).` For review, I recommend reading the two commits separately.
2025-07-02Rollup merge of #142964 - GrigorenkoPV:attributes/argless, r=oli-obkMatthias Krüger-132/+91
Attribute rework: a parser for single attributes without arguments Part of rust-lang/rust#131229 r? `@jdonszelmann` I think code (with comments) speaks for itself. The only subtlety: now `#[cold]`, `#[no_mangle]`, & `#[track_caller]` do not get thrown away when malformed (i.e. have arguments). This doesn't matter too much (I think), because an error gets emitted either way, so the compilation will not finish.
2025-07-02Rollup merge of #142237 - benschulz:unused-parens-fn, r=fee1-deadMatthias Krüger-83/+596
Detect more cases of unused_parens around types With this change, more unused parentheses around bounds and types nested within bounds are detected.
2025-07-02Rollup merge of #142212 - GrigorenkoPV:codegens, r=KobzolMatthias Krüger-36/+29
bootstrap: validate `rust.codegen-backends` & `target.<triple>.codegen-backends` As per https://github.com/rust-lang/rust/issues/142184#issuecomment-2954124009. Closes rust-lang/rust#142184.
2025-07-02Rollup merge of #141219 - Amanieu:leak_alloc, r=joboetMatthias Krüger-316/+321
Change `{Box,Arc,Rc,Weak}::into_raw` to only work with `A = Global` Also applies to `Vec::into_raw_parts`. The expectation is that you can round-trip these methods with `from_raw`, but this is only true when using the global allocator. With custom allocators you should instead be using `into_raw_with_allocator` and `from_raw_in`. The implementation of `Box::leak` is changed to use `Box::into_raw_with_allocator` and explicitly leak the allocator (which was already the existing behavior). This is because, for `leak` to be safe, the allocator must not free its underlying backing store. The `Allocator` trait only guarantees that allocated memory remains valid until the allocator is dropped.
2025-07-02Rollup merge of #138340 - oli-obk:one-size-fits-all, r=m-ou-seMatthias Krüger-29/+5
Remove some unsized tuple impls now that we don't support unsizing tuples anymore Since https://github.com/rust-lang/rust/pull/137728 there is no sound way to create unsized tuples anymore. While we can't remove them from the language (tried here: https://github.com/rust-lang/rust/pull/138093) due to people using `PhantomData<(T, U)>` where `U: ?Sized` (they'd have to use `(PhantomData<T>, PhantomData<U>)` now), we can remove the impls from libcore I believe. r? libs I guess?
2025-07-02Rollup merge of #131923 - ranger-ross:impl-copy-hash-interrorkind, r=tgross35Matthias Krüger-1/+1
Derive `Copy` and `Hash` for `IntErrorKind` This PR derives `Copy` and `Hash` for `IntErrorKind` to make it easier to work with. (see #131826) I think an argument could be made to also derive `PartialOrd` + `Ord` as well given that other error kinds in the std like [`io::ErrorKind`](https://doc.rust-lang.org/src/std/io/error.rs.html#212-428) do this. Granted these seem much less useful for errors. Fixes https://github.com/rust-lang/rust/issues/131826
2025-07-02Rollup merge of #143274 - marcoieni:optional-jobs, r=KobzolMatthias Krüger-6/+43
ci: support optional jobs try-job: optional-mingw-check-1
2025-07-02Rollup merge of #143258 - compiler-errors:disambiguator-state, r=oli-obkMatthias Krüger-46/+47
Don't recompute `DisambiguatorState` for every RPITIT in trait definition The `associated_type_for_impl_trait_in_trait` currently needs to rerun the `RPITVisitor` for every RPITIT to compute its disambiguator. Instead of synthesizing all of the RPITITs def ids one at a time in different queries, just synthesize them inside of the `associated_types_for_impl_traits_in_associated_fn` query. There we can just share the same `DisambiguatorState` for all the RPITITs in one function signature. r? ``````@Zoxc`````` or ``````@oli-obk`````` cc rust-lang/rust#140453
2025-07-02Rollup merge of #143232 - jieyouxu:compiletest-maintenance-3, r=KobzolMatthias Krüger-44/+43
[COMPILETEST-UNTANGLE 3/N] Use "directives" consistently within compiletest Instead of using *both* "headers" and "directives" within compiletest to refer to the same thing. This of course induces some churn, but it's been bugging me for a while, and I rather do the self-consistency changes now than later. The first commit tries to be mostly move-only to help per-file git history. I intend to revisit rustc-dev-guide's testing docs, but I don't want to do it on rust-lang/rust side because it would need syncing and might conflict.
2025-07-02Rollup merge of #143231 - xizheyin:143152, r=fee1-deadMatthias Krüger-0/+20
Suggest use another lifetime specifier instead of underscore lifetime cc rust-lang/rust#143152 r? compiler
2025-07-02Rollup merge of #143194 - folkertdev:fix-single-element-simd-bitcast, ↵Matthias Krüger-18/+47
r=workingjubilee fix bitcast of single-element SIMD vectors in effect this reverts https://github.com/rust-lang/rust/pull/142768 and adds additional tests. That PR relaxed the conditions on an early return in an incorrect way that would create broken LLVM IR. https://godbolt.org/z/PaaGWTv5a ```rust #![feature(repr_simd)] #[repr(simd)] #[derive(Clone, Copy)] struct S([i64; 1]); #[no_mangle] pub extern "C" fn single_element_simd(b: S) -> i64 { unsafe { std::mem::transmute(b) } } ``` at the time of writing generates this LLVM IR, where the type of the return is different from the function's return type. ```llvm define noundef i64 ``````@single_element_simd(<1`````` x i64> %b) unnamed_addr { start: ret <1 x i64> %b } ``` The test output is actually the same for the existing tests, showing that the change didn't actually matter for any tested behavior. It is probably a bit faster to do the early return, but, well, it's incorrect in general. zullip thread: [#t-compiler > Is transmuting a &#96;T&#96; to &#96;Tx1&#96; (one-element SIMD vector) UB?](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Is.20transmuting.20a.20.60T.60.20to.20.60Tx1.60.20.28one-element.20SIMD.20vector.29.20UB.3F/with/526262799) cc ``````@sayantn`````` r? ``````@scottmcm``````
2025-07-02Rollup merge of #142886 - Enselic:aarch64-panic, r=cuviperMatthias Krüger-2/+1
ci: aarch64-gnu: Stop skipping `panic_abort_doc_tests` The skipped test passes since `nightly-2024-11-29`. See https://github.com/rust-lang/rust/issues/123733#issuecomment-2928770365 and https://github.com/rust-lang/rust/issues/123733#issuecomment-2929091266 for more info. Let's stop skipping it to increase the chance of detecting a regression. r? ``````@cuviper`````` who added the skip in https://github.com/rust-lang/rust/pull/123828 Also see https://github.com/rust-lang/rust/pull/142304 for an alternative regression test that I am hoping to also land in the near future to complement the test we now stop skipping, but I need to investigate that setup more.
2025-07-02Rollup merge of #142321 - ostylk:fix/ppc64_abi, r=workingjubileeMatthias Krüger-1/+9
Expose elf abi on ppc64 targets Fixes https://github.com/rust-lang/rust/issues/60617 (after MCP https://github.com/rust-lang/compiler-team/issues/885 is accepted) by exposing the abi information on ppc64 targets. Conditional compilation can now use `cfg(target_abi = "elfv1")` or `cfg(target_abi = "elfv2")` to determine the abi in use. Technical details are included in the other PR https://github.com/rust-lang/rust/pull/142598
2025-07-02Rollup merge of #142138 - ashivaram23:vec_into_chunks, r=scottmcmMatthias Krüger-0/+55
Add `Vec::into_chunks` Tracking issue rust-lang/rust#142137
2025-07-02Rollup merge of #141847 - xizheyin:141837, r=jhprattMatthias Krüger-15/+41
Explain `TOCTOU` on the top of `std::fs`, and reference it in functions Fixes rust-lang/rust#141837 r? ``````@workingjubilee``````
2025-07-02Auto merge of #143214 - camsteffen:remove-let-chains-feature, r=est31bors-1194/+1053
Remove let_chains unstable feature Per https://github.com/rust-lang/rust/issues/53667#issuecomment-3016742982 (but then I also noticed rust-lang/rust#140722) This replaces the feature gate with a parser error that says let chains require 2024. A lot of tests were using the unstable feature. I either added edition:2024 to the test or split out the parts that require 2024.
2025-07-02Make the enum check work for negative discriminantsBastian Kersting-4/+93
The discriminant check was not working correctly for negative numbers. This change fixes that by masking out the relevant bits correctly.
2025-07-02Explicitly handle all nodes in generics_of when computing parentMichael Goulet-5/+16
2025-07-02bootstrap: add CONFIG_CHANGE_HISTORY entry for build.tidy-extra-checksbinarycat-0/+5
2025-07-02bootstrap: add build.tidy-extra-checks optionbinarycat-2/+17
2025-07-02miri: improve errors for type validity assertion failuresRalf Jung-107/+82
2025-07-02Remove some unsized tuple impls now that we don't support unsizing tuples ↵Oli Scherer-29/+5
anymore