about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2025-07-01Rollup merge of #143279 - GuillaumeGomez:rm-itemkind-descr, r=oli-obkGuillaume Gomez-22/+1
Remove `ItemKind::descr` method Follow-up of rust-lang/rust#143234. After this PR is merged, it will remain two `descr` methods: * `hir::GenericArg::descr` * `hir::AssocItemConstraintKind::descr` For both these enums, I don't think there is the right equivalent in `hir::DefKind` so unless I missed something, we can't remove these two methods because we can't convert these enums into `hir::DefKind`. r? `@oli-obk`
2025-07-01Rollup merge of #143262 - dianqk:non_exhaustive, r=oli-obkGuillaume Gomez-25/+27
mir: Mark `Statement` and `BasicBlockData` as `#[non_exhaustive]` Ensure they are always created using constructors. r? oli-obk
2025-07-01Rollup merge of #143240 - JonathanBrouwer:object_lifetime_default_parser, ↵Guillaume Gomez-2/+27
r=oli-obk Port `#[rustc_object_lifetime_default]` to the new attribute parsing … Ports rustc_object_lifetime_default to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197 r? `@oli-obk` cc `@jdonszelmann`
2025-07-01Rollup merge of #143181 - JonathanBrouwer:malformed-attrs, r=oli-obkGuillaume Gomez-5/+16
Improve testing and error messages for malformed attributes This PR has been split into 5 commits for reviewability, I recommend reviewing them one-by-one. This first commit introduces more tests, the other 4 commits fix 4 bugs discovered by the test. r? `@oli-obk` cc `@jdonszelmann` Fixes https://github.com/rust-lang/rust/issues/143136
2025-07-01Auto merge of #142030 - oli-obk:wfck-less-hir, r=compiler-errorsbors-384/+322
Start moving wf checking away from HIR I'm trying to only access the HIR in the error path. My hope is that once we move significant portions of wfcheck off HIR that incremental will be able to cache wfcheck queries significantly better. I think I am reaching a blocker because we normally need to provide good spans to `ObligationCause`, so that the trait solver can report good errors. In some cases I have been able to use bad spans and improve them depending on the `ObligationCauseCode` (by loading HIR in the case where we actually want to error). To scale that further we'll likely need to remove spans from the `ObligationCause` entirely (leaving it to some variants of `ObligationCauseCode` to have a span when they can't recompute the information later). Unsure this is the right approach, but we've already been using it. I will create an MCP about it, but that should not affect this PR, which is fairly limited in where it does those kind of tricks. Especially https://github.com/rust-lang/rust/commit/b862d8828e375ab8c128a9d9e93bf98b77cb5928 is interesting here, because I think it improves spans in all cases
2025-07-01Fix duplicate errors for `link_section`, ↵Jonathan Brouwer-0/+3
`rustc_layout_scalar_valid_range_start` and `rustc_layout_scalar_valid_range_end`
2025-07-01Port `#[rustc_object_lifetime_default]` to the new attribute parsing ↵Jonathan Brouwer-2/+27
infrastructure
2025-07-01Fix duplicate help on export_name and othersJonathan Brouwer-4/+1
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-01Fix `#[rustc_macro_transparency]` giving two errorsJonathan Brouwer-0/+1
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-01Fix `#[must_use = 1]` not giving an errorJonathan Brouwer-1/+10
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-01Fix double error for `export_name`Jonathan Brouwer-0/+1
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-01loop match: handle opaque patternsFolkert de Vries-3/+4
fixes issue 143203
2025-07-01loop match: run exhaustiveness checkFolkert de Vries-18/+46
2025-07-01Remove `ItemKind::descr` methodGuillaume Gomez-22/+1
2025-07-01Avoid computing layouts inside coroutines.Camille GILLOT-1/+8
2025-07-01Suggest use another lifetime specifier instead of underscore lifetimexizheyin-0/+2
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-01Auto merge of #143013 - bjorn3:split_exported_symbols, r=oli-obkbors-33/+82
Split exported_symbols for generic and non-generic symbols This reduces metadata decoder overhead during the monomorphization collector.
2025-07-01Remove extraneous types.Camille GILLOT-130/+79
2025-07-01Store a full Ty with each Value.Camille GILLOT-130/+114
2025-07-01Introduce Value::RawPtr as it behaves differently from other aggregates.Camille GILLOT-55/+67
2025-07-01Simplify assignments.Camille GILLOT-28/+33
2025-07-01Auto merge of #142921 - JonathanBrouwer:rustc_attributes_parser, r=oli-obkbors-56/+108
Port `#[rustc_layout_scalar_valid_range_start/end]` to the new attrib… Ports `rustc_layout_scalar_valid_range_start` and `rustc_layout_scalar_valid_range_end` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197 r? `@jdonszelmann`
2025-07-01Detect more cases of unused_parens around typesBenjamin Schulz-27/+173
2025-07-01Auto merge of #143267 - matthiaskrgr:rollup-suvzar6, r=matthiaskrgrbors-114/+115
Rollup of 8 pull requests Successful merges: - rust-lang/rust#143125 (Disable f16 on Aarch64 without neon for llvm < 20.1.1) - rust-lang/rust#143156 (inherit `#[align]` from trait method prototypes) - rust-lang/rust#143178 (rustdoc default faviocon) - rust-lang/rust#143234 (Replace `ItemCtxt::report_placeholder_type_error` match with a call to `TyCtxt::def_descr`) - rust-lang/rust#143245 (mbe: Add tests and restructure metavariable expressions) - rust-lang/rust#143257 (Upgrade dependencies in run-make-support) - rust-lang/rust#143263 (linkify CodeSuggestion in doc comments) - rust-lang/rust#143264 (fix: Emit suggestion filename if primary diagnostic span is dummy) Failed merges: - rust-lang/rust#143251 (bootstrap: add build.tidy-extra-checks option) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-01Rollup merge of #143264 - Muscraft:fix-suggestion-filename, r=compiler-errorsMatthias Krüger-1/+3
fix: Emit suggestion filename if primary diagnostic span is dummy While working on using `annotate-snippets` as `rustc`'s emitter, I came across [`tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr`](https://github.com/rust-lang/rust/blob/b03b3a7ec92682be2917540b679478d41c95a30c/tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr), which lacked a filename for both the annotation and the suggestion, which seemed like a bug to me. After some investigation, I found that this is happening because the primary span is a dummy, so its filename doesn't get output, and its filename matches the one for the suggestion, so the suggestion's filename doesn't get output. To fix this issue, I made it so that the filename for a suggestion will get output if the primary span is a dummy.
2025-07-01Rollup merge of #143263 - ComputerDruid:linkify_CodeSuggestion, ↵Matthias Krüger-2/+2
r=compiler-errors linkify CodeSuggestion in doc comments
2025-07-01Rollup merge of #143245 - tgross35:metavariable-expr-organization, ↵Matthias Krüger-63/+73
r=petrochenkov mbe: Add tests and restructure metavariable expressions Add tests that show better diagnostics, and factor `concat` handling to a separate function. Each commit message has further details. This performs the nonfunctional perparation for further changes such as https://github.com/rust-lang/rust/pull/142950 and https://github.com/rust-lang/rust/pull/142975 .
2025-07-01Rollup merge of #143234 - GuillaumeGomez:ice-143128, r=oli-obkMatthias Krüger-39/+1
Replace `ItemCtxt::report_placeholder_type_error` match with a call to `TyCtxt::def_descr` Fixes rust-lang/rust#143128. We could likely use `tcx.def_descr` in more places (and therefore remove more `descr` methods). If it's something that we want to do, I can send a follow-up. r? `@oli-obk`
2025-07-01Rollup merge of #143156 - folkertdev:fn-align-inherit-from-trait, ↵Matthias Krüger-9/+28
r=workingjubilee inherit `#[align]` from trait method prototypes ````@workingjubilee```` this seems straightforward enough. Now that we're planning to make `-Cmin-function-alignment` a target modifier, I don't think there are any cross-crate complications here? ````@Jules-Bertholet```` is this the behavior you had in mind? In particular the inheritance of the attribute of a default impl is maybe a bit unintuitive at first? (but I think it's ok if that behavior is explicitly documented). r? ghost
2025-07-01Rollup merge of #143125 - tgross35:aarch64-neon-llvm19-f16, r=cuviperMatthias Krüger-0/+8
Disable f16 on Aarch64 without neon for llvm < 20.1.1 This check was added unconditionally in c51b229140 ("Disable f16 on Aarch64 without `neon`") and reverted in 4a8d35709e ("Revert "Disable `f16` on Aarch64 without `neon`"") since it did not fail in Rust's build. However, it is still possible to hit this crash if using LLVM 19 built with assertions, so disable the type conditionally based on version here. Note that for these builds, a similar patch is needed in the build script for `compiler-builtins` since it does not yet use `cfg(target_has_reliable_f16)` (hopefully to be resolved in the near future). Report: https://github.com/rust-lang/rust/pull/139276#issuecomment-3014781652 Original LLVM issue: https://github.com/llvm/llvm-project/issues/129394
2025-07-01Auto merge of #141875 - nnethercote:ByteSymbol, r=petrochenkovbors-243/+419
Introduce `ByteSymbol` It's like `Symbol` but for byte strings. The interner is now used for both `Symbol` and `ByteSymbol`. E.g. if you intern `"dog"` and `b"dog"` you'll get a `Symbol` and a `ByteSymbol` with the same index and the characters will only be stored once. The motivation for this is to eliminate the `Arc`s in `ast::LitKind`, to make `ast::LitKind` impl `Copy`, and to avoid the need to arena-allocate `ast::LitKind` in HIR. The latter change reduces peak memory by a non-trivial amount on literal-heavy benchmarks such as `deep-vector` and `tuple-stress`. `Encoder`, `Decoder`, `SpanEncoder`, and `SpanDecoder` all get some changes so that they can handle normal strings and byte strings.
2025-06-30fix: Emit suggestion filename if primary diagnostic span is dummyScott Schafer-1/+3
2025-07-01Remove doc comments from TyCtxtFeedMichael Goulet-1/+0
2025-07-01Feed explicit_predicates_of instead of predicates_ofMichael Goulet-2/+1
2025-07-01mir: Mark `Statement` and `BasicBlockData` as `#[non_exhaustive]`dianqk-25/+27
Ensure they are always created using constructors.
2025-06-30linkify CodeSuggestion in doc commentsDan Johnson-2/+2
2025-06-30Auto merge of #143254 - matthiaskrgr:rollup-7x8bxek, r=matthiaskrgrbors-45/+78
Rollup of 9 pull requests Successful merges: - rust-lang/rust#143019 (Ensure -V --verbose processes both codegen_backend and codegen-backend) - rust-lang/rust#143140 (give Pointer::into_parts a more scary name and offer a safer alternative) - rust-lang/rust#143175 (Make combining LLD with external LLVM config a hard error) - rust-lang/rust#143180 (Use `tracing-forest` instead of `tracing-tree` for bootstrap tracing) - rust-lang/rust#143223 (Improve macro stats printing) - rust-lang/rust#143228 (Handle build scripts better in `-Zmacro-stats` output.) - rust-lang/rust#143229 ([COMPILETEST-UNTANGLE 1/N] Move some some early config checks to the lib and move the compiletest binary) - rust-lang/rust#143246 (Subtree update of `rust-analyzer`) - rust-lang/rust#143248 (Update books) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-30Don't recompute DisambiguatorState for every RPITIT in trait definitionMichael Goulet-46/+47
2025-06-30NoArgsAttributeParserPavel Grigorenko-106/+92
2025-06-30mbe: Move `MetaVarExprConcatElem` closer to where it is usedTrevor Gross-14/+14
Move this structure directly above the `parse_<expr>` functions that return it to keep top-down flow. This is a non-functional change.
2025-06-30mbe: Factor `concat` metavariable handling outTrevor Gross-40/+45
Move the `concat` implementation to a separate function so it is easier to work on. Other metavariable expressions are already split this way. This is a non-functional change.
2025-06-30mbe: Shorten `MetaVarExpr` -> `Mve` in structural diagnosticsTrevor Gross-13/+18
More diagnostic structs related to metavariable expressions will be introduced. Introduce the abbreviation "mve" which is reasonably unambiguous (`rg Mve` and `rg '(\b|_|-)mve(\b|_|-)'` return no results outside of a Thumb target feature) and use it for these diagnostic types. A new module is also created.
2025-06-30Rollup merge of #143228 - nnethercote:macro-stats-build-scripts, r=KobzolMatthias Krüger-1/+11
Handle build scripts better in `-Zmacro-stats` output. Currently all build scripts are listed as `build_script_build` in the stats header. This commit uses `CARGO_PKG_NAME` to improve that. I tried it on Bevy, it works well, giving output like this on the build script: ``` MACRO EXPANSION STATS: serde build script ``` and this on the crate itself: ``` MACRO EXPANSION STATS: serde ``` r? `@Kobzol`
2025-06-30Rollup merge of #143223 - nnethercote:improve-macro-stats-printing, ↵Matthias Krüger-6/+16
r=petrochenkov Improve macro stats printing Fix a small formatting issue that has been annoying me. r? ``@petrochenkov``
2025-06-30Rollup merge of #143140 - RalfJung:ptr-into-parts, r=oli-obkMatthias Krüger-37/+48
give Pointer::into_parts a more scary name and offer a safer alternative `into_parts` is a bit too innocent of a name for a somewhat subtle operation. r? `@oli-obk`
2025-06-30Rollup merge of #143019 - danielframpton:codegen-backend-parse, r=bjorn3Matthias Krüger-1/+3
Ensure -V --verbose processes both codegen_backend and codegen-backend
2025-06-30Auto merge of #143239 - GuillaumeGomez:subtree-update_cg_gcc_2025-06-30, ↵bors-171/+131
r=GuillaumeGomez GCC backend subtree update cc `@antoyo` r? ghost
2025-06-30Remove unused `descr` methodsGuillaume Gomez-28/+0
2025-06-30Replace `ItemCtxt::report_placeholder_type_error` `match` with a call to ↵Guillaume Gomez-11/+1
`TyCtxt::def_descr`
2025-06-30Ensure -V --verbose processes both codegen_backend and codegen-backendDaniel Frampton-1/+3