about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-02-18Merge pull request #19173 from rust-lang/revert-19122-masterLukas Wirth-37/+20
Revert "pass struct fields to chalk"
2025-02-18Revert "pass struct fields to chalk"Lukas Wirth-37/+20
2025-02-18Merge pull request #19157 from joshrotenberg/dev-guide-to-bookLukas Wirth-173/+201
doc: move dev docs to manual
2025-02-17move dev docs to manualJosh Rotenberg-173/+201
fix formatting
2025-02-17Merge pull request #19170 from lnicola/update-lockfileLaurențiu Nicola-12/+12
minor: Update lockfile
2025-02-17Update lockfileLaurențiu Nicola-12/+12
2025-02-17Merge pull request #19169 from lnicola/sync-from-rustLaurențiu Nicola-19952/+29737
minor: Sync from downstream
2025-02-17Bump rustc cratesLaurențiu Nicola-5/+5
2025-02-17Merge pull request #19167 from ChayimFriedman2/fix-ref-patLukas Wirth-17/+64
fix: Fix detection of ref patterns for path patterns
2025-02-17Merge from rust-lang/rustLaurențiu Nicola-19946/+29731
2025-02-17Preparing for merge from rust-lang/rustLaurențiu Nicola-1/+1
2025-02-17Fix detection of ref patterns for path patternsChayim Refael Friedman-17/+64
I was wrong on #19127, I thought hir-def resolver is enough for them, but it turns out not because of paths like `<Enum>::Variant` and `Type::AssocThatIsEnum::Variant`.
2025-02-17Merge pull request #19158 from PoignardAzur/expaned_pub_glob_importsLukas Wirth-92/+297
Implement expand_glob_reexport assist
2025-02-17Merge pull request #19122 from Austaras/masterLukas Wirth-20/+37
pass struct fields to chalk
2025-02-17Merge pull request #19127 from ChayimFriedman2/different-generic-argsLukas Wirth-1144/+1222
feat: Refactor path lowering and serve a new path diagnostic
2025-02-17Auto merge of #137163 - matthiaskrgr:rollup-ovgfkns, r=matthiaskrgrbors-1098/+1845
Rollup of 7 pull requests Successful merges: - #136466 (Start removing `rustc_middle::hir::map::Map`) - #136671 (Overhaul `rustc_middle::limits`) - #136817 (Pattern Migration 2024: clean up and comment) - #136844 (Use `const_error!` when possible) - #137080 (bootstrap: add more tracing to compiler/std/llvm flows) - #137101 (`invalid_from_utf8[_unchecked]`: also lint inherent methods) - #137140 (Fix const items not being allowed to be called `r#move` or `r#static`) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-17Merge pull request #19166 from ChayimFriedman2/runnables-orderLaurențiu Nicola-11/+4
fix: Fix sorting of runnables
2025-02-17Rollup merge of #137140 - Noratrieb:const-move, r=jieyouxu,compiler-errorsMatthias Krüger-3/+163
Fix const items not being allowed to be called `r#move` or `r#static` Because of an ambiguity with const closures, the parser needs to ensure that for a const item, the `const` keyword isn't followed by a `move` or `static` keyword, as that would indicate a const closure: ```rust fn main() { const move // ... } ``` This check did not take raw identifiers into account, therefore being unable to distinguish between `const move` and `const r#move`. The latter is obviously not a const closure, so it should be allowed as a const item. This fixes the check in the parser to only treat `const ...` as a const closure if it's followed by the *proper keyword*, and not a raw identifier. Additionally, this adds a large test that tests for all raw identifiers in all kinds of positions, including `const`, to prevent issues like this one from occurring again. fixes #137128
2025-02-17Rollup merge of #137101 - GrigorenkoPV:str-inherent-lint, r=UrgauMatthias Krüger-47/+274
`invalid_from_utf8[_unchecked]`: also lint inherent methods Addressing https://github.com/rust-lang/rust/issues/131114#issuecomment-2646663535 Also corrected a typo: "_an_ invalid literal", not "_a_ invalid literal".
2025-02-17Rollup merge of #137080 - jieyouxu:more-tracing, r=onur-ozkanMatthias Krüger-31/+340
bootstrap: add more tracing to compiler/std/llvm flows - Add more tracing to compiler/std/llvm flows. - Two drive-by nits: 1. Take `TargetSelection` by-value for `builder.is_builder_target()`. Noticed while adding tracing; follow-up to #136767. 2. Coalesce enzyme build logic into one branch. - Document `COMPILER{,_FOR}` tracing targets for #96176. - No functional changes. ### Testing You can play with the tracing locally with: ``` $ BOOTSTRAP_TRACING=bootstrap=debug ./x build library $ BOOTSTRAP_TRACING=bootstrap=trace ./x build library $ BOOTSTRAP_TRACING=bootstrap=trace,COMPILER=trace,COMPILER_FOR=trace ./x build library ``` ### Previews ``` $ BOOTSTRAP_TRACING=bootstrap=debug ./x build library ``` ![Screenshot 2025-02-15 230824](https://github.com/user-attachments/assets/c3b02b62-d52e-4c03-a00a-da0d95618989) ``` $ BOOTSTRAP_TRACING=bootstrap=trace,COMPILER=trace,COMPILER_FOR=trace ./x build library ``` ![Screenshot 2025-02-15 233859](https://github.com/user-attachments/assets/842e4ece-4c26-4191-acbb-5f93e42de4dc) r? ``@onur-ozkan`` (or reroll)
2025-02-17Rollup merge of #136844 - thaliaarchi:const-io-error, r=ChrisDentonMatthias Krüger-106/+90
Use `const_error!` when possible Replace usages of `io::Error::new(io::ErrorKind::Variant, "constant string")` with `io::const_error!(io::ErrorKind::Variant, "constant string")` to avoid allocations when possible. Additionally, fix `&&str` error messages in SGX and missing/misplaced trailing commas in `const_error!`.
2025-02-17Rollup merge of #136817 - dianne:clean-and-comment-pat-migration, r=NadrierilMatthias Krüger-114/+205
Pattern Migration 2024: clean up and comment This follows up on #136577 by moving the pattern migration logic to its own module, removing a bit of unnecessary complexity, and adding comments. Since there's quite a bit of pattern migration logic now (and potentially more in #136496), I think it makes sense to keep it separate from THIR construction, at least as much as is convenient. r? ``@Nadrieril``
2025-02-17Rollup merge of #136671 - nnethercote:middle-limits, r=NadrierilMatthias Krüger-97/+100
Overhaul `rustc_middle::limits` In particular, to make `pattern_complexity` work more like other limits, which then enables some other simplifications. r? ``@Nadrieril``
2025-02-17Rollup merge of #136466 - nnethercote:start-removing-Map, r=cjgillotMatthias Krüger-700/+673
Start removing `rustc_middle::hir::map::Map` `rustc_middle::hir::map::Map` is now just a low-value wrapper around `TyCtxt`. This PR starts removing it. r? `@cjgillot`
2025-02-17Remove `TyCtxt::hir_krate`.Nicholas Nethercote-9/+3
It's a trivial wrapper around the `hir_crate` query with a small number of uses.
2025-02-17Overhaul the `intravisit::Map` trait.Nicholas Nethercote-210/+208
First of all, note that `Map` has three different relevant meanings. - The `intravisit::Map` trait. - The `map::Map` struct. - The `NestedFilter::Map` associated type. The `intravisit::Map` trait is impl'd twice. - For `!`, where the methods are all unreachable. - For `map::Map`, which gets HIR stuff from the `TyCtxt`. As part of getting rid of `map::Map`, this commit changes `impl intravisit::Map for map::Map` to `impl intravisit::Map for TyCtxt`. It's fairly straightforward except various things are renamed, because the existing names would no longer have made sense. - `trait intravisit::Map` becomes `trait intravisit::HirTyCtxt`, so named because it gets some HIR stuff from a `TyCtxt`. - `NestedFilter::Map` assoc type becomes `NestedFilter::MaybeTyCtxt`, because it's always `!` or `TyCtxt`. - `Visitor::nested_visit_map` becomes `Visitor::maybe_tcx`. I deliberately made the new trait and associated type names different to avoid the old `type Map: Map` situation, which I found confusing. We now have `type MaybeTyCtxt: HirTyCtxt`.
2025-02-17Move some `Map` methods onto `TyCtxt`.Nicholas Nethercote-476/+465
The end goal is to eliminate `Map` altogether. I added a `hir_` prefix to all of them, that seemed simplest. The exceptions are `module_items` which became `hir_module_free_items` because there was already a `hir_module_items`, and `items` which became `hir_free_items` for consistency with `hir_module_free_items`.
2025-02-17Auto merge of #136953 - ken-matsui:import-target-metadata, r=workingjubileebors-568/+679
rustc_target: import TargetMetadata
2025-02-17Fix sorting of runnablesChayim Refael Friedman-11/+4
There were two mistakes: first, tests were sorted before test modules, and second, we re-sorted based on the name only, which cancelled the sort based on the kind.
2025-02-16rustc_target: import TargetMetadataKen Matsui-568/+679
2025-02-17Remove unused `Map::hir_node_by_def_id` method.Nicholas Nethercote-8/+0
2025-02-17Rename `rustc_middle/src/hir/map/mod.rs` as `map.rs`.Nicholas Nethercote-0/+0
There is no need for the extra subdirectory, and this makes the `map` module consistent with its sibling modules `nested_filter` and `place`.
2025-02-17Clarify `impl Map for !`.Nicholas Nethercote-7/+7
All the methods are unreachable, so make that clearer.
2025-02-17Avoid unnecessary use of the `Map` trait.Nicholas Nethercote-2/+2
The `Map` trait is there for cases where `tcx` isn't available. This isn't one of those cases, so it's simpler to just call through `tcx` directly.
2025-02-17Rename `pattern_complexity` attr as `pattern_complexity_limit`.Nicholas Nethercote-18/+18
For consistency with `recursion_limit`, `move_size_limit`, and `type_length_limit`.
2025-02-17Move `rustc_middle::limits` to `rustc_interface`.Nicholas Nethercote-26/+23
It's always good to make `rustc_middle` smaller. `rustc_interface` is the best destination, because it's the only crate that calls `get_recursive_limit`.
2025-02-17Improve comments about limits.Nicholas Nethercote-7/+8
2025-02-17Merge `get_limit` and `get_limit_size`.Nicholas Nethercote-13/+2
Thanks to the previous commit, they no longer need to be separate.
2025-02-17Add `pattern_complexity_limit` to `Limits`.Nicholas Nethercote-35/+51
It's similar to the other limits, e.g. obtained via `get_limit`. So it makes sense to handle it consistently with the other limits. We now use `Limit`/`usize` in most places instead of `Option<usize>`, so we use `Limit::new(usize::MAX)`/`usize::MAX` to emulate how `None` used to work. The commit also adds `Limit::unlimited`.
2025-02-16Auto merge of #137143 - matthiaskrgr:rollup-9hapmyd, r=matthiaskrgrbors-181/+748
Rollup of 8 pull requests Successful merges: - #136986 (Apply unsafe_op_in_unsafe_fn to the standard library) - #137012 (add docs and ut for bootstrap util cc-detect) - #137072 (Load all builtin targets at once instead of one by one in check-cfg) - #137102 (Rework `name_regions` to not rely on reverse scc graph for non-member-constrain usages) - #137112 (Don't project into `NonNull` when dropping a `Box`) - #137114 (Add an example for `std::error::Error`) - #137117 (Fix test that relies on error language) - #137119 (fix broken `x {doc, build} core`) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-16Auto merge of #137127 - pietroalbini:pa-musl-cve-2025-26519, r=jieyouxubors-0/+41
Fix musl's CVE-2025-26519 The musl project [announced CVE-2025-26519](https://www.openwall.com/lists/musl/2025/02/13/1), which could result in out-of-bounds writes when calling the `iconv` function. There is no musl release available with the fixes at this point in time (and we're using an older version of musl anyway), so this PR applies the provided patches on top of the musl source tarball we download.
2025-02-16Refactor path loweringChayim Refael Friedman-1132/+1220
And add a new diagnostic for non-`Fn` parenthesized generic args. Path lowering started to look like a mess, with each function carrying additional parameters for the diagnostic callback (since paths can occur both in type and in expression/pattern position, and their diagnostic handling is different) and the segment index, for the diagnostics report. So I refactored it from stateless functions on `TyLoweringContext` into stateful struct, `PathLoweringContext`, that tracks the process of lowering a path from resolution til assoc types selection.
2025-02-16Fix const items not being allowed to be called `r#move` or `r#static`Noratrieb-3/+163
Because of an ambiguity with const closures, the parser needs to ensure that for a const item, the `const` keyword isn't followed by a `move` or `static` keyword, as that would indicate a const closure: ```rust fn main() { const move // ... } ``` This check did not take raw identifiers into account, therefore being unable to distinguish between `const move` and `const r#move`. The latter is obviously not a const closure, so it should be allowed as a const item. This fixes the check in the parser to only treat `const ...` as a const closure if it's followed by the *proper keyword*, and not a raw identifier. Additionally, this adds a large test that tests for all raw identifiers in all kinds of positions, including `const`, to prevent issues like this one from occurring again.
2025-02-16Rollup merge of #137119 - onur-ozkan:fix-broken-core, r=jieyouxuMatthias Krüger-9/+10
fix broken `x {doc, build} core` Fixes #137115
2025-02-16Rollup merge of #137117 - ChrisDenton:error-lang, r=fmease,NoratriebMatthias Krüger-3/+3
Fix test that relies on error language We shouldn't care about the OS error message text in this test.
2025-02-16Rollup merge of #137114 - ChrisDenton:error, r=NoratriebMatthias Krüger-0/+24
Add an example for `std::error::Error` There is currently no example provided for `std::error::Error` so let's fix that.
2025-02-16Rollup merge of #137112 - scottmcm:box-drop-no-nonnull-project, r=oli-obkMatthias Krüger-10/+168
Don't project into `NonNull` when dropping a `Box` Another step towards banning these projections. Tracking Issue #133652
2025-02-16Rollup merge of #137102 - compiler-errors:name_regions2, r=oli-obkMatthias Krüger-7/+58
Rework `name_regions` to not rely on reverse scc graph for non-member-constrain usages Fixes https://github.com/rust-lang/rust/issues/137015 Splits the `name_regions` into two versions: One meant for member region constraint error reporting (which I've renamed to `name_regions_for_member_constraint`), and one meant *just* to replace region vids with an external region. Use the latter in the usage sites I added in #136559, since the regions returned by `name_regions_for_member_constraint` are also not *totally* accurate (which is fine for how they're used for member region constraint error reporting -- they're intentionally returning overapproximated universal regions so that we have something to name in `+ use<'a>` suggestions, because opaques can only capture universal regions and since member region constraints don't insert any edges into the region graph, the error region is probably gonna be shorter than a universal region) and because that function requires the reverse scc graph to have been computed which isn't done for our usages in #136559.
2025-02-16Rollup merge of #137072 - Urgau:check-cfg-load-builtins-at-once, r=NoratriebMatthias Krüger-6/+15
Load all builtin targets at once instead of one by one in check-cfg This PR adds a method on `rustc_target::Target` to load all the builtin targets at once, and then uses that method when constructing the `target_*` values in check-cfg instead of load loading each target one by one by their name, which requires a lookup and was more of a hack anyway. This may give us some performance improvements as we won't need to do the lookup for the _currently_ 287 targets we have.
2025-02-16Rollup merge of #137012 - Shourya742:2025-02-14-doc-and-unit-test-cc-detect, ↵Matthias Krüger-3/+285
r=onur-ozkan add docs and ut for bootstrap util cc-detect This PR adds doc and unit test for bootstrap utils/cc-detect module