1
Fork 0
Commit graph

279875 commits

Author SHA1 Message Date
Sky
b320e1741c
Remove minor future footgun in impl Debug for MaybeUninit
No longer breaks if `MaybeUninit` moves modules (technically it could break if `MaybeUninit` were renamed but realistically that will never happen)
2025-01-29 20:23:59 -05:00
Nicholas Nethercote
022c0ce947 Remove NamedVarMap.
`NamedVarMap` is extremely similar to `ResolveBoundVars`. The former
contains two `UnordMap<ItemLocalId, T>` fields (obscured behind
`ItemLocalMap` typedefs). The latter contains two
`SortedMap<ItemLocalId, T>` fields. We construct a `NamedVarMap` and
then convert it into a `ResolveBoundVars` by sorting the `UnordMap`s,
which is unnecessary busywork.

This commit removes `NamedVarMap` and constructs a `ResolveBoundVars`
directly. `SortedMap` and `NamedVarMap` have slightly different
perf characteristics during construction (e.g. speed of insertion) but
this code isn't hot enough for that to matter.

A few details to note.
- A `FIXME` comment is removed.
- The detailed comments on the fields of `NamedVarMap` are copied to
  `ResolveBoundVars` (which has a single, incorrect comment).
- `BoundVarContext::map` is renamed.
- `ResolveBoundVars` gets a derived `Default` impl.
2025-01-30 09:39:52 +11:00
bors
4a5f1cc52b Auto merge of #135818 - jieyouxu:migrate-translation, r=compiler-errors
tests: Port `translation` to rmake.rs

Part of #121876.

This PR partially supersedes #129011 and is co-authored with `@Oneirical.`

## Summary

This PR ports `tests/run-make/translation` to rmake.rs. Notable changes from the Makefile version include:

- We now actually fail if the rustc invocations fail... The Makefile did not have `SHELL=/bin/bash -o pipefail`, so all the piped rustc invocations to grep vacuously succeeded, even if the broken ftl test case actually regressed over time and ICEs on current master.
    - That test case is converted to assert it fails with a FIXME backlinking to #135817.
- The test coverage is expanded to not ignore windows. Instead, the test now uses symlink capability detection to gate test execution.
- Added some backlinks to relevant tracking issues and the initial translation infra implementation PR.

## Review advice

Best reviewed commit-by-commit.

r? compiler

try-job: aarch64-apple
try-job: i686-mingw
2025-01-29 22:01:53 +00:00
MarcoIeni
aeabd4bebe
ci: use windows 2025 for i686-mingw 2025-01-29 21:26:39 +01:00
bors
ae5de6c759 Auto merge of #134248 - oli-obk:patkind-path-removal, r=BoxyUwU
Merge `PatKind::Path` into `PatKind::Expr`

Follow-up to #134228

We always had a duplication where `Path`s could be represented as `PatKind::Path` or `PatKind::Lit(ExprKind::Path)`. We had to handle both everywhere, and still do after #134228, so I'm removing it now.
2025-01-29 19:16:29 +00:00
Marijn Schouten
52519e145e Cleanup docs for Allocator 2025-01-29 20:15:49 +01:00
Michael Howell
eb457da5ca rustdoc: rename issue-\d+.rs tests to have meaningful names 2025-01-29 11:38:15 -07:00
edwloef
fb3d1d0c4b
add inline attribute and codegen test 2025-01-29 19:34:19 +01:00
edwloef
311c3b71f0
split slice::ptr_rotate into three separate algorithms, to hopefully help inlining 2025-01-29 19:34:15 +01:00
Michael Howell
fdef34b4dd Add URL and crate_name to test cases 2025-01-29 11:21:52 -07:00
Josh Stone
e4db6d7825 Add release notes for 1.84.1 2025-01-29 09:24:06 -08:00
Boxy
0b48908512
Rustc pull 2025-01-29 16:46:09 +00:00
Santiago Pastorino
2f276b36e2
spastorino back from vacations 2025-01-29 13:27:41 -03:00
bors
0cc4f4f7b8 Auto merge of #136248 - matthiaskrgr:rollup-leaxgfd, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #133382 (Suggest considering casting fn item as fn pointer in more cases)
 - #136092 (Test pipes also when not running on Windows and Linux simultaneously)
 - #136190 (Remove duplicated code in RISC-V asm bad-reg test)
 - #136192 (ci: remove unused windows runner)
 - #136205 (Properly check that array length is valid type during built-in unsizing in index)
 - #136211 (Update mdbook to 0.4.44)
 - #136212 (Tweak `&mut self` suggestion span)
 - #136214 (Make crate AST mutation accessible for driver callback)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-29 16:18:29 +00:00
Oli Scherer
559648a0a4 Handle all PatExprs in dead code analysis 2025-01-29 15:45:13 +00:00
Oli Scherer
8f09abb497 Add regression test showing we don't realize some consts are used 2025-01-29 15:45:13 +00:00
Oli Scherer
f47ad71059 Eliminate PatKind::Path 2025-01-29 15:45:13 +00:00
Matthias Krüger
c941b1c5fc
Rollup merge of #136214 - momvart:driver_callback_crate_mut, r=bjorn3
Make crate AST mutation accessible for driver callback

Following  #134130, this brings back the ability to mutate AST before lowering.
2025-01-29 15:29:51 +01:00
Matthias Krüger
1f6a9aacee
Rollup merge of #136212 - estebank:span-tweak, r=petrochenkov
Tweak `&mut self` suggestion span

```
error[E0596]: cannot borrow `*self.s` as mutable, as it is behind a `&` reference
  --> $DIR/issue-38147-1.rs:17:9
   |
LL |         self.s.push('x');
   |         ^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
   |
help: consider changing this to be a mutable reference
   |
LL |     fn f(&mut self) {
   |           +++
```

Note the suggestion to add `mut` instead of replacing the entire `&self` with `&mut self`.
2025-01-29 15:29:49 +01:00
Matthias Krüger
f614bfa6e2
Rollup merge of #136211 - ehuss:update-mdbook, r=ehuss
Update mdbook to 0.4.44

Updates to mdbook 0.4.44.
Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0444
2025-01-29 15:29:45 +01:00
Matthias Krüger
e8289d801c
Rollup merge of #136205 - compiler-errors:len-3, r=BoxyUwU
Properly check that array length is valid type during built-in unsizing in index

This results in duplicated errors, but this class of errors is not new; in general, we aren't really equipped to detect cases where a WF error due to a field type would be shadowed by the parent struct of that field also not being WF.

This also adds a note for these types of mismatches to make it clear that this is due to an array type.

Fixes #134352

r? boxyuwu
2025-01-29 15:29:41 +01:00
Matthias Krüger
936554756b
Rollup merge of #136192 - marcoieni:remove-windows-unused-runner, r=Kobzol
ci: remove unused windows runner
2025-01-29 15:29:37 +01:00
Matthias Krüger
bdb5590225
Rollup merge of #136190 - taiki-e:dedup, r=compiler-errors
Remove duplicated code in RISC-V asm bad-reg test

I added this test in https://github.com/rust-lang/rust/pull/132516, but I accidentally repeated the same check twice.

aa6f5ab18e/tests/ui/asm/riscv/bad-reg.rs (L39-L42)
2025-01-29 15:29:34 +01:00
Matthias Krüger
da7980b315
Rollup merge of #136092 - tbu-:pr_io_pipe_test, r=joboet
Test pipes also when not running on Windows and Linux simultaneously

Fixes https://github.com/rust-lang/rust/pull/135635#pullrequestreview-2574184488.

Based on top of #135635 to avoid merge conflicts.
2025-01-29 15:29:30 +01:00
Matthias Krüger
f8d103df43
Rollup merge of #133382 - mu001999-contrib:diag/fnitem, r=lcnr
Suggest considering casting fn item as fn pointer in more cases

Fixes #132648
2025-01-29 15:29:27 +01:00
onur-ozkan
869bc2fded override build profile for bootstrap tests
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-29 11:49:13 +00:00
bors
a1d7676d6a Auto merge of #136227 - fmease:rollup-ewpvznh, r=fmease
Rollup of 9 pull requests

Successful merges:

 - #136121 (Deduplicate operand creation between scalars, non-scalars and string patterns)
 - #136134 (Fix SIMD codegen tests on LLVM 20)
 - #136153 (Locate asan-odr-win with other sanitizer tests)
 - #136161 (rustdoc: add nobuild typescript checking to our JS)
 - #136166 (interpret: is_alloc_live: check global allocs last)
 - #136168 (GCI: Don't try to eval / collect mono items inside overly generic free const items)
 - #136170 (Reject unsound toggling of Arm atomics-32 target feature)
 - #136176 (Render pattern types nicely in mir dumps)
 - #136186 (uefi: process: Fix args)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-29 11:27:18 +00:00
Guillaume Gomez
2511faf61d Add SemiBold for SourceSerif4 2025-01-29 11:44:14 +01:00
Oli Scherer
a639e276f3 Allow transmuting generic pattern types to and from their base 2025-01-29 10:25:55 +00:00
Oli Scherer
22f074129a Add tests for transmuting pattern types 2025-01-29 10:25:55 +00:00
Guillaume Gomez
895564e038 Add italic for newly added sans serif fonts 2025-01-29 11:01:14 +01:00
Guillaume Gomez
999a25ee89 Fix tidy errors 2025-01-29 11:01:14 +01:00
Guillaume Gomez
91f6e000c2 Fix tidy errors 2025-01-29 11:01:14 +01:00
Guillaume Gomez
65fedebfc4 Add GUI test for new "sans serif fonts" setting 2025-01-29 11:01:14 +01:00
Guillaume Gomez
d93cbe5d69 Add new setting allowing to switch to sans serif fonts 2025-01-29 11:01:14 +01:00
Kajetan Puchalski
b7916fb4b7 tests: Skip const OOM tests on aarch64-unknown-linux-gnu
Skip const OOM tests on AArch64 Linux through explicit annotations
instead of inside opt-dist.
Intended to avoid confusion in cases like #135952.

Prerequisite for https://github.com/rust-lang/rust/pull/135960.
2025-01-29 09:17:35 +00:00
Marijn Schouten
57cfcd228d use impl Into<String> 2025-01-29 09:48:08 +01:00
bors
61cc3e51f8 Auto merge of #136117 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2025-01-29 08:43:30 +00:00
许杰友 Jieyou Xu (Joe)
6f5a1035f8 tests: port translation to rmake.rs
Co-authored-by: Oneirical <manchot@videotron.ca>
2025-01-29 08:11:01 +00:00
许杰友 Jieyou Xu (Joe)
5f513a6a88 run-make-support: improve docs for assert_exit_code 2025-01-29 08:11:01 +00:00
许杰友 Jieyou Xu (Joe)
dd616d6a16 run-make-support: add sysroot helper
Convenience helper for `rustc --print=sysroot`.
2025-01-29 08:10:05 +00:00
Bart Jacobs
810e4c1bc6
btree/node.rs: pop_internal_level: does not invalidate other handles 2025-01-29 08:35:29 +01:00
许杰友 Jieyou Xu (Joe)
bec4359db9
Merge pull request #2227 from Joren-vanGoethem/master 2025-01-29 05:03:36 +00:00
León Orell Valerian Liehr
7e60f276ce
Rollup merge of #136186 - Ayush1325:uefi-process-args-fix, r=nicholasbishop,Noratrieb
uefi: process: Fix args

- While working on process env support, I found that args were currently broken. Not sure how I missed it in the PR, but well here is the fix.
- Additionally, no point in adding space at the end of args.
2025-01-29 06:03:25 +01:00
León Orell Valerian Liehr
f49ad60fee
Rollup merge of #136176 - oli-obk:pattern-type-mir-opts, r=compiler-errors
Render pattern types nicely in mir dumps

avoid falling through to the fallback rendering that just does a hex dump

r? ``@scottmcm``

best reviewed commit by commit
2025-01-29 06:03:24 +01:00
León Orell Valerian Liehr
0b1d717758
Rollup merge of #136170 - taiki-e:atomics-32, r=workingjubilee
Reject unsound toggling of Arm atomics-32 target feature

This target feature has the same semantics as RISC-V `forced-atomics` target feature that already marked as Forbidden  (f5ed0cb217) and toggling it can cause ABI incompatibility.

2f348cb7ce/compiler/rustc_target/src/target_features.rs (L479-L483)

[Comment on feature definition in LLVM](7109f52197/llvm/lib/Target/ARM/ARMFeatures.td (L572-L574)) also says:

> Code built with this feature is not ABI-compatible with code built without this feature, if atomic variables are exposed across the ABI boundary.

r? `@workingjubilee` or `@RalfJung`

`@rustbot` label +O-Arm
2025-01-29 06:03:24 +01:00
León Orell Valerian Liehr
e37b744bae
Rollup merge of #136168 - fmease:gci-fix-mono, r=compiler-errors
GCI: Don't try to eval / collect mono items inside overly generic free const items

Fixes #136156. Thanks for the pointers, errs!

There's one (preexisting) thing of note (maybe?). There's a difference between `const _: () = panic!();` and `const _<'a>: () = panic!();`: The former is a pre-mono error, the latter is a post-mono error. For comparison, both `fn _f() { const { panic!() } }` and `fn _f<'a: 'a>() { const { panic!() } }` are post-mono errors.

cc `@oli-obk`
r? compiler-errors or reassign
2025-01-29 06:03:23 +01:00
León Orell Valerian Liehr
bde47b7ae8
Rollup merge of #136166 - RalfJung:interpet-is-alloc-live, r=compiler-errors
interpret: is_alloc_live: check global allocs last

See https://github.com/rust-lang/rust/pull/136105#discussion_r1930609553.

(A perf run makes no sense as this is only used by Miri.)
2025-01-29 06:03:23 +01:00
León Orell Valerian Liehr
3cc6ea2ac6
Rollup merge of #136161 - notriddle:typescript, r=GuillaumeGomez
rustdoc: add nobuild typescript checking to our JS

By nobuild, I mean that the type annotations are all [in comments], not in the "native" typescript syntax. This is a bit uglier, but it lets you rapid-prototype without tsc, works with all the native browser debugging tools, and keeps Node out of Rust's bootstrap chain.

[in comments]: https://news.ycombinator.com/item?id=35892250

This pull request mostly just adds ts-ignore annotations and type declarations. To actually take good advantage of typescript, we'll want to "burn down" this pile of unsafe code until we eventually have a version with almost none of these.

This PR also adds tsc to the mingw-check Dockerfile, so that it can't fall out of date like the Closure annotations did.

https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/typescript

r? `@GuillaumeGomez` `@lolbinarycat`
2025-01-29 06:03:22 +01:00
León Orell Valerian Liehr
dbc204d5d5
Rollup merge of #136153 - tmiasko:mv-asan-test, r=lqd
Locate asan-odr-win with other sanitizer tests
2025-01-29 06:03:21 +01:00