1
Fork 0
Commit graph

277127 commits

Author SHA1 Message Date
bors
a92c3cf04d Auto merge of #134722 - ChrisDenton:trunc, r=Amanieu
Windows: Use FILE_ALLOCATION_INFO for truncation

We use `FILE_END_OF_FILE_INFO` here only because WINE does not support `FILE_ALLOCATION_INFO`. Instead of going with the one with broadest support, let's just use that as fallback only.
2024-12-24 22:00:05 +00:00
llogiq
85b609419b
auto-fix if_not_else (#13809)
fix #13411

The `if_not_else` lint can be fixed automatically, but the issue above
reports that there is no implementation to do so. Therefore, this PR
implements it.

----

changelog: [`if_not_else`]: make suggestions for modified code
2024-12-24 21:45:42 +00:00
bors
409998c4e8 Auto merge of #134333 - daxpedda:stdarch-bump, r=daxpedda
Bump `stdarch`

This bumps `stdarch` to 684de0d6fe to get in https://github.com/rust-lang/stdarch/pull/1677 (tracked in https://github.com/rust-lang/rust/issues/133908).

From the [commit history](e5e00aab0a...684de0d6fe) I deduced that there shouldn't be any changes to Rust necessary.

From past PRs I'm assuming that bumping `stdarch` like this is fine, but please let me know if this is somehow inappropriate or requires something more to be done!

try-job: arm-android
try-job: armhf-gnu
2024-12-24 19:19:48 +00:00
Michael Goulet
a6a707169d Consider arm to diverge if guard diverges 2024-12-24 19:12:13 +00:00
Alex Saveau
96cc078878
Fix compilation issues on other unixes
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2024-12-24 10:58:31 -08:00
daxpedda
374800b88d
Bump stdarch 2024-12-24 19:00:57 +01:00
bors
d53b0ff6b5 Auto merge of #134724 - onur-ozkan:type-improvements, r=jieyouxu
improve type mutation for certain structures

self-explanatory
2024-12-24 16:40:11 +00:00
oliveredget
be1d5dd494
chore: fix typos 2024-12-24 23:37:30 +08:00
onur-ozkan
6b2fd4f234 improve type mutation for certain structures
self-explanatory

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-12-24 13:42:46 +00:00
deltragon
6a89f8789a Use scoped threads in std::sync::Barrier examples
This removes boilerplate around `Arc`s and makes the code more clear.
2024-12-24 14:39:02 +01:00
lapla-cogito
887aa269b6
add more tests 2024-12-24 21:10:43 +09:00
Chris Denton
ca56dc8537
Windows: Use FILE_ALLOCATION_INFO for truncation
But fallback to FILE_END_OF_FILE_INFO for WINE
2024-12-24 11:04:12 +00:00
bors
32c8a9f49d Auto merge of #134513 - fudancoder:master, r=jieyouxu
Fix some typos
2024-12-24 06:12:04 +00:00
fudancoder
e97be25aa9 Fix some typos
Signed-off-by: fudancoder <fudancoder@icloud.com.>
2024-12-24 11:35:38 +08:00
bors
d3e71fd2d3 Auto merge of #134716 - Zalathar:rollup-1h4q8cc, r=Zalathar
Rollup of 5 pull requests

Successful merges:

 - #134638 (Fix effect predicates from item bounds in old solver)
 - #134662 (Fix safety docs for `dyn Any + Send {+ Sync}`)
 - #134689 (core: fix const ptr::swap_nonoverlapping when there are pointers at odd offsets)
 - #134699 (Belay new reviews for workingjubilee)
 - #134701 (Correctly note item kind in `NonConstFunctionCall` error message)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-24 03:33:09 +00:00
Stuart Cook
772b95e755
Rollup merge of #134701 - compiler-errors:non-const-def-descr, r=Urgau,fmease
Correctly note item kind in `NonConstFunctionCall` error message

Don't just call everything a "`fn`". This is more consistent with the error message we give for conditionally-const items, which do note the item's def kind.

r? fmease, this is a prerequisite for making those `~const PartialEq` error messages better. Re-roll if you're busy or don't want to review this.
2024-12-24 14:05:24 +11:00
Stuart Cook
33311856e1
Rollup merge of #134699 - workingjubilee:jubilee-jubilee, r=lqd
Belay new reviews for workingjubilee

My queue is at-capacity, effectively.
2024-12-24 14:05:23 +11:00
Stuart Cook
bbd30b5476
Rollup merge of #134689 - RalfJung:ptr-swap-test, r=oli-obk
core: fix const ptr::swap_nonoverlapping when there are pointers at odd offsets

Ensure that the pointer gets swapped correctly even if it is not stored at an aligned offset. This rules out implementations that copy things in a `usize` loop -- so our implementation needs to be adjusted to avoid such a loop when running in const context.

Part of https://github.com/rust-lang/rust/issues/133668
2024-12-24 14:05:22 +11:00
Stuart Cook
0c93b279ea
Rollup merge of #134662 - ionicmc-rs:any-safety-docs, r=Amanieu
Fix safety docs for `dyn Any + Send {+ Sync}`

Fixes the `# Safety` docs for `dyn Any + Send`'s `downcast_{mut/ref}_unchecked` to show the direct instructions , where previously the would tell the user to find the docs on `dyn Any` themselves.

This also adds them for `downcast_{mut/ref}_unchecked` on `dyn Any + Send + Sync`
2024-12-24 14:05:22 +11:00
Stuart Cook
c2f44cd32c
Rollup merge of #134638 - compiler-errors:fx-item-bounds, r=lcnr
Fix effect predicates from item bounds in old solver

r? lcnr
2024-12-24 14:05:21 +11:00
bors
f3343420c8 Auto merge of #134625 - compiler-errors:unsafe-binders-ty, r=oli-obk
Begin to implement type system layer of unsafe binders

Mostly TODOs, but there's a lot of match arms that are basically just noops so I wanted to split these out before I put up the MIR lowering/projection part of this logic.

r? oli-obk

Tracking:

- https://github.com/rust-lang/rust/issues/130516
2024-12-24 00:51:51 +00:00
bors
b5fe6ec47b Auto merge of #134625 - compiler-errors:unsafe-binders-ty, r=oli-obk
Begin to implement type system layer of unsafe binders

Mostly TODOs, but there's a lot of match arms that are basically just noops so I wanted to split these out before I put up the MIR lowering/projection part of this logic.

r? oli-obk

Tracking:

- https://github.com/rust-lang/rust/issues/130516
2024-12-24 00:51:51 +00:00
Alexis (Poliorcetics) Bourget
8cf09c77c8
nit: cleanups in Cfg::simplify_with 2024-12-24 00:10:15 +01:00
Michael Goulet
92f93f6d11 Note def descr in NonConstFunctionCall 2024-12-23 22:15:32 +00:00
bors
65fe42a5f4 Auto merge of #134493 - compiler-errors:drops-elaborated, r=oli-obk
Always run `tail_expr_drop_order` lint in promoted MIR query

Rather than running the lint at the beginning of `mir_drops_elaborated_and_const_checked`, run it at the end of `mir_promoted`.  This should ensure that the lint gets picked up when running `cargo fix`, which runs with `--emit metadata` and therefore doesn't actually query `mir_drops_elaborated_and_const_checked`.

We could probably push this down into `mir_built` too? but I don't really see a good reason to do so.

https://github.com/rust-lang/rust/issues/132861#issuecomment-2539960199

cc `@ehuss`
2024-12-23 22:14:38 +00:00
Michael Goulet
b893221517 Always run tail_expr_drop_order lint on promoted MIR 2024-12-23 20:25:41 +00:00
bors
bdc6b3de48 Auto merge of #134405 - rmehri01:x-completions, r=onur-ozkan
Generate shell completions for x as well

It would be nice to be have shell completions for both `./x` and `x` (installed with `cargo install --path src/tools/x`) instead of just `x.py`. This pr generates the corresponding completions for each shell in a similar way to `x.py` but under `x.<shell>` instead.
2024-12-23 19:31:58 +00:00
Jubilee Young
98cc5a77bd Belay new reviews for workingjubilee
My queue is at-capacity, effectively.
2024-12-23 11:22:43 -08:00
bors
addbd001ec Auto merge of #134687 - matthiaskrgr:rollup-m32tkax, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #134363 (Use `#[derive(Default)]` instead of manual `impl` when possible)
 - #134517 (Add tests for coverage attribute on trait functions)
 - #134528 (opt-dist: propagate channel info to bootstrap)
 - #134669 (Document the `--dev` flag for `src/ci/docker/run.sh`)
 - #134680 (Clean up a few rmake tests  )

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-23 16:40:02 +00:00
Oli Scherer
cb73bb6538
Merge pull request #4105 from RalfJung/many-seeds
Implement many-seeds mode directly in the driver
2024-12-23 15:49:34 +00:00
Ralf Jung
af1c8da172 core: fix const ptr::swap_nonoverlapping when there are pointers at odd offsets in the type 2024-12-23 16:24:45 +01:00
Ralf Jung
fdfd064c62 use std::sync::Once instead of hand-rolling a bad version of it 2024-12-23 16:24:24 +01:00
Alejandra González
988042e0b2
chore: multipart suggestions for let_unit_value lint (#13754)
This should address #13099 for the let_unit test.

changelog: [let_unit]: Updated let_unit to use multipart_suggestions
where appropriate
2024-12-23 14:50:01 +00:00
Ralf Jung
411658566d many-seeds: add flag to keep going even after we found a failing seed 2024-12-23 14:50:26 +01:00
Ralf Jung
0f49f0ffdf stop using process-wide state, now that we are running multiple interpreters in the same thread 2024-12-23 14:50:26 +01:00
Matthias Krüger
a16fc10f23
Rollup merge of #134680 - lqd:run-make-cleanup, r=jieyouxu
Clean up a few rmake tests

Now I'm aware it's a bit late to start participating in the Advent of Tests, but here are a few cleanups in the rmake tests to put under the 🎄 anyways. A handful of unused imports, some warnings, and a couple typos.

r? `@jieyouxu` 🎅
2024-12-23 14:44:22 +01:00
Matthias Krüger
a62f245fb7
Rollup merge of #134669 - clubby789:dev-ci-mode, r=jieyouxu
Document the `--dev` flag for `src/ci/docker/run.sh`

This flag is very helpful for debugging CI issues locally, but it's not documented anywhere and I wasn't aware of it until `@jieyouxu` pointed it out. Add a note to the CI Docker readme to make this more discoverable
2024-12-23 14:44:21 +01:00
Matthias Krüger
cfb7a56676
Rollup merge of #134528 - jieyouxu:fix-rustc-bootstrap-test, r=Kobzol
opt-dist: propagate channel info to bootstrap

Fixes #133503.

Previously, `tests/ui/bootstrap/rustc_bootstap.rs` [sic] failed during [beta bump](https://github.com/rust-lang/rust/pull/133447#issuecomment-2501298794) in opt-dist tests. This is because:

- `opt-dist` tried to run `./x test` against beta-channel dist `rustc` through `bootstrap`.
- The dist build produced during the beta bump produces a `rustc` which correctly thinks that it is a beta compiler based on `src/ci/channel` info.
- `opt-dist` tries to run `./x test` on the beta `rustc` from the dist build, but without specifying channel through a synthetic `config.toml`, so `bootstrap` tells `compiletest` that we're on the `nightly` channel (by default).
- Now there's a channel mismatch: `compiletest` believes the `rustc` under test is a *nightly* rustc, but the `rustc` under test actually considers itself a *beta* rustc. This means that `//@ only-nightly` will be satisfied yet the test will fail as the *beta* rustc is not a *nightly* rustc.

This PR:

- Fixes the test failure during beta bump (i.e. #133503) by having `opt-dist` faithfully report the channel of the dist `rustc` being tested (i.e. "beta" in a beta bump PR). This will properly make the test be ignored during beta bump as the `rustc` under test is not a *nightly* rustc.
- Fixes the test name `rustc_bootstap.rs` -> `rustc_bootstrap.rs`. No more stapping.
- Slightly adjusts the doc comment in the test to make it more clear.

I ran a try-job against the beta branch (explicitly running the opt-dist tests by modifying the job definition) with these changes in #134131, and it appears that the try-job was [successful](https://github.com/rust-lang/rust/pull/134131#issuecomment-2555492215). The two commits in this PR are cherry-picked from #134131, with the test commit slightly modified (to also adjust the test comments).

r? `@Kobzol` (or compiler or bootstrap or infra I guess?)
2024-12-23 14:44:21 +01:00
Matthias Krüger
369be1855d
Rollup merge of #134517 - ehuss:coverage-trait-test, r=Zalathar
Add tests for coverage attribute on trait functions

This adds tests for the coverage attribute on trait functions. cc https://github.com/rust-lang/rust/issues/84605#issuecomment-2552420962
2024-12-23 14:44:20 +01:00
Matthias Krüger
95c33e303b
Rollup merge of #134363 - estebank:derive-default, r=SparrowLii
Use `#[derive(Default)]` instead of manual `impl` when possible

While working on #134175 I noticed a few manual `Default` `impl`s that could be `derive`d instead. These likely predate the existence of the `#[default]` attribute for `enum`s.
2024-12-23 14:44:20 +01:00
Eric Huss
5d9f17f58c Add test for coverage on a body-less trait function 2024-12-24 00:09:39 +11:00
Eric Huss
0efa90f246 Add a test for coverage attr on trait function 2024-12-24 00:09:38 +11:00
Ralf Jung
d04b972f72 remove --many-seeds from ./miri run 2024-12-23 13:58:35 +01:00
Ralf Jung
0bd76e1840 remove many-seeds mode from cargo-miri 2024-12-23 13:58:35 +01:00
Ralf Jung
d80f319121 add -Zmiri-many-seeds flag to the driver itself 2024-12-23 13:58:35 +01:00
许杰友 Jieyou Xu (Joe)
7ee520491e tests: migrate incr-add-rust-src-component to rmake.rs
The Makefile version seems to contain a bug. Over the years, the
directory structure of the `rust-src` component changed as the source
tree directory structure changed. `libstd` is no longer a thing directly
under `root/lib/rustlib/src/rust/src/`, it is moved to
`root/lib/rustlib/src/rust/library/std`.

Co-authored-by: Oneirical <manchot@videotron.ca>
2024-12-23 20:23:57 +08:00
bors
904d8f6b39 Auto merge of #134681 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2024-12-23 12:18:14 +00:00
Laurențiu Nicola
8dbdcc03eb
Merge pull request #18746 from lnicola/sync-from-rust
minor: Sync from downstream
2024-12-23 10:12:23 +00:00
Rémy Rakic
6f19bd08b0 fix a few typos in rmake tests' comments 2024-12-23 09:40:38 +00:00
Rémy Rakic
9ca5df692b remove unnecessary mut from dump-ice-to-disk rmake test 2024-12-23 09:40:38 +00:00