1
Fork 0
Commit graph

277776 commits

Author SHA1 Message Date
Jacob Pratt
ee521dfd03
Rollup merge of #135320 - camelid:coroutines-typo, r=lqd
Fix typo in `#[coroutine]` gating error
2025-01-10 03:55:22 -05:00
Jacob Pratt
0dcbda8225
Rollup merge of #135251 - oli-obk:push-lmpyvvyrtplk, r=ytmimi
Only treat plain literal patterns as short

See https://github.com/rust-lang/rust/pull/134228#discussion_r1905848384 and https://github.com/rust-lang/rust/pull/134228#discussion_r1905916702 for context. We never wanted to treat const blocks and paths as short, only plain literals.

I don't know how to write a test for this, it.s not clear to me how the short pattern check actually affects the formatting
2025-01-10 03:55:21 -05:00
Jacob Pratt
a6d38a1fb7
Rollup merge of #135083 - compiler-errors:invalid-predicate-source, r=camelid
Do not ICE when encountering predicates from other items in method error reporting

See the comments I left in the code and the test file.

Fixes https://github.com/rust-lang/rust/issues/124350
2025-01-10 03:55:20 -05:00
Jacob Pratt
9e24b6ba8e
Rollup merge of #134732 - compiler-errors:unify-conditional-const-error-reporting, r=RalfJung
Unify conditional-const error reporting with non-const error reporting

This PR unifies the error reporting between `ConditionallyConstCall` and `FnCallNonConst` so that the former will refer to syntactical sugar like operators by their sugared name, rather than calling all operators "methods". We achieve this by making the "non-const" part of the error message generic over the "non" part so we can plug in "conditionally" instead.

This should ensure that as we constify traits in the standard library, we don't regress error messages for things like `==`.

r? fmease or reassign
2025-01-10 03:55:20 -05:00
Jacob Pratt
34fa27b0bd
Rollup merge of #134693 - SpriteOvO:proc-macro-use-to-tokens-in-quote, r=tgross35
proc_macro: Use `ToTokens` trait in `quote` macro

Tracking issues: #130977, #54722

This PR changed `proc_macro::quote!` to use `ToTokens` trait instead of `TokenStream::from`, and migrated test cases from `quote` crate.

r? `@dtolnay`
CC `@tgross35`
2025-01-10 03:55:19 -05:00
Jacob Pratt
5eec2b0610
Rollup merge of #132607 - YohDeadfall:pthread-name-fn-with-result, r=tgross35
Used pthread name functions returning result for FreeBSD and DragonFly

`pthread_getname_np` and `pthread_setname_np` received a wider adoption in past years and was added to:
* FreeBSD by June 11 2020 via [`2ef84b7da9a6c3e23b4a135e6e863581f16d46e1`](2ef84b7da9),
* DargonFly by March 8 2021 via [`ab5dc9aceb34419d1c4b6006739e61acee8ee999`](https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/ab5dc9aceb34419d1c4b6006739e61acee8ee999).

There's not so much advantage except that the result can be checked in debug builds. Ideally it should be unified with Linux' implementation, but it trims the input.
2025-01-10 03:55:18 -05: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
Noah Lev
7c91f898ba Fix typo in #[coroutine] gating error 2025-01-09 21:40:14 -08: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
Asuna
ef69c3001b Fix proc_macro::quote! for raw ident 2025-01-09 22:16:21 +01:00
Asuna
2ab9db5442 Migrate check-fail tests for proc_macro::quote! from quote crate 2025-01-09 22:16:21 +01:00
Asuna
e9063c36a9 Migrate basic tests for proc_macro::quote! from quote crate 2025-01-09 22:16:20 +01:00
Asuna
d52564118b Append TokenTree with ToTokens in proc_macro::quote! 2025-01-09 22:16:11 +01: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
Yoh Deadfall
8795750d43 Used pthread name functions returning result for FreeBSD and DragonFly 2025-01-09 21:25:55 +03: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
Michael Goulet
924000d70e Unify conditional and non const call error reporting 2025-01-09 16:20:10 +00: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
Michael Goulet
5a9f0be0bd Make the non-const part swappable in the diagnostic 2025-01-09 16:15:19 +00:00
Michael Goulet
b321cd5573 Add note back to conditionally-const error message 2025-01-09 16:15:19 +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