1
Fork 0
Commit graph

279998 commits

Author SHA1 Message Date
Michael Goulet
7e68422859 Properly check that array length is valid type during built-in unsizing in index 2025-01-28 17:52:28 +00:00
bors
77a455303b Auto merge of #135832 - Kobzol:rustdoc-lto, r=onur-ozkan
Apply LTO config to rustdoc

Before, the LTO configuration from `config.toml` was not applied to `rustdoc`. This provides a small perf. and binary size [win](https://github.com/rust-lang/rust/pull/112049#issuecomment-2605131041) for doc builds.

Since this is configured with Cargo profiles and not rustflags, it should not break tool build cache (https://github.com/rust-lang/rust/pull/131155). I tried to run `x test miri`, `x test rustdoc` and `x test miri` and nothing was rebuilt.

r? `@onur-ozkan`
2025-01-28 17:18:00 +00:00
Matthias Krüger
9715fea5d5
Rollup merge of #136178 - Noratrieb:alivename, r=pietroalbini
Update username in build helper example

no typos have been made in the process of creating this pull request

r? pietroalbini
2025-01-28 18:17:33 +01:00
Matthias Krüger
36b5c58ef8
Rollup merge of #136173 - taiki-e:c-char, r=tgross35
Update comments and sort target_arch in c_char_definition

Follow-up to https://github.com/rust-lang/rust/pull/132975.

- Clang's wrong default on MSP430 has been fixed in https://github.com/llvm/llvm-project/pull/115964, and will be included in LLVM 20, which will be used soon.
- Add a reference on Xtensa's default (from https://github.com/rust-lang/rust/pull/132975#issuecomment-2484645240).
- Fix link for Windows's default.
- Add a link to the discussion on L4Re (https://github.com/rust-lang/rust/pull/132975#issuecomment-2484645240)
- Sort `target_arch`. (now match with `target_arch`s in comments)

r? `@tgross35`
2025-01-28 18:17:30 +01:00
Matthias Krüger
995eb5c929
Rollup merge of #136149 - cuviper:rustc-rayon-indexmap, r=compiler-errors
Flip the `rustc-rayon`/`indexmap` dependency order

[`rustc-rayon v0.5.1`](https://github.com/rust-lang/rustc-rayon/pull/14) added `indexmap` implementations that will allow `indexmap` to drop its own "internal-only" implementations.

(This is separate from `indexmap`'s implementation for normal `rayon`.)
2025-01-28 18:17:29 +01:00
Matthias Krüger
da49fcdbb4
Rollup merge of #136124 - adetaylor:test-comment, r=compiler-errors
Arbitrary self types v2: explain test.

The purpose of this test wasn't obvious, as ```@traviscross``` noted. Add a comment.

Confession: although this test was added to demonstrate this particular corner-case, I can no longer reproduce the original problem, even if I adjust `rustc` to do the "wrong" thing. I have spent several hours trying to adjust the case to trigger the "faulty" behavior with no success. This test may therefore not be as useful as it originally was. But it still seems worthwhile retaining as a regression test that we don't break things in these quirky circumstances. Ideally we'd find a new test which tests this behavior but I've failed to come up with one.

r? ```@traviscross```
2025-01-28 18:17:27 +01:00
Matthias Krüger
d43e78d6ea
Rollup merge of #136071 - wowinter13:clippy-add-diagnostic-items, r=flip1995
[Clippy] Add vec_reserve & vecdeque_reserve diagnostic items

I’m currently working on reviving this lint (https://github.com/rust-lang/rust-clippy/pull/10157), and there was [a comment](https://github.com/rust-lang/rust-clippy/pull/10157#discussion_r1091591057) from ``@flip1995`` regarding the necessity of adding new diagnostic items.
2025-01-28 18:17:26 +01:00
Matthias Krüger
9f22f35876
Rollup merge of #136066 - compiler-errors:local-spans, r=lcnr
Pass spans to `perform_locally_in_new_solver`

Nothing changes yet, but we may be able to use these spans in the future once we start dealing w the response region constraints better.

r? lcnr
2025-01-28 18:17:25 +01:00
Matthias Krüger
4cb1342199
Rollup merge of #136055 - fee1-dead-contrib:push-ovmyztlkptmk, r=RalfJung
Implement MIR const trait stability checks

Addresses https://github.com/rust-lang/project-const-traits/issues/16

cc ``@rust-lang/project-const-traits``
r? ``@RalfJung``
2025-01-28 18:17:24 +01:00
Matthias Krüger
7915514fb6
Rollup merge of #135892 - BoxyUwU:next_solver_deduce_sig_normalized, r=lcnr
-Znext-solver: "normalize" signature before checking it mentions self in `deduce_closure_signature`

Fixes rust-lang/trait-system-refactor-initiative#138

r? ``@lcnr``

Tbh I wrote so much comments I don't feel like writing it all again but as a description.
2025-01-28 18:17:23 +01:00
Matthias Krüger
6b4757b5de
Rollup merge of #135869 - hkBst:patch-12, r=Noratrieb
Make docs for AtomicUsize::from_mut platform-independent

fixes #133342
2025-01-28 18:17:22 +01:00
Taiki Endo
e586382feb Support clobber_abi in BPF inline assembly 2025-01-29 02:14:25 +09:00
Alisa Sireneva
644e527c17 Fix tests/ui/privacy/sysroot-private 2025-01-28 19:42:32 +03:00
Alisa Sireneva
efaeedef59 Fix tests/codegen/wasm_exceptions 2025-01-28 19:10:26 +03:00
Alisa Sireneva
5df51930f9 Fix tests/codegen/float/f128 2025-01-28 19:10:24 +03:00
MarcoIeni
6509596dd7
ci: remove unused windows runner 2025-01-28 16:02:38 +01:00
Taiki Endo
cfb8be52b3 Remove duplicated code in RISC-V asm bad-reg test 2025-01-28 23:49:02 +09:00
bors
fdd1a3b026 Auto merge of #136185 - matthiaskrgr:rollup-zqzy6wb, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #133151 (Trim extra whitespace in fn ptr suggestion span)
 - #133829 (Implement `AtomicT::update` & `AtomicT::try_update`)
 - #135367 (Enable `unreachable_pub` lint in `alloc`)
 - #135748 (Lower index bounds checking to `PtrMetadata`, this time with the right fake borrow semantics 😸)
 - #135805 (Add missing allocator safety in alloc crate)
 - #135886 (Document purpose of closure in from_fn.rs more clearly)
 - #135961 (Fix 2/4 tests skipped by opt-dist)
 - #136012 (Document powf and powi values that are always 1.0)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-28 14:17:54 +00:00
Boxy
356b2aa422 "normalize" signature before checking mentions self 2025-01-28 14:11:29 +00:00
Ayush Singh
9c4fd25f27
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.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-01-28 19:10:28 +05:30
Matthias Krüger
9a192b254c
Rollup merge of #136012 - hkBst:patch-22, r=workingjubilee,tgross35
Document powf and powi values that are always 1.0

fixes bug #90429
2025-01-28 14:23:25 +01:00
Matthias Krüger
da6d9fdfa2
Rollup merge of #135961 - saethlin:skip-less-in-opt-dist, r=jieyouxu
Fix 2/4 tests skipped by opt-dist

The linker errors were because this one test, strangely, wants itself compiled with `-Ctarget-features=+crt-static`, and yet it looks like the runner image is simply missing static libraries for libc and libm.

Eyeballing the output of
```
rustc +nightly --target=x86_64-pc-windows-msvc -O tests/codegen/vec-shrink-panik.rs --emit=llvm-ir
```
suggests that vec-shrink-panik should pass on Windows. And it's quite disturbing that such a test would have failed only on Windows to start with. Exactly why that was would require some advanced digging, but it looks clean now.
2025-01-28 14:23:24 +01:00
Matthias Krüger
448fa117f8
Rollup merge of #135886 - hkBst:patch-14, r=workingjubilee
Document purpose of closure in from_fn.rs more clearly

partial fix for #135087 together with https://github.com/rust-lang/rust/pull/135895
2025-01-28 14:23:23 +01:00
Matthias Krüger
32c04fc509
Rollup merge of #135805 - DiuDiu777:master, r=Noratrieb
Add missing allocator safety in alloc crate

### PR Description
In the previous PR [#135009](https://github.com/rust-lang/rust/pull/135009), PR [#134496](https://github.com/rust-lang/rust/pull/134496), some incomplete API documentation issues have been fixed.

Based on these changes,  other inconsistencies related to the allocator have also been identified, including:

- `Box::from_non_null`
- `Box::from_non_null_in`
- `Weak::from_raw`
2025-01-28 14:23:23 +01:00
Matthias Krüger
21ddd7ab89
Rollup merge of #135748 - compiler-errors:len-2, r=RalfJung,oli-obk
Lower index bounds checking to `PtrMetadata`, this time with the right fake borrow semantics 😸

Change `Rvalue::RawRef` to take a `RawRefKind` instead of just a `Mutability`. Then introduce `RawRefKind::FakeForPtrMetadata` and use that for lowering index bounds checking to a `PtrMetadata`. This new `RawRefKind::FakeForPtrMetadata` acts like a shallow fake borrow in borrowck, which mimics the semantics of the old `Rvalue::Len` operation we're replacing.

We can then use this `RawRefKind` instead of using a span desugaring hack in CTFE.

cc ``@scottmcm`` ``@RalfJung``
2025-01-28 14:23:22 +01:00
Matthias Krüger
e3420f4464
Rollup merge of #135367 - Urgau:unreach_pub-std-3, r=Noratrieb
Enable `unreachable_pub` lint in `alloc`

This PR enables the [`unreachable_pub`](https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html#unreachable-pub) lint as warn in the `alloc` crate.

Most of changes are in the btree implementation and in tests.

*The diff was mostly generated with `./x.py fix --stage 1 library/alloc/ -- --broken-code`, as well as manual edits for code in macros and in tests.*

Continuation of #134286 and #135366

r? libs
2025-01-28 14:23:21 +01:00
Matthias Krüger
da5e22de0a
Rollup merge of #133829 - GrigorenkoPV:fetch_update_infallible, r=Noratrieb
Implement `AtomicT::update` & `AtomicT::try_update`

ACP accepted in https://github.com/rust-lang/libs-team/issues/490

``@rustbot`` label +T-libs-api
2025-01-28 14:23:20 +01:00
Matthias Krüger
c0005f1560
Rollup merge of #133151 - tyrone-wu:trim-fn-ptr-whitespace, r=compiler-errors
Trim extra whitespace in fn ptr suggestion span

Trim extra whitespace when suggesting removal of invalid qualifiers when parsing function pointer type.

Fixes: #133083

---

I made a comment about the format of the diagnostic error message in https://github.com/rust-lang/rust/issues/133083#issuecomment-2480047875. I think the `.label` may be a little redundant if the diagnostic only highlights the bad qualifier instead of the entire `TyKind::BareFn` span. If it makes sense, I can include it in this PR.
2025-01-28 14:23:20 +01:00
Marijn Schouten
aa1f941116 Fix platform-specific doc string for AtomicUsize::from_mut to be platform-independent 2025-01-28 14:12:55 +01:00
mu001999
4203627ced Suggest considering casting fn item as fn pointer in more cases 2025-01-28 20:17:36 +08:00
Boxy
815c5d4eee Merge from rustc 2025-01-28 11:57:19 +00:00
Boxy
62102ee041 Preparing for merge from rustc 2025-01-28 11:57:04 +00:00
SpecificProtagonist
eee9df43e6
miri: optimize zeroed alloc
Co-authored-by: Ralf Jung <post@ralfj.de>
2025-01-28 12:50:02 +01:00
Philipp Krones
25509e7135
exclude some directories from Lintcheck CI (#14084)
Currently, the CI pipeline triggers `Lintcheck` for all PRs. However,
this check takes significant amount of time and seems unnecessary for
some certain directories that are frequently updated.

r? flip1995

changelog: none
2025-01-28 10:29:58 +00:00
lapla-cogito
75b39d00ab
exclude specific directories from Lintcheck 2025-01-28 19:13:25 +09:00
nora
1d8f59ff51
Update username in build helper example 2025-01-28 10:51:30 +01:00
bors
aa6f5ab18e Auto merge of #133929 - saethlin:remove-inline-in-all-cgus, r=nnethercote
Remove -Zinline-in-all-cgus and clean up tests/codegen-units/

Implementation of https://github.com/rust-lang/compiler-team/issues/814

I've taken some liberties with cleaning up the CGU partitioning tests, because that's the only place this flag was used and also mattered. I've often fought a lot with the contents of `tests/codegen-units` and it has never been clear to me when a test failure indicates a problem with my changes as opposed to a test just needing to be manually blessed. Hopefully the combination of the new README, new comments, and using `-Zprint-mono-items=lazy` in the partitioning tests improves that.

I've also deleted some of the `tests/run-make/sepcomp` tests. I think all the "sepcomp" tests have been obviated for years by better-designed (less flaky, clearer failures) test suites, but here I'm just deleting the ones I'm confident in.
2025-01-28 09:43:03 +00:00
Oli Scherer
d62f885a8e Edit the inputs to const == val check instead of duplicating logic 2025-01-28 08:55:54 +00:00
Catherine Flores
80c2d09851
Add new lint doc_overindented_list_items (#13711)
Add a new lint `doc_overindented_list_items` to detect and fix list
items
in docs that are overindented.

For example,

```rs
/// - first line
///      second line
fn foo() {}
```

this would be fixed to:

```rs
/// - first line
///   second line
fn foo() {}
```

This lint improves readabiliy and consistency in doc.

---

- \[x] Followed [lint naming conventions][lint_naming]
- \[x] Added passing UI tests (including committed `.stderr` file)
- \[x] `cargo test` passes locally
- \[x] Executed `cargo dev update_lints`
- \[x] Added lint documentation
- \[x] Run `cargo dev fmt`

[lint_naming]:
https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints

changelog: [`doc_overindented_list_items`]: Added a new lint that
detects overindented list items in docs
fixes: #13601
2025-01-28 08:50:48 +00:00
Oli Scherer
fd6713fce1 Make mir dumps more readable 2025-01-28 08:19:31 +00:00
Oli Scherer
7877d86163 Add mir-opt pattern type tests 2025-01-28 08:12:25 +00:00
Marijn Schouten
3d6c6fa04e Document powf and powi calls that always return 1.0 2025-01-28 08:24:39 +01:00
Yutaro Ohno
4693d0a9ff Add new lint doc_overindented_list_items
Add a new lint `doc_overindented_list_items` to detect and fix list items
in docs that are overindented.

For example,

```rs
/// - first line
///      second line
fn foo() {}
```

this would be fixed to:

```rs
/// - first line
///   second line
fn foo() {}
```

This lint improves readabiliy and consistency in doc.
2025-01-28 16:22:28 +09:00
Catherine Flores
66dc8a1a30
proper applicability for obfuscated_if_else (#14061)
fix #14034

The currect implementation of `obfuscated_if_else` sometimes makes
incorrect suggestions when the original code have side effects (see the
example in the above issue). I think this can be fixed by changing the
applicability depending on whether it can have side effects or not.

changelog: [`obfuscated_if_else`]: change applicability when the
original code can have side effects
2025-01-28 06:57:12 +00:00
Joren-vanGoethem
d63796f69a
Update about-this-guide.md 2025-01-28 07:43:16 +01:00
bors
66d6064f9e Auto merge of #134290 - tgross35:windows-i128-callconv, r=bjorn3,wesleywiser
Windows x86: Change i128 to return via the vector ABI

Clang and GCC both return `i128` in xmm0 on windows-msvc and windows-gnu. Currently, Rust returns the type on the stack. Add a calling convention adjustment so we also return scalar `i128`s using the vector ABI, which makes our `i128` compatible with C.

In the future, Clang may change to return `i128` on the stack for its `-msvc` targets (more at [1]). If this happens, the change here will need to be adjusted to only affect MinGW.

Link: https://github.com/rust-lang/rust/issues/134288 (does not fix) [1]

try-job: x86_64-msvc
try-job: x86_64-msvc-ext1
try-job: x86_64-mingw-1
try-job: x86_64-mingw-2
2025-01-28 06:11:13 +00:00
Taiki Endo
ea70688f7d Update comments and sort target_arch in c_char_definition 2025-01-28 14:41:15 +09:00
dianne
be7d6e3d5e add work-in-progress unstable book chapters
These are very bare-bones, only intended to provide some documentation
of what these feature gates are and aren't yet implementing.
2025-01-27 21:28:22 -08:00
Taiki Endo
7f83f8ae72 Reject unsound toggling of Arm atomics-32 target feature 2025-01-28 14:11:33 +09:00
Deadbeef
d250657a3c add test case for implicitly stable const fn 2025-01-28 05:01:30 +00:00