33577 Commits

Author SHA1 Message Date
Laurențiu Nicola
88fbdcd510
Merge pull request #19192 from BenjaminBrienen/patch-4
Update style.md
2025-02-20 18:53:54 +00:00
Benjamin Brienen
3a333962ee
Update style.md
fix dead link
2025-02-20 19:38:24 +01:00
bors
c1e647b1e7 Auto merge of #136771 - scottmcm:poke-slice-iter-next, r=joboet
Simplify `slice::Iter::next` enough that it inlines

Inspired by this zulip conversation: <https://rust-lang.zulipchat.com/#narrow/channel/189540-t-compiler.2Fwg-mir-opt/topic/Feedback.20on.20a.20MIR.20optimization.20idea/near/498579990>

~~Draft for now because it needs #136735 to get the codegen tests to pass.~~
2025-02-20 18:20:40 +00:00
Lukas Wirth
88bc40aac0
Merge pull request #19189 from Veykril/push-qutznxznnwqn
minor: Improve unset `OUT_DIR` error message
2025-02-20 18:15:29 +00:00
Lukas Wirth
6b32c8329f Improve unset OUT_DIR error message 2025-02-20 19:00:23 +01:00
Laurențiu Nicola
8de928d028
Merge pull request #19190 from BenjaminBrienen/patch-4
Update editor_features.md
2025-02-20 16:20:35 +00:00
Benjamin Brienen
701c2de137
Update editor_features.md
fix typos in snippets
2025-02-20 17:05:18 +01:00
Lukas Wirth
6265c53132
Merge pull request #19151 from infiniteregrets/infi/fix-proc-macro
Use correct working directory for non-workspace proc-macro execution
2025-02-20 16:04:52 +00:00
Laurențiu Nicola
2612123e8a
Merge pull request #19188 from lnicola/ubuntu-latest
internal: Use ubuntu-latest workers for releases
2025-02-20 07:50:21 +00:00
Laurențiu Nicola
85e627433b Use ubuntu-latest workers for releases 2025-02-20 09:34:19 +02:00
Laurențiu Nicola
457d1d263c
Merge pull request #19185 from BenjaminBrienen/patch-3
Update architecture.md
2025-02-20 07:23:34 +00:00
Laurențiu Nicola
99ea63459a
Merge pull request #19187 from BenjaminBrienen/patch-4
Update configuration.md
2025-02-20 07:06:39 +00:00
Laurențiu Nicola
1d1da786c9
Merge pull request #19186 from joshrotenberg/fix-source-link-line-anchor
doc: missed the L for the line number
2025-02-20 07:06:13 +00:00
bors
99beae85a5 Auto merge of #137023 - Kobzol:bump-sccache, r=marcoieni
Bump sccache in CI to 0.9.1

We haven't updated the used sccache version for years, it has accrued a bunch of fixes and features in the meantime. It now supports the `--show-adv-stats` flag, which gives a more detailed summary of the results of caching. And it can also cache Rust code, which could be useful in the future (https://github.com/rust-lang/rust/pull/136942 - although now there are no large wins).

It also supports caching PGO now, but since the PGO profiles are always different, it won't make any real difference.

https://github.com/rust-lang/rust/pull/133076 previously tried to update the version to 0.3 (CC `@klensy)`

r? `@marcoieni`
2025-02-20 05:59:04 +00:00
Benjamin Brienen
92e9c76f15
Update configuration.md
fix dead links
2025-02-20 03:21:45 +01:00
Josh Rotenberg
5968782ce6 missed the L for the line number 2025-02-19 16:52:12 -08:00
Benjamin Brienen
11daea37b6
Update architecture.md
it is stable since 1.52
2025-02-20 01:28:20 +01:00
Shoyu Vanilla
a82773ab48 Explicitly compare TypesMap as ptrs 2025-02-20 08:49:00 +09:00
Shoyu Vanilla
9d459e8de7 fix: Binding wrong assoc ty when lowering trait ref bound 2025-02-20 00:47:21 +09:00
bors
45ad364b10 Auto merge of #136539 - matthewjasper:late-normalize-errors, r=compiler-errors
Emit dropck normalization errors in borrowck

Borrowck generally assumes that any queries it runs for type checking will succeed, thinking that HIR typeck will have errored first if there was a problem. However as of #98641, dropck isn't run on HIR, so there's no direct guarantee that it doesn't error. While a type being well-formed might be expected to ensure that its fields are well-formed, this is not the case for types containing a type projection:

```rust
pub trait AuthUser {
    type Id;
}

pub trait AuthnBackend {
    type User: AuthUser;
}

pub struct AuthSession<Backend: AuthnBackend> {
    data: Option<<<Backend as AuthnBackend>::User as AuthUser>::Id>,
}

pub trait Authz: Sized {
    type AuthnBackend: AuthnBackend<User = Self>;
}

pub fn run_query<User: Authz>(auth: AuthSession<User::AuthnBackend>) {}
// ^ No User: AuthUser bound is required or inferred.
```

While improvements to trait solving might fix this in the future, for now we go for a pragmatic solution of emitting an error from borrowck (by rerunning dropck outside of a query) and making drop elaboration check if an error has been emitted previously before panicking for a failed normalization.

Closes #103899
Closes #135039

r? `@compiler-errors` (feel free to re-assign)
2025-02-19 07:49:08 +00:00
Lukas Wirth
9691da7707
Merge pull request #19180 from joshrotenberg/fix-source-file-url
doc: use fully qualified url for source path
2025-02-19 06:37:01 +00:00
Chayim Refael Friedman
3028f844c5
Merge pull request #19179 from alibektas/19090_new
Ignore assists with many results if grouping not supported
2025-02-18 21:13:06 +00:00
Ali Bektas
9d5a97368a Add a check_assist_* overload and move tests under assists 2025-02-18 21:58:27 +01:00
Josh Rotenberg
ea9e179287 use fully qualified url for source path 2025-02-18 12:57:18 -08:00
Ali Bektas
fc10fe44de Fix 19090 2025-02-18 20:51:42 +01:00
Laurențiu Nicola
4a6ea31013
Merge pull request #19176 from BenjaminBrienen/patch-3
Fix dead link
2025-02-18 16:39:43 +00:00
Benjamin Brienen
e5484d9c73
Fix dead link 2025-02-18 17:22:45 +01:00
Lukas Wirth
957d3450da
Merge pull request #19173 from rust-lang/revert-19122-master
Revert "pass struct fields to chalk"
2025-02-18 10:53:35 +00:00
Lukas Wirth
6543225ad9
Revert "pass struct fields to chalk" 2025-02-18 11:37:43 +01:00
bors
b219a0e9ab Auto merge of #133852 - x17jiri:cold_path, r=saethlin
improve cold_path()

#120370 added a new instrinsic `cold_path()` and used it to fix `likely` and `unlikely`

However, in order to limit scope, the information about cold code paths is only used in 2-target switch instructions. This is sufficient for `likely` and `unlikely`, but limits usefulness of `cold_path` for idiomatic rust. For example, code like this:

```
if let Some(x) = y { ... }
```

may generate 3-target switch:

```
switch y.discriminator:
0 => true branch
1 = > false branch
_ => unreachable
```

and therefore marking a branch as cold will have no effect.

This PR improves `cold_path()` to work with arbitrary switch instructions.

Note that for 2-target switches, we can use `llvm.expect`, but for multiple targets we need to manually emit branch weights. I checked Clang and it also emits weights in this situation. The Clang's weight calculation is more complex that this PR, which I believe is mainly because `switch` in `C/C++` can have multiple cases going to the same target.
2025-02-18 07:49:09 +00: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
bors
46a58c0b0b Auto merge of #137162 - nnethercote:remove-Map-2, r=Zalathar
Move methods from `Map` to `TyCtxt`, part 2.

Continuing the work started in #136466.

Every method gains a `hir_` prefix, though for the ones that already have a `par_` or `try_par_` prefix I added the `hir_` after that.

r? Zalathar
2025-02-18 04:26:30 +00:00
bors
f9a1c5fa97 Auto merge of #137176 - matthiaskrgr:rollup-eht05gr, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #136959 (Simplify switch sources)
 - #137020 (Pass vendored sources from bootstrap to generate-copyright)
 - #137073 (boostrap: skip no_std targets in Std doc step)
 - #137165 (Use `tell` for `<File as Seek>::stream_position`)
 - #137166 (Update default loongarch code model in docs)
 - #137168 (correct comment)
 - #137169 (CI: rfl: move job forward to Linux v6.14-rc3)
 - #137170 (Allow configuring jemalloc per target)
 - #137173 (Subtree update of `rust-analyzer`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-02-18 00:05:30 +00:00
Josh Rotenberg
f40ff2d8dc move dev docs to manual
fix formatting
2025-02-17 10:47:27 -08:00
Matthias Krüger
447b34760d
Rollup merge of #137173 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2025-02-17 17:06:14 +01:00
Matthias Krüger
be09683e8d
Rollup merge of #137170 - ferrocene:pa-target-jemalloc, r=Kobzol
Allow configuring jemalloc per target

In Ferrocene we're trying to switch from `./configure` to a predefined `config.toml` file. One of the limitations of doing that is the `rust.jemalloc` configuration option, which we need to conditionally disable based on the target. This PR adds a `target.$tuple.jemalloc` option to override `rust.jemalloc` to make that possible.
2025-02-17 17:06:13 +01:00
Matthias Krüger
dcc3e86aae
Rollup merge of #137169 - ojeda:rfl, r=lqd
CI: rfl: move job forward to Linux v6.14-rc3

Linux v6.14-rc3 contains commit 6273a058383e ("x86: rust: set rustc-abi=x86-softfloat on rustc>=1.86.0"), which resolves the error from https://github.com/rust-lang/rust/pull/136146.

r? `@lqd` `@Kobzol`
try-job: x86_64-rust-for-linux
`@rustbot` label A-rust-for-linux
`@bors` try
2025-02-17 17:06:13 +01:00
Matthias Krüger
69f75bdb8d
Rollup merge of #137168 - klensy:rc--, r=lcnr
correct comment

Rc was removed in #113573, so
r? `@lcnr`
2025-02-17 17:06:12 +01:00
Matthias Krüger
528e08128b
Rollup merge of #137166 - nikic:loongarch-code-model, r=workingjubilee
Update default loongarch code model in docs

Since https://github.com/rust-lang/rust/pull/130266 loongarch defaults to medium code model.
2025-02-17 17:06:11 +01:00
Matthias Krüger
6920a44039
Rollup merge of #137165 - thaliaarchi:file-tell, r=ChrisDenton
Use `tell` for `<File as Seek>::stream_position`

Some platforms have a more efficient way to get the current offset of the file than by seeking. For example, Wasi has `fd_tell` and SOLID has `SOLID_FS_Ftell`. Implement `<File as Seek>::stream_position()` in terms of those.

I do not use any APIs that were not already used in `std`. Although, the `libc` crate has [`ftell`](https://docs.rs/libc/latest/libc/fn.ftell.html), [`ftello`](https://docs.rs/libc/latest/libc/fn.ftello.html), and [`ftello64`](https://docs.rs/libc/latest/libc/fn.ftello64.html), I do not know platform coverage. It appears that Windows has no `tell`-like API.

I have checked that it builds on each relevant platform.
2025-02-17 17:06:10 +01:00
Matthias Krüger
a728da7461
Rollup merge of #137073 - niklaskorz:bootstrap-doc-fix-empty-no-std, r=clubby789
boostrap: skip no_std targets in Std doc step

This fixes a bug that currently prevents us from adding no_std library targets to rustc in nixpkgs (https://github.com/NixOS/nixpkgs/pull/382166).

When running `./x.py doc`, the `Std` doc step generally fails for no_std targets, logs: https://gist.github.com/niklaskorz/fb83f9503ce19b75e8b1af02cdebd592

Skipping no_std targets in this step will allow using no_std targets such as `bpfel-unknown-none` together with other targets in the same config without blocking the doc generator for them, e.g.

```
./configure --release-channel=stable --tools=rustc,rustdoc,rust-analyzer-proc-macro-srv --build=aarch64-apple-darwin --host=aarch64-apple-darwin --target=aarch64-apple-darwin,bpfel-unknown-none

./x.py doc
```

Logs with this fix applied: https://gist.github.com/niklaskorz/cdd50aaea33ede579f737434286d800b
2025-02-17 17:06:10 +01:00
Matthias Krüger
a6b4f342d7
Rollup merge of #137020 - ferrocene:pa-vendor-sources, r=Kobzol
Pass vendored sources from bootstrap to generate-copyright

In addition to doing the vendoring in bootstrap, this PR also loads the list of manifests to parse from bootstrap (instead of hardcoding a smaller list in generate-copyright). This is best reviewed commit-by-commit.

Fixes https://github.com/rust-lang/rust/issues/136955
2025-02-17 17:06:09 +01:00
Matthias Krüger
1d213c5f13
Rollup merge of #136959 - nnethercote:simplify-SwitchSources, r=tmiasko
Simplify switch sources

`SwitchSources` and the code around it can be simplified.

r? `@tmiasko`
2025-02-17 17:06:08 +01:00
Mehul Arora
3a31741627 Use correct working directory for non-workspace proc-macro execution 2025-02-17 10:36:32 -05:00
bors
e2795ebdf0 Auto merge of #135763 - nikic:llvm-20, r=cuviper
Update to LLVM 20

LLVM 20 GA is scheduled for March 11th. Rust 1.87 will be stable on May 15th.

* [x] https://github.com/rust-lang/rust/pull/135764
* [x] https://github.com/rust-lang/rust/pull/136134
* [x] https://github.com/rust-lang/compiler-builtins/pull/752
* [x] https://github.com/llvm/llvm-project/pull/125287
* [x] https://github.com/rust-lang/rust/pull/136537
* [x] https://github.com/rust-lang/rust/pull/136895
* [x] Wait for beta branch (Feb 14).

Tested: host-x86_64, host-aarch64, apple, mingw, msvc
2025-02-17 14:19:33 +00: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