Commit Graph

279739 Commits

Author SHA1 Message Date
Hans Wennborg
23fb08bb53 LLVM changed the nocapture attribute to captures(none)
This updates RustWrapper.cpp and tests after
https://github.com/llvm/llvm-project/pull/123181
2025-01-30 11:22:46 +01:00
bors
e6f12c8b7d Auto merge of - Zalathar:rollup-6s577l5, r=Zalathar
Rollup of 5 pull requests

Successful merges:

 -  (optimize slice::ptr_rotate for small rotates)
 -  (btree/node.rs: remove incorrect comment from pop_internal_level docs)
 -  (spastorino back from vacations)
 -  (Rustc dev guide subtree update)
 -  (Cleanup docs for Allocator)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-30 04:12:59 +00:00
Stuart Cook
4059a796d5
Rollup merge of - hkBst:patch-30, r=thomcc
Cleanup docs for Allocator

This is an attempt to remove ungrammatical constructions and clean up the prose. I've sometimes had to try hard to understand what was being stated, so it is possible that I've misunderstood the original meaning. In particular, I did not see a difference between:
 - the borrow-checker lifetime of the allocator type itself.
 - as long as at least one of the allocator instance and all of its clones has not been dropped.
2025-01-30 14:25:07 +11:00
Stuart Cook
48b3eca63e
Rollup merge of - BoxyUwU:rdg-push, r=Kobzol
Rustc dev guide subtree update

r? `@Kobzol`
2025-01-30 14:25:06 +11:00
Stuart Cook
068f32235a
Rollup merge of - spastorino:remove-spastorino-on-vacations, r=jieyouxu
spastorino back from vacations
2025-01-30 14:25:06 +11:00
Stuart Cook
3a2f26f542
Rollup merge of - btj:patch-1, r=cuviper
btree/node.rs: remove incorrect comment from pop_internal_level docs
2025-01-30 14:25:05 +11:00
Stuart Cook
6ebe590e41
Rollup merge of - edwloef:slice_ptr_rotate_opt, r=scottmcm
optimize slice::ptr_rotate for small rotates

r? `@scottmcm`

This swaps the positions and numberings of algorithms 1 and 2 in `slice::ptr_rotate`, and pulls the entire outer loop into algorithm 3 since it was redundant for the first two. Effectively, `ptr_rotate` now always does the `memcpy`+`memmove`+`memcpy` sequence if the shifts fit into the stack buffer.
With this change, an `IndexMap`-style `move_index` function is optimized correctly.

Assembly comparisons:
- `move_index`, before: https://godbolt.org/z/Kr616KnYM
- `move_index`, after: https://godbolt.org/z/1aoov6j8h
- the code from `#89714`, before: https://godbolt.org/z/Y4zaPxEG6
- the code from `#89714`, after: https://godbolt.org/z/1dPx83axc

related to 
some relevant discussion in https://internals.rust-lang.org/t/idea-shift-move-to-efficiently-move-elements-in-a-vec/22184

Behavior tests pass locally. I can't get any consistent microbenchmark results on my machine, but the assembly diffs look promising.
2025-01-30 14:25:04 +11:00
bors
5e5567993d Auto merge of - SpecificProtagonist:miri-zeroed-alloc, r=oli-obk
miri: optimize zeroed alloc

When allocating zero-initialized memory in MIR interpretation, rustc allocates zeroed memory, marks it as initialized and then re-zeroes it. Remove the last step.

I don't expect this to have much of an effect on performance normally, but in my case in which I'm creating a large allocation via mmap it gets in the way.
2025-01-30 01:27:21 +00:00
bors
4a5f1cc52b Auto merge of - jieyouxu:migrate-translation, r=compiler-errors
tests: Port `translation` to rmake.rs

Part of .

This PR partially supersedes  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 .
- 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
bors
ae5de6c759 Auto merge of - oli-obk:patkind-path-removal, r=BoxyUwU
Merge `PatKind::Path` into `PatKind::Expr`

Follow-up to 

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 , 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
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
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 - matthiaskrgr:rollup-leaxgfd, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 -  (Suggest considering casting fn item as fn pointer in more cases)
 -  (Test pipes also when not running on Windows and Linux simultaneously)
 -  (Remove duplicated code in RISC-V asm bad-reg test)
 -  (ci: remove unused windows runner)
 -  (Properly check that array length is valid type during built-in unsizing in index)
 -  (Update mdbook to 0.4.44)
 -  (Tweak `&mut self` suggestion span)
 -  (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 - momvart:driver_callback_crate_mut, r=bjorn3
Make crate AST mutation accessible for driver callback

Following  , 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 - 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 - 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 - 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 

r? boxyuwu
2025-01-29 15:29:41 +01:00
Matthias Krüger
936554756b
Rollup merge of - 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 - 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 - 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  to avoid merge conflicts.
2025-01-29 15:29:30 +01:00
Matthias Krüger
f8d103df43
Rollup merge of - mu001999-contrib:diag/fnitem, r=lcnr
Suggest considering casting fn item as fn pointer in more cases

Fixes 
2025-01-29 15:29:27 +01:00
bors
a1d7676d6a Auto merge of - fmease:rollup-ewpvznh, r=fmease
Rollup of 9 pull requests

Successful merges:

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

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-29 11:27:18 +00:00
bors
61cc3e51f8 Auto merge of - 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 from Joren-vanGoethem/master 2025-01-29 05:03:36 +00:00
León Orell Valerian Liehr
7e60f276ce
Rollup merge of - 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 - 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 - 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 - fmease:gci-fix-mono, r=compiler-errors
GCI: Don't try to eval / collect mono items inside overly generic free const items

Fixes . 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 - 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 - 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 - tmiasko:mv-asan-test, r=lqd
Locate asan-odr-win with other sanitizer tests
2025-01-29 06:03:21 +01:00
León Orell Valerian Liehr
01f1dab0e9
Rollup merge of - nikic:llvm-20-simd-tests, r=Urgau
Fix SIMD codegen tests on LLVM 20

The splat constants are printed differently on LLVM 20.
2025-01-29 06:03:21 +01:00
León Orell Valerian Liehr
8d183d2b86
Rollup merge of - oli-obk:push-zzvxlynmnqpp, r=estebank
Deduplicate operand creation between scalars, non-scalars and string patterns

just something that felt duplicated and would make pattern type handling a bit more roundabout.
2025-01-29 06:03:20 +01:00
许杰友 Jieyou Xu (Joe)
7fa9822b3d
Merge pull request from yegeunyang/#2069 2025-01-29 05:02:55 +00:00
bors
ccc9ba5c30 Auto merge of - fmease:rollup-fm7m744, r=fmease
Rollup of 7 pull requests

Successful merges:

 -  ([cfg_match] Document the use of expressions.)
 -  (Do not consider child bound assumptions for rigid alias)
 -  (Rename `Piece::String` to `Piece::Lit`)
 -  (Add mermaid graphs of NLL regions and SCCs to polonius MIR dump)
 -  (Update books)
 -  (ABI-required target features: warn when they are missing in base CPU)
 -  (Refactor FnKind variant to hold &Fn)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-29 05:00:20 +00:00
yegeunyang
4260e3a5b8 Touch up a sentence 2025-01-28 22:56:52 -06:00
许杰友 Jieyou Xu (Joe)
d8cca31abf
Merge pull request from yegeunyang/#2114
Add a link to declare_lint! macro doc in diagnostics.md
2025-01-29 04:08:54 +00:00
许杰友 Jieyou Xu (Joe)
8520031842
Merge pull request from notriddle/typescript
Add some extra pointers for rustdoc frontend devs
2025-01-29 03:53:00 +00:00
yegeunyang
0127e6479f Add link to declare_lint! macro 2025-01-28 21:05:12 -06:00
yegeunyang
941ab8cd18 Add "Writing tests" section 2025-01-28 20:42:26 -06:00