33425 Commits

Author SHA1 Message Date
Lukas Wirth
6543225ad9
Revert "pass struct fields to chalk" 2025-02-18 11:37:43 +01:00
Lukas Wirth
e865b249e6
Merge pull request #19157 from joshrotenberg/dev-guide-to-book
doc: move dev docs to manual
2025-02-18 07:00:23 +00:00
Josh Rotenberg
f40ff2d8dc move dev docs to manual
fix formatting
2025-02-17 10:47:27 -08:00
Laurențiu Nicola
d10388096e
Merge pull request #19170 from lnicola/update-lockfile
minor: Update lockfile
2025-02-17 13:06:12 +00:00
Laurențiu Nicola
a8a329d968 Update lockfile 2025-02-17 14:50:39 +02:00
Laurențiu Nicola
cba236d9b7
Merge pull request #19169 from lnicola/sync-from-rust
minor: Sync from downstream
2025-02-17 12:30:13 +00:00
Laurențiu Nicola
b4feffa5d6 Bump rustc crates 2025-02-17 14:11:12 +02:00
Lukas Wirth
656daef4da
Merge pull request #19167 from ChayimFriedman2/fix-ref-pat
fix: Fix detection of ref patterns for path patterns
2025-02-17 11:23:18 +00:00
Laurențiu Nicola
bec6d6fbe3 Merge from rust-lang/rust 2025-02-17 13:20:12 +02:00
Laurențiu Nicola
d6ed3e9aa9 Preparing for merge from rust-lang/rust 2025-02-17 13:20:07 +02:00
Chayim Refael Friedman
eb69d3734c Fix detection of ref patterns for path patterns
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-17 11:51:29 +02:00
Lukas Wirth
a3f937fc24
Merge pull request #19158 from PoignardAzur/expaned_pub_glob_imports
Implement expand_glob_reexport assist
2025-02-17 09:46:29 +00:00
Lukas Wirth
efdfdc448b
Merge pull request #19122 from Austaras/master
pass struct fields to chalk
2025-02-17 09:37:55 +00:00
Lukas Wirth
09db657439
Merge pull request #19127 from ChayimFriedman2/different-generic-args
feat: Refactor path lowering and serve a new path diagnostic
2025-02-17 08:30:10 +00:00
bors
65dcdc86f6 Auto merge of #137163 - matthiaskrgr:rollup-ovgfkns, r=matthiaskrgr
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-17 08:10:13 +00:00
Laurențiu Nicola
84b6936e08
Merge pull request #19166 from ChayimFriedman2/runnables-order
fix: Fix sorting of runnables
2025-02-17
2025-02-17 05:58:35 +00:00
Matthias Krüger
b578c91b40
Rollup merge of #137140 - Noratrieb:const-move, r=jieyouxu,compiler-errors
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-17 06:37:39 +01:00
Matthias Krüger
a708e3832a
Rollup merge of #137101 - GrigorenkoPV:str-inherent-lint, r=Urgau
`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-17 06:37:38 +01:00
Matthias Krüger
2cd2c5356f
Rollup merge of #137080 - jieyouxu:more-tracing, r=onur-ozkan
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-17 06:37:37 +01:00
Matthias Krüger
8be69f6d84
Rollup merge of #136844 - thaliaarchi:const-io-error, r=ChrisDenton
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-17 06:37:37 +01:00
Matthias Krüger
efd2c2832d
Rollup merge of #136817 - dianne:clean-and-comment-pat-migration, r=Nadrieril
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-17 06:37:36 +01:00
Matthias Krüger
cec1c9f382
Rollup merge of #136671 - nnethercote:middle-limits, r=Nadrieril
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-17 06:37:35 +01:00
Chayim Refael Friedman
353616be8b Fix sorting of runnables
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-17 03:03:29 +02:00
Nicholas Nethercote
610f4c4046 Rename pattern_complexity attr as pattern_complexity_limit.
For consistency with `recursion_limit`, `move_size_limit`, and
`type_length_limit`.
2025-02-17 09:30:40 +11:00
Nicholas Nethercote
30bcf2a6b5 Add pattern_complexity_limit to Limits.
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-17 09:30:33 +11:00
Chayim Refael Friedman
55c04ab371 Refactor path lowering
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-16 19:44:50 +02:00
bors
1aac8756bd Auto merge of #136914 - marcoieni:arm-ubuntu-24, r=jdno
ci: use ubuntu 24 for free arm runner

try-job: aarch64-gnu
try-job: aarch64-gnu-debug
2025-02-16 15:07:36 +00:00
Lukas Wirth
2b485d7f23
Merge pull request #19137 from asuto15/highlight-extern-crate
fix: highlight `extern crate` in doc comments
2025-02-16 14:07:07 +00:00
Lukas Wirth
5ec9d9fd5f
Merge pull request #19155 from ShoyuVanilla/migrate-missing-match-arms
internal: Remove mutable syntax tree usages from `add_missing_match_arms` assist
2025-02-16 14:06:45 +00:00
Lukas Wirth
168f177fe0
Merge pull request #19163 from Veykril/push-owykwupqnzpq
fix: Stabilize sort order of `related_tests`
2025-02-16 12:33:40 +00:00
Lukas Wirth
1afbc220bc fix: Stabilize sort order of related_tests 2025-02-16 13:18:47 +01:00
Lukas Wirth
b332a053e0
Merge pull request #19161 from Veykril/push-prmuyxlnxzxo
fix: Improve sort order of runnables
2025-02-16 11:37:52 +00:00
Lukas Wirth
7128701947
Merge pull request #19160 from Veykril/push-f3601671f6a468a8cc0774253ddaddff
Improve error recovery when method-calling an assoc function
2025-02-16 11:26:02 +00:00
Lukas Wirth
e0d1fba739 fix: Stabilize sort order of runnables 2025-02-16 12:22:26 +01:00
Lukas Wirth
e6ea353d94 Improve error recovery when method-calling an assoc function 2025-02-16 11:49:48 +01:00
Lukas Wirth
fb8bc313ff
Merge pull request #19159 from Veykril/push-kwtzytsyktpv
fix: Set `RUSTUP_TOOLCHAIN` when loading sysroot workspace
2025-02-16 10:08:51 +00:00
Lukas Wirth
b9f76287c2 Set RUSTUP_TOOLCHAIN when loading sysroot workspace 2025-02-16 10:54:08 +01:00
Olivier FAURE
4fa6595f9a Re-generate doctests 2025-02-15 16:26:28 +01:00
Shoyu Vanilla
7d74f2b3e9 Temporarily ignore tests with comments 2025-02-16 00:12:03 +09:00
Olivier FAURE
e4f62b6999 Implement expand_glob_reexport assist 2025-02-15 16:07:33 +01:00
Olivier FAURE
4de24de6b7 Factor out business logic of expand_glob_import 2025-02-15 13:23:32 +01:00
bors
4a8e46bc80 Auto merge of #136324 - GrigorenkoPV:erf, r=tgross35
Implement `f{16,32,64,128}::{erf,erfc}` (`#![feature(float_erf)]`)

Tracking issue: #136321

try-job: x86_64-gnu-aux
2025-02-15 04:52:50 +00:00
asuto15
c14140ab8b
fix: remove unnecessary conversion 2025-02-15 13:18:18 +09:00
asuto15
24a778f6c1
Delete library modifier to highlighting for extern crate 2025-02-15 12:06:21 +09:00
Lukas Wirth
40e4f9130f
Merge pull request #19156 from programmerjake/patch-1
add cargo's git checkouts to the list of paths to mark as read-only in vscode
2025-02-14 05:59:17 +00:00
Jacob Lifshay
a9dcc01357
add cargo's git checkouts to the list of paths to mark as read-only in vscode 2025-02-13 18:48:36 -08:00
bors
07ba8570a8 Auto merge of #134633 - GrigorenkoPV:get_disjoint_mut, r=cuviper
Stabilize `get_many_mut` as `get_disjoint_mut`

Tracking issue: #104642

Closes #104642

FCP completed in https://github.com/rust-lang/rust/issues/104642#issuecomment-2558161073
2025-02-13 21:09:31 +00:00
Shoyu Vanilla
8b947d7a12 internal: Remove mutable syntax tree usages from add_missing_match_arms assist 2025-02-14 02:36:05 +09:00
bors
c21bff4cc9 Auto merge of #136593 - lukas-code:ty-value-perf, r=oli-obk
valtree performance tuning

Summary: This PR makes type checking of code with many type-level constants faster.

After https://github.com/rust-lang/rust/pull/136180 was merged, we observed a small perf regression (https://github.com/rust-lang/rust/pull/136318#issuecomment-2635562821). This happened because that PR introduced additional copies in the fast reject code path for consts, which is very hot for certain crates: 6c1d960d88/compiler/rustc_type_ir/src/fast_reject.rs (L486-L487)

This PR improves the performance again by properly interning the valtrees so that copying and comparing them becomes faster. This will become especially useful with `feature(adt_const_params)`, so the fast reject code doesn't have to do a deep compare of the valtrees.

Note that we can't just compare the interned consts themselves in the fast reject, because sometimes `'static` lifetimes in the type are be replaced with inference variables (due to canonicalization) on one side but not the other.

A less invasive alternative that I considered is simply avoiding copies introduced by https://github.com/rust-lang/rust/pull/136180 and comparing the valtrees it in-place (see commit: 9e91e50ac5 / perf results: https://github.com/rust-lang/rust/pull/136593#issuecomment-2642303245), however that was still measurably slower than interning.

There are some minor regressions in secondary benchmarks: These happen due to changes in memory allocations and seem acceptable to me. The crates that make heavy use of valtrees show no significant changes in memory usage.
2025-02-13 15:27:30 +00:00
Lukas Wirth
51389bd00d
Merge pull request #19141 from Wilfred/split_editors
manual: Separate out installation and configuration pages
2025-02-13 06:44:39 +00:00