about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2025-03-26Rollup merge of #138898 - fmease:decrustify-parser-post-ty-ascr, ↵Stuart Cook-3/+0
r=compiler-errors Mostly parser: Eliminate code that's been dead / semi-dead since the removal of type ascription syntax **Disclaimer**: This PR is intended to mostly clean up code as opposed to bringing about behavioral changes. Therefore it doesn't aim to address any of the 'FIXME: remove after a month [dated: 2023-05-02]: "type ascription syntax has been removed, see issue [#]101728"'. --- By commit: 1. Removes truly dead code: * Since 1.71 (#109128) `let _ = { f: x };` is a syntax error as opposed to a semantic error which allows the parse-time diagnostic (suggestion) "*struct literal body without path // you might have forgotten […]*" to kick in. * The analysis-time diagnostic (suggestion) from <=1.70 "*cannot find value \`f\` in this scope // you might have forgotten […]*" is therefore no longer reachable. 2. Updates `is_certainly_not_a_block` to be in line with the current grammar: * The seq. `{ ident:` is definitely not the start of a block. Before the removal of ty ascr, `{ ident: ty_start` would begin a block expr. * This shouldn't make more code compile IINM, it should *ultimately* only affect diagnostics. * For example, `if T { f: () } {}` will now be interpreted as an `if` with struct lit `T { f: () }` as its *condition* (which is banned in the parser anyway) as opposed to just `T` (with the *consequent* being `f : ()` which is also invalid (since 1.71)). The diagnostics are almost the same because we have two separate parse recovery procedures + diagnostics: `StructLiteralNeedingParens` (*invalid struct lit*) before and `StructLiteralNotAllowedHere` (*struct lits aren't allowed here*) now, as you can see from the diff. * (As an aside, even before this PR, fn `maybe_suggest_struct_literal` should've just used the much older & clearer `StructLiteralNotAllowedHere`) * NB: This does sadly regress the compiler output for `tests/ui/parser/type-ascription-in-pattern.rs` but that can be fixed in follow-up PRs. It's not super important IMO and a natural consequence. 3. Removes code that's become dead due to the prior commit. * Basically reverts #106620 + #112475 (without regressing rustc's output!). * Now the older & more robust parse recovery procedure (cc `StructLiteralNotAllowedHere`) takes care of the cases the removed code used to handle. * This automatically fixes the suggestions for \[[playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=7e2030163b11ee96d17adc3325b01780)\]: * `if Ty::<i32> { f: K }.m() {}`: `if Ty::<i32> { SomeStruct { f: K } }.m() {}` (broken) → ` if (Ty::<i32> { f: K }).m() {}` * `if <T as Trait>::Out { f: K::<> }.m() {}`: `if <T as Trait>(::Out { f: K::<> }).m() {}` (broken) → `if (<T as Trait>::Out { f: K::<> }).m() {}` 4. Merge and simplify UI tests pertaining to this issue, so it's easier to add more regression tests like for the two cases mentioned above. 5. Merge UI tests and add the two regression tests. Best reviewed commit by commit (on request I'll partially squash after approval).
2025-03-26Auto merge of #138893 - klensy:thorin-0.9, r=Mark-Simulacrumbors-1/+0
bump thorin to 0.9 to drop duped deps Bumps `thorin`, removing duped deps. This also changes features for hashbrown: ``` hashbrown v0.15.2 `-- indexmap v2.7.0 |-- object v0.36.7 |-- wasmparser v0.219.1 |-- wasmparser v0.223.0 `-- wit-component v0.223.0 |-- indexmap feature "default" |-- indexmap feature "serde" `-- indexmap feature "std" |-- hashbrown feature "default-hasher" | |-- object v0.36.7 (*) | `-- wasmparser v0.223.0 (*) |-- hashbrown feature "nightly" | |-- rustc_data_structures v0.0.0 | `-- rustc_query_system v0.0.0 `-- hashbrown feature "serde" `-- wasmparser feature "serde" ``` to ``` hashbrown v0.15.2 `-- indexmap v2.7.0 |-- object v0.36.7 |-- wasmparser v0.219.1 |-- wasmparser v0.223.0 `-- wit-component v0.223.0 |-- indexmap feature "default" |-- indexmap feature "serde" `-- indexmap feature "std" |-- hashbrown feature "allocator-api2" | `-- hashbrown feature "default" |-- hashbrown feature "default" (*) |-- hashbrown feature "default-hasher" | |-- object v0.36.7 (*) | `-- wasmparser v0.223.0 (*) | `-- hashbrown feature "default" (*) |-- hashbrown feature "equivalent" | `-- hashbrown feature "default" (*) |-- hashbrown feature "inline-more" | `-- hashbrown feature "default" (*) |-- hashbrown feature "nightly" | |-- rustc_data_structures v0.0.0 | `-- rustc_query_system v0.0.0 |-- hashbrown feature "raw-entry" | `-- hashbrown feature "default" (*) `-- hashbrown feature "serde" `-- wasmparser feature "serde" ``` To be safe, as this can be perf-sensitive: `@bors` rollup=never
2025-03-26Merge pull request #19451 from Veykril/push-tuqmmvkrtpzlLukas Wirth-15/+19
refactor: Use MEDIUM durability for crate-graph changes, high for library source files
2025-03-26refactor: Use MEDIUM durability for crate-graph changes, high for library ↵Lukas Wirth-15/+19
source files The idea here is that the crate graph may change over time, but library source file contents *never* will (or really never should). Disconnecting the two means that queries that depend on library sources will not need to re-validatewhen the crate graph changes (unless they depend on the crate graph in some capacity).
2025-03-25Tidy up drop glue notificationConrad Irwin-421/+107
This combines the memory layout and drop information on one line, and makes the wording more succinct. Closes #19410
2025-03-25Rollup merge of #138917 - nnethercote:rustdoc-remove-useless, r=GuillaumeGomezJacob Pratt-38/+38
rustdoc: remove useless `Symbol::is_empty` checks. There are a number of `is_empty` checks that can never fail. This commit removes them, in support of #137978. r? `@GuillaumeGomez`
2025-03-25Rollup merge of #138911 - compiler-errors:define-opaque, r=oli-obkJacob Pratt-0/+8
Allow defining opaques in statics and consts r? oli-obk Fixes https://github.com/rust-lang/rust/issues/138902
2025-03-25Rollup merge of #138905 - Gelbpunkt:powerpc64-unknown-linux-musl-maintainer, ↵Jacob Pratt-1/+59
r=compiler-errors Add target maintainer information for powerpc64-unknown-linux-musl We intend to fix the outstanding issues on the target and eventually promote it to tier 2. We have the capacity to maintain this target in the future and already perform regular builds of rustc for this target. Currently, all host tools except miri build fine, but I have a patch for libffi-sys to make miri also compile fine for this target that is [pending review](https://github.com/tov/libffi-rs/pull/100). While at it, add an option for the musl root for this target. I also added a kernel version requirement, which is rather arbitrarily chosen, but it matches our tier 2 powerpc64le-unknown-linux-musl target so I think it is a good fit.
2025-03-25Rollup merge of #138877 - TaKO8Ki:enable-per-target-ignores-for-doctests, ↵Jacob Pratt-4/+5
r=notriddle Ignore doctests only in specified targets Quick fix for #138863 FIxes #138863 cc `@yotamofek` `@notriddle`
2025-03-25Rollup merge of #138834 - Kobzol:test-diff-group-by-stage, r=marcoieniJacob Pratt-18/+25
Group test diffs by stage in post-merge analysis I think that this is clearer than including the stage in the test name. To test e.g. on [this PR](https://github.com/rust-lang/rust/pull/138523): ```bash $ curl https://ci-artifacts.rust-lang.org/rustc-builds/282865097d138c7f0f7a7566db5b761312dd145c/metrics-aarch64-gnu.json > metrics.json $ cargo run --manifest-path src/ci/citool/Cargo.toml postprocess-metrics metrics.json --job-name aarch64-gnu --parent d9e5539a39192028a7b15ae596a8685017faecee > out.md ``` r? `@marcoieni`
2025-03-25Move Platform Support section to the bottom of rustc chapter bookUrgau-13/+16
2025-03-26rustdoc: Rearrange `Item`/`ItemInner`.Nicholas Nethercote-37/+46
The `Item` struct is 48 bytes and contains a `Box<ItemInner>`; `ItemInner` is 104 bytes. This is an odd arrangement. Normally you'd have one of the following. - A single large struct, which avoids the allocation for the `Box`, but can result in lots of wasted space in unused parts of a container like `Vec<Item>`, `HashSet<Item>`, etc. - Or, something like `struct Item(Box<ItemInner>)`, which requires the `Box` allocation but gives a very small Item size, which is good for containers like `Vec<Item>`. `Item`/`ItemInner` currently gets the worst of both worlds: it always requires a `Box`, but `Item` is also pretty big and so wastes space in containers. It would make sense to push it in one direction or the other. #138916 showed that the first option is a regression for rustdoc, so this commit does the second option, which improves speed and reduces memory usage.
2025-03-25Auto merge of #138933 - matthiaskrgr:rollup-sjtqkoq, r=matthiaskrgrbors-1/+2
Rollup of 8 pull requests Successful merges: - #135745 (Recognise new IPv6 non-global range from IETF RFC 9602) - #137247 (cg_llvm: Reduce the visibility of types, modules and using declarations in `rustc_codegen_llvm`.) - #138317 (privacy: Visit types and traits in impls in type privacy lints) - #138581 (Abort in deadlock handler if we fail to get a query map) - #138776 (coverage: Separate span-extraction from unexpansion) - #138886 (Fix autofix for `self` and `self as …` in `unused_imports` lint) - #138924 (Reduce `kw::Empty` usage, part 3) - #138929 (Visitors track whether an assoc item is in a trait impl or an inherent impl) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-25Rollup merge of #138929 - oli-obk:assoc-ctxt-of-trait, r=compiler-errorsMatthias Krüger-1/+2
Visitors track whether an assoc item is in a trait impl or an inherent impl `AssocCtxt::Impl` now contains an `of_trait` field. This allows ast lowering and nameres to not have to track whether we're in a trait impl or an inherent impl.
2025-03-25Allow defining opaques in statics and constsMichael Goulet-0/+8
2025-03-25Auto merge of #138865 - petrochenkov:errwhere, r=jieyouxubors-80/+95
compiletest: Support matching on diagnostics without a span Using `//~? ERROR my message` on any line of the test. The new checks are exhaustive, like all other `//~` checks, and unlike the `error-pattern` directive that is sometimes used now to check for span-less diagnostics. This will allow to eliminate most on `error-pattern` directives in compile-fail tests (except those that are intentionally imprecise due to platform-specific diagnostics). I didn't migrate any of `error-pattern`s in this PR though, except those where the migration was necessary for the tests to pass.
2025-03-25Add diff of bootstrap stepsJakub Beránek-40/+162
2025-03-25compiletest: Support matching on diagnostics without a spanVadim Petrochenkov-80/+95
2025-03-25Incorporate issue-111692.rs into the larger test file and add more test casesLeón Orell Valerian Liehr-1/+0
Note that issue-111692.rs was incorrectly named: It's a regression test for issue [#]112278, not for [#]111692. That's been addressed, too.
2025-03-25Merge pull request #19433 from snprajwal/fix-replace-let-elseLukas Wirth-8/+41
fix(ide-assists): `let else` to `if let else`
2025-03-25Add function for linearizing `BuildStep` substepsJakub Beránek-12/+17
2025-03-25rustdoc: remove useless `Symbol::is_empty` checks.Nicholas Nethercote-38/+38
There are a number of `is_empty` checks that can never fail. This commit removes them.
2025-03-25Track whether an assoc item is in a trait impl or an inherent implOli Scherer-1/+2
2025-03-25minor: Simplify impl-ty parse validationLukas Wirth-55/+74
2025-03-25Merge pull request #19388 from Veykril/push-oqysrnttwywuLukas Wirth-9/+39
feat: parse `unsafe` record fields
2025-03-25feat: parse `unsafe` record fieldsLukas Wirth-9/+39
2025-03-25Merge pull request #19347 from ↵Lukas Wirth-1/+99
Shourya742/2025-03-13-add-diagnostic-for-dnagling-impl-with-lifetime Add diagnostic for missing ambiguity error for impl trait
2025-03-25ci: Require miri stepLukas Wirth-10/+10
2025-03-25Merge pull request #19446 from Veykril/push-olslsvoxlxwkLukas Wirth-2/+21
ci: run `intern` tests via `cargo miri`
2025-03-25ignore doctests only in specified targetsTakayuki Maeda-4/+5
add necessary lines fix ui test error
2025-03-25Rollup merge of #138755 - GuillaumeGomez:rm-duplicated-loop, r=camelidTakayuki Maeda-38/+21
[rustdoc] Remove duplicated loop when computing doc cfgs Working on implementing https://github.com/rust-lang/rfcs/blob/master/text/3631-rustdoc-cfgs-handling.md and found this weird case where the first loop was actually not doing anything since we were passing `cfg(...)` to `Cfg::parse` instead of `cfg(...)` items. Well, that should be a first nice cleanup before the rest comes in. cc ```@notriddle``` r? ```@camelid```
2025-03-25Rollup merge of #138652 - ferrocene:pa-remote-test-rmake, r=jieyouxuTakayuki Maeda-1/+14
Reintroduce remote-test support in run-make tests The old Makefile-based infrastructure included support for executing binaries with remote-test-client if configured, but that didn't get ported to run_make_support as part of the rmake migration. This PR re-introduces back that support, with the same implementation (and limitations) of the original Makefile-based support. [Old Makefile-based implementation of this](https://github.com/rust-lang/rust/blob/9b8accbeb6336fa24d02b2a8bcaecaf44fe2bb65/tests/run-make/tools.mk#L65-L74) try-job: armhf-gnu
2025-03-25Rollup merge of #138385 - nnethercote:keyword-tweaks, r=NoratriebTakayuki Maeda-1/+1
Keyword tweaks r? ```@Noratrieb```
2025-03-25add more completion about "impl"Hegui Dai-22/+76
2025-03-25ci: run `intern` tests via `cargo miri`Lukas Wirth-2/+21
2025-03-24search.js: fix whitespacebinarycat-1/+1
2025-03-24search.js: give type annotation to newSolutionsbinarycat-2/+2
2025-03-24search.js: give type to unifiedGenericsMgensbinarycat-2/+1
2025-03-24search.js: fix return type of unifyFunctionTypesbinarycat-2/+1
2025-03-24search.js: use @type instead of @ts-expect-errorbinarycat-5/+1
2025-03-24search.js: fix signature of pushTextbinarycat-9/+5
2025-03-24search.js: refactor transformResultsbinarycat-14/+27
2025-03-24search.js: remove another Map.has() and @ts-expect-errorbinarycat-3/+3
2025-03-24search.js(query parser): rethrow error if it isn't a string arraybinarycat-3/+7
only errors that are string arrays are intended to be shown to the user, other errors are bugs, and will be shown in the console as usual.
2025-03-24Add target maintainer information for powerpc64-unknown-linux-muslJens Reidel-1/+59
We intend to fix the outstanding issues on the target and eventually promote it to tier 2. We have the capacity to maintain this target in the future and already perform regular builds of rustc for this target. Currently, all host tools except miri build fine, but I have a patch for libffi-sys to make miri also compile fine for this target that is pending review [1]. While at it, add an option for the musl root for this target. [1]: https://github.com/tov/libffi-rs/pull/100 Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-03-24search.js: add undef2null and eliminate more @ts-expect-errorbinarycat-10/+21
2025-03-24search.js: refactor handling of rawPaths in buildIndexbinarycat-20/+22
2025-03-24search.js: improve typechecking by avoiding Map.hasbinarycat-13/+8
2025-03-24analysis-stats: redesign printing of item tree statsDavid Barsky-11/+23
2025-03-24rustdoc js: add nonundef and use it to remove a ts-expect-errorbinarycat-5/+28