1
Fork 0
Commit graph

277760 commits

Author SHA1 Message Date
Ralf Jung
675a1036ca on Windows, consistently pass ZST by-ref 2025-01-12 13:32:36 +01:00
Ralf Jung
d760bb6603 fix ZST handling for Windows ABIs on MSVC target 2025-01-10 12:16:49 +01:00
bors
67951d946a Auto merge of #135319 - matthiaskrgr:rollup-un5lol6, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #133088 (`-Zrandomize-layout` harder. `Foo<T> != Foo<U>`)
 - #134619 (Improve prose around `as_slice` example of IterMut)
 - #134855 (Add `default_field_values` entry to unstable book)
 - #134908 (Fix `ptr::from_ref` documentation example comment)
 - #135275 (Add Pin::as_deref_mut to 1.84 relnotes)
 - #135294 (Make `bare-fn-no-impl-fn-ptr-99875` test less dependent on path width)
 - #135304 (Add tests cases from review of #132289)
 - #135308 (Make sure to walk into nested const blocks in `RegionResolutionVisitor`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-10 06:05:05 +00:00
Matthias Krüger
c51bfaf07f
Rollup merge of #135308 - compiler-errors:scope-visit, r=oli-obk
Make sure to walk into nested const blocks in `RegionResolutionVisitor`

Fixes https://github.com/rust-lang/rust/issues/135306

I tried auditing the rest of the visitors that called `.visit_body`, and it seems like this is the only one that was missing it. I wonder if we should modify intravisit (specifcially, that `NestedBodyFilter` stuff) to make this less likely to happen, tho...

r? oli-obk
2025-01-10 06:28:42 +01:00
Matthias Krüger
6b88aa0162
Rollup merge of #135304 - steffahn:tests_from_132289, r=compiler-errors
Add tests cases from review of #132289

Adding my comments as test-cases as suggested by ``@jackh726`` in https://github.com/rust-lang/rust/pull/132289#issuecomment-2564602267
2025-01-10 06:28:41 +01:00
Matthias Krüger
efc25237ac
Rollup merge of #135294 - ChrisDenton:bare-fn-width, r=jieyouxu
Make `bare-fn-no-impl-fn-ptr-99875` test less dependent on path width

This sets diagnostic-width to some arbitrary number. Seems to work on my machine.
2025-01-10 06:28:41 +01:00
Matthias Krüger
7739e282ec
Rollup merge of #135275 - coolreader18:pin-as_deref_mut-relnotes, r=BoxyUwU
Add Pin::as_deref_mut to 1.84 relnotes

Resolves #131243 - I think this got missed in the relnotes sweep or something.

``@rustbot`` label relnotes
2025-01-10 06:28:40 +01:00
Matthias Krüger
6a40d50edc
Rollup merge of #134908 - madsmtm:ptr-from_ref-docs, r=ibraheemdev
Fix `ptr::from_ref` documentation example comment

The comment says that the expression involves no function call, but that was only true for the example above, the example here _does_ contain a function call.

``@rustbot`` label A-docs
2025-01-10 06:28:39 +01:00
Matthias Krüger
5f6d7cf7af
Rollup merge of #134855 - estebank:default-field-values-unstable-docs, r=jieyouxu
Add `default_field_values` entry to unstable book

Tracking issue: https://github.com/rust-lang/rust/issues/132162
RFC: https://github.com/rust-lang/rfcs/blob/master/text/3681-default-field-values.md
2025-01-10 06:28:39 +01:00
Matthias Krüger
380612737a
Rollup merge of #134619 - hkBst:patch-7, r=jhpratt
Improve prose around `as_slice` example of IterMut

I've removed the cryptic message about not being able to call `&mut self` methods while retaining a shared borrow of the iterator, such as `as_slice` produces. This is just normal borrowing rules and does not seem especially relevant here. I can whip up a replacement if someone thinks it has value.
2025-01-10 06:28:38 +01:00
Matthias Krüger
eaf420638e
Rollup merge of #133088 - the8472:randomize-me-harder, r=workingjubilee
`-Zrandomize-layout` harder. `Foo<T> != Foo<U>`

Tracking issue: #106764

Previously randomize-layout only used a deterministic shuffle based on the seed stored in an Adt's ReprOptions, meaning that `Foo<T>`  and `Foo<U>` were shuffled by the same seed. This change adds a similar seed to each calculated LayoutData so that a struct can be randomized both based on the layout of its fields and its per-type seed.
Primitives start with simple seed derived from some of their properties. Though some types can no longer be distinguished at that point, e.g. usize and u64 will still be treated the same.
2025-01-10 06:28:37 +01:00
bors
88ab2d8acb Auto merge of #135297 - flip1995:clippy-subtree-update, r=matthiaskrgr
Clippy subtree update

r? `@Manishearth`
2025-01-10 03:10:28 +00:00
The 8472
d89b6d5ac6 test that coercions still work under randomization 2025-01-10 02:22:57 +01:00
The 8472
8b1de1682f also initialize Layout field in rust-analyzer 2025-01-10 02:22:57 +01:00
The 8472
56889dd826 exclude unsizable tail from randomization seed calculation 2025-01-10 02:22:57 +01:00
The 8472
d7fb729d39 adjust UI tests 2025-01-10 02:22:57 +01:00
The 8472
a75617c223 Foo<T> != Foo<U> under layout randomization
previously field ordering was using the same seed for all instances of Foo,
now we pass seed values through the layout tree so that not only
the struct itself affects layout but also its fields
2025-01-10 02:22:57 +01:00
bors
62bf38fa60 Auto merge of #135303 - Kobzol:ci-fix-name, r=tgross35
CI: fix name of jobs

There is a difference between the `image` (the Dockerfile), the `name` of the job (which determines also its properties) and the `full_name`, which includes the `auto/try/pr` prefix.

Missed this in https://github.com/rust-lang/rust/pull/134898.
2025-01-10 00:09:46 +00:00
Michael Goulet
9585f36678 Rename RegionResolutionVisitor to ScopeResolutionVisitor 2025-01-09 22:17:10 +00:00
Michael Goulet
9d2e1ed6bd Make sure to walk into nested const blocks in RegionResolutionVisitor 2025-01-09 22:16:51 +00:00
Esteban Küber
13e8876ed4 Add default_field_values entry to unstable book 2025-01-09 21:51:14 +00:00
Frank Steffahn
5e505189cd Add tests cases from review of #132289 2025-01-09 21:43:25 +01:00
Jakub Beránek
c8b29d6f6f
CI: fix name of jobs
There is a difference between the `image` (the Dockerfile), the `name` of the job (which determines also its properties) and the `full_name`, which includes the `auto/try/pr` prefix.
2025-01-09 21:40:29 +01:00
Philipp Krones
43c3b30d37
Update Cargo.lock 2025-01-09 19:33:06 +01:00
Philipp Krones
573db1c866
Merge commit '19e305bb57' into clippy-subtree-update 2025-01-09 18:57:00 +01:00
Chris Denton
00448ab45a
Make bare-fn test less dependent on path width 2025-01-09 17:32:29 +00:00
Philipp Krones
19e305bb57
Rustup (#13970)
r? @ghost

changelog: none
2025-01-09 17:07:59 +00:00
Philipp Krones
663892bea7
Bump Clippy version -> 0.1.86 2025-01-09 18:01:44 +01:00
Philipp Krones
bb4a259908
Bump nightly version -> 2024-01-09 2025-01-09 18:01:20 +01:00
Philipp Krones
b5bf09e57a
Merge remote-tracking branch 'upstream/master' into rustup 2025-01-09 18:00:37 +01:00
bors
8247594932 Auto merge of #135286 - matthiaskrgr:rollup-sxuq1nh, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #134898 (Make it easier to run CI jobs locally)
 - #135195 (Make `lit_to_mir_constant` and `lit_to_const` infallible)
 - #135261 (Account for identity substituted items in symbol mangling)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-09 16:18:57 +00:00
Matthias Krüger
41c7d5a485
Rollup merge of #135261 - compiler-errors:coverage-has-identity-substs, r=oli-obk
Account for identity substituted items in symbol mangling

See the inline comment.

r? oli-obk

Fixes #135235
2025-01-09 14:34:47 +01:00
Matthias Krüger
8ff355aefe
Rollup merge of #135195 - oli-obk:push-toyoyrupruko, r=lcnr
Make `lit_to_mir_constant` and `lit_to_const` infallible

My motivation for this change is just that it's annoying to check everywhere, especially since all but one call site was just ICEing on errors anyway right there.

They can still fail, but now just return an error constant instead of having the caller handle the error.

fixes #114317
fixes #126182
2025-01-09 14:34:41 +01:00
Matthias Krüger
d487294ffd
Rollup merge of #134898 - Kobzol:ci-python-script, r=MarcoIeni
Make it easier to run CI jobs locally

This PR extends the Python CI script to perform a poor man's CI-like execution of a given CI job locally. It's not perfect, but it's better than nothing.

r? `@jieyouxu`
2025-01-09 14:34:35 +01:00
bors
251206c27b Auto merge of #135268 - pietroalbini:pa-bump-stage0, r=Mark-Simulacrum
Master bootstrap update

Part of the release process.

r? `@Mark-Simulacrum`
2025-01-09 13:33:16 +00:00
lcnr
b85b2c60f9 add comment to test 2025-01-09 13:55:50 +01:00
Michael Goulet
39daadc76e Account for identity substituted items in symbol mangling 2025-01-09 13:55:40 +01:00
bors
ec12cd8436 Auto merge of #135279 - matthiaskrgr:rollup-ek2qere, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #135212 (Remove outdated information in the `unreachable_pub` lint description)
 - #135225 (Explicitly build proc macro test with panic=unwind)
 - #135242 (add missing provenance APIs on NonNull)
 - #135247 (Add a list of symbols for stable standard library crates)
 - #135269 (Remove some unnecessary `.into()` calls)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-09 10:50:19 +00:00
Oli Scherer
84c8d4f52d Use option combinators instead of manual if/return 2025-01-09 08:48:46 +00:00
Oli Scherer
8505904dcc Remove the now-useless Result from lit_to_const 2025-01-09 08:48:46 +00:00
Oli Scherer
07fcead073 Always take the Ok path in lit_to_const and produce error constants instead 2025-01-09 08:48:00 +00:00
Oli Scherer
787af97bab Use error constant instead of explicit error handling 2025-01-09 08:48:00 +00:00
Oli Scherer
7833cf7a47 Make lit_to_mir_constant infallible 2025-01-09 08:48:00 +00:00
Matthias Krüger
a1cadeab68
Rollup merge of #135269 - estebank:unneeded-into, r=compiler-errors
Remove some unnecessary `.into()` calls
2025-01-09 09:05:10 +01:00
Matthias Krüger
b593085a9e
Rollup merge of #135247 - tgross35:stdlib-sym-list, r=oli-obk
Add a list of symbols for stable standard library crates

There are a few locations where the crate name is checked against an enumerated list of `std`, `core`, `alloc`, and `proc_macro`, or some subset thereof. In most cases when we are looking for any "standard library" crate, all four crates should be treated the same. Change this so the crates are listed in one place, and that list is used wherever a list of `std` crates is needed.

`test` could be considered relevant in some of these cases, but generally treating it separate from the others seems preferable while it is unstable.

There are also a few places that Clippy will be able to use this.
2025-01-09 09:05:09 +01:00
Matthias Krüger
04e87154bb
Rollup merge of #135242 - RalfJung:nonnull-provenance, r=jhpratt
add missing provenance APIs on NonNull

This adds some provenance APIs that exist on raw pointers but have been forgotten on `NonNull`:
```rust
impl<T> NonNull<T> {
    pub const fn without_provenance(addr: NonZero<usize>) -> Self;
    pub fn from_exposed_provenance(addr: NonZero<usize>) -> Self;
}
impl<T: ?Sized> NonNull<T> {
    pub fn expose_provenance(self) -> NonZero<usize>;
}
```
https://github.com/rust-lang/libs-team/issues/518 is the ACP for the two exposed provenance ones; I forgot to include `without_provenance` there but I hope that, too, is uncontroversial (and anyway this PR only adds things unstably). Cc `@rust-lang/libs-api`

Tracking issue: https://github.com/rust-lang/rust/issues/135243
2025-01-09 09:05:08 +01:00
Matthias Krüger
84910fc3cd
Rollup merge of #135225 - erickt:fix-test, r=jieyouxu
Explicitly build proc macro test with panic=unwind

Fuchsia explicitly builds rust and all rust targets with `-C panic=abort` to minimize code generation size. However, when compiling a proc-macro with this setting it can cause a warning to be emitted, which breaks `tests/ui/invalid-compile-flags/crate-type-flag.rs`. This hasn't been a problem in the past for us since we compile our proc macros on host, rather than inside Fuchsia.

This attempts to fix the issue by explicitly requiring that we're using the unwinder when compiling this test to avoid the warning being emitted.

Fixes #135223
2025-01-09 09:05:07 +01:00
Matthias Krüger
a9614a5768
Rollup merge of #135212 - Urgau:unreach_pub-upd-descr, r=petrochenkov
Remove outdated information in the `unreachable_pub` lint description

As far as I understand the `unreachable_pub` lint hasn't had false-positives since it started using "effective visibilities". Let's remove that warning from the lint description.

r? `@petrochenkov`
2025-01-09 09:05:05 +01:00
bors
b6b8361bce Auto merge of #133324 - scottmcm:gvn-aggregate-transmute, r=cjgillot
[mir-opt] GVN some more transmute cases

We already did `Transmute`-then-`PtrToPtr`; this adds the nearly-identical `PtrToPtr`-then-`Transmute`.

It also adds `transmute(Foo(x))` → `transmute(x)`, when `Foo` is a single-field transparent type.  That's useful for things like `NonNull { pointer: p }.as_ptr()`.  It also detects when a `Transmute` is just an identity-for-the-value `PtrCast` between different raw pointer types, to help such things fold with other GVN passes.

Found these as I was looking at <https://github.com/rust-lang/compiler-team/issues/807>-related changes.  This also removes the questionably-useful "turn a transmute into a field projection" part of instsimplify (which I added ages ago without an obvious need for it) since that would just put back the field projections that MCP807 is trying to ban.

r? mir-opt
2025-01-09 08:04:37 +00:00
bors
65d7296fc9 Auto merge of #135277 - matthiaskrgr:rollup-0k61sf8, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #128110 (Suggest Replacing Comma with Semicolon in Incorrect Repeat Expressions)
 - #134609 (Add new `{x86_64,i686}-win7-windows-gnu` targets)
 - #134875 (Implement `const Destruct` in old solver)
 - #135221 (Include rustc and rustdoc book in replace-version-placeholder)
 - #135231 (bootstrap: Add more comments to some of the test steps)
 - #135256 (Move `mod cargo`  below the import statements)

Failed merges:

 - #135195 (Make `lit_to_mir_constant` and `lit_to_const` infallible)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-09 05:21:43 +00:00