1
Fork 0
Commit graph

279875 commits

Author SHA1 Message Date
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
Deadbeef
4aaf467e26 Implement MIR const trait stability checks 2025-01-28 05:01:12 +00:00
Ben Kimock
bf9df97660 Remove -Zinline-in-all-cgus and clean up CGU partitioning tests 2025-01-27 23:48:47 -05:00
许杰友 Jieyou Xu (Joe)
3d4b24ac0e
Merge pull request #2226 from Kobzol/rustc-pull-ci-bash
Fix rustc-pull CI's bash commands
2025-01-28 12:35:41 +08:00
Ralf Jung
3f6ffa1462 update comments 2025-01-28 04:40:42 +01:00
Ralf Jung
93ee180cfa ABI-required target features: warn when they are missing in base CPU (rather than silently enabling them) 2025-01-28 04:40:42 +01:00
León Orell Valerian Liehr
0a9ee02d0a
GCI: Don't try to collect mono items inside overly generic free const items 2025-01-28 04:00:37 +01:00
Michael Howell
d94b64dcef 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.

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
2025-01-27 19:20:09 -07:00
Ralf Jung
bc135aaa98 interpret: is_alloc_live: check global allocs last 2025-01-28 02:58:44 +01:00
Michael Goulet
eeecb56b73 Represent the raw pointer for a array length check as a new kind of fake borrow 2025-01-28 00:00:33 +00:00
Michael Goulet
057313b7a6 Reapply "Auto merge of #133734 - scottmcm:lower-indexing-to-ptrmetadata, r=davidtwco,RalfJung"
This reverts commit 122a55bb44.
2025-01-27 23:42:47 +00:00
Michael Goulet
1cbb062e54 Type level consts can show up in MIR type checker 2025-01-27 23:32:48 +00:00
Jakub Beránek
2412289fc9
Fix rustc-pull CI's bash commands 2025-01-27 23:34:43 +01:00
Manish Goregaokar
83bde363b6
correct suggestions in no_std (#13999)
I opened https://github.com/rust-lang/rust-clippy/pull/13896 before.
However, I found that there're more cases where Clippy suggests to use
modules that belong to the `std` crate even in a `no_std` environment.
Therefore, this PR include the changes I've made in #13896 and new
changes to fix cases I found this time to prevent wrong suggestions in
`no_std` environments as well.

changelog: [`redundant_closure`]: correct suggestion in `no_std`
changelog: [`repeat_vec_with_capacity`]: correct suggestion in `no_std`
changelog: [`single_range_in_vec_init`]: don't emit suggestion to use
`Vec` in `no_std`
changelog: [`drain_collect`]: correct suggestion in `no_std`
changelog: [`map_with_unused_argument_over_ranges`]: correct suggestion
in `no_std`

also close #13895
2025-01-27 21:36:12 +00:00
lapla-cogito
3b0b8b080e
correct suggestion for map_with_unused_argument_over_ranges in a no_std environment 2025-01-28 06:29:47 +09:00
lapla-cogito
d99eae4325
correct suggestion for drain_collect in a no_std environment 2025-01-28 06:29:45 +09:00
lapla-cogito
cb0a479d1f
don't suggest to use std::vec::Vec for single_range_in_vec_init in a no_std environment 2025-01-28 06:29:45 +09:00