Commit Graph

291081 Commits

Author SHA1 Message Date
Matthias Krüger
a4836e9965 Rollup merge of #141369 - yotamofek:pr/rustdoc/format_integer_with_underscore_sep, r=notriddle
Simplify `format_integer_with_underscore_sep`

Noticed that this helper fn only ever gets called with decimal-base-formatted ints, so can be simplified a lot by not trying to handle hex and octal radixes.
Second commit is completely unrelated, just simplified some code I wrote a while back 😁
2025-05-23 20:30:10 +02:00
Matthias Krüger
672ad6e172 Rollup merge of #141065 - ehuss:wasm-doctest-xcompile, r=Mark-Simulacrum
Updated std doctests for wasm

This updates some doctests that fail to run on wasm. We will soon be supporting cross-compiled doctests, and the test-various job fails to run these tests. These tests fail because wasm32-wasip1 does not support threads.
2025-05-23 20:30:09 +02:00
Matthias Krüger
d6a61daf60 Rollup merge of #140832 - workingjubilee:aarch64-linux-should-use-frame-pointers, r=compiler-errors
aarch64-linux: Default to FramePointer::NonLeaf

For aarch64-apple and aarch64-windows, platform docs state that code must use frame pointers correctly. This is because the AAPCS64 mandates that a platform specify its frame pointer conformance requirements:
- Apple: https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms#Respect-the-purpose-of-specific-CPU-registers
- Windows: https://learn.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-170#integer-registers
- AAPCS64: 4492d1570e/aapcs64/aapcs64.rst (the-frame-pointer)

Unwinding code either requires unwind tables or frame pointers, and on aarch64 the expectation is that one can use frame pointers for this. Most Linux targets represent a motley variety of possible distributions, so it is unclear who to defer to on conformance, other than perhaps Arm. In the absence of a specific edict for a given aarch64-linux target, Rust will assume aarch64-linux targets also use non-leaf frame pointers. This reflects what compilers like clang do.
2025-05-23 20:30:09 +02:00
Matthias Krüger
c66c8e6b9c Rollup merge of #138896 - joboet:process_noalias, r=Noratrieb
std: fix aliasing bug in UNIX process implementation

`CStringArray` contained both `CString`s and their pointers. Unfortunately, since `CString` uses `Box`, moving the `CString`s into the `Vec` can (under stacked borrows) invalidate the pointer to the string, meaning the resulting `Vec<*const c_char>` was, from an opsem perspective, unusable. This PR removes removes the `Vec<CString>` from `CStringArray`, instead recreating the `CString`/`CStr` from the pointers when necessary. Also,`CStringArray` is now used for the process args as well, the old implementation was suffering from the same kind of bug.
2025-05-23 20:30:08 +02:00
Ayush Singh
e21aab5b5c std: sys: net: uefi: Implement TCP4 connect
- Implement TCP4 connect using EFI_TCP4_PROTOCOL.
- Tested on QEMU setup with connecting to TCP server on host.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-05-23 23:49:33 +05:30
Weihang Lo
11a6348820 Update cargo 2025-05-23 13:59:12 -04:00
blyxyas
4a7598f815 [HEAVY PERF] Optimize documentation lints 2/2
So, after https://github.com/rust-lang/rust-clippy/pull/14693 was merged,
this is the continuation. It performs some optimizations on `Fragments::span`
, makes it so we don't call it so much, and makes a 85.75% decrease (7.51% -> 10.07%)
in execution samples of `source_span_for_markdown_range` and a 6.39% -> 0.88%
for `core::StrSearcher::new`. Overall a 13.11% icount decrase on docs-heavy crates.

Benchmarked mainly on `regex-1.10.5`.

This means that currently our heaviest function is `rustc_middle::Interners::intern_ty`, even
for documentation-heavy crates

Co-authored-by: Roope Salmi <rpsalmi@gmail.com>
2025-05-23 19:46:28 +02:00
Alejandra González
7ab910f935 needless_borrow: do not contradict dangerous_implicit_autorefs (#14810)
Rust 1.88 introduces the `dangerous_implicit_autorefs` lint which warns
about using implicit autorefs on a place obtained from a raw pointer, as
this may create aliasing issues.

Prevent `clippy::needless_borrow` from triggering in this case, by
disabling the lint when taking a reference on a raw pointer dereference.
There might be a better way for doing this in the long run with a finer
way of distinguish the problematic cases, but this will prevent Clippy
from contradicting the compiler in the meantime.

Fixes rust-lang/rust-clippy#14743

changelog: [`needless_borrow`]: do not contradict the compiler's
`dangerous_implicit_autorefs` lint even though the refererences are not
mandatory

@rustbot label +beta-nominated

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_SUMMARY_START -->

### Summary Notes

- [Beta nomination for
1.88](https://github.com/rust-lang/rust-clippy/pull/14810#issuecomment-2883753957)
by [samueltardieu](https://github.com/samueltardieu)

Generated by triagebot, see
[help](https://forge.rust-lang.org/triagebot/note.html) for how to add
more
<!--
TRIAGEBOT_SUMMARY_DATA_START$${"entries_by_url":{"https://github.com/rust-lang/rust-clippy/pull/14810#issuecomment-2883753957":{"title":"Beta
nomination for
1.88","comment_url":"https://github.com/rust-lang/rust-clippy/pull/14810#issuecomment-2883753957","author":"samueltardieu"}}}$$TRIAGEBOT_SUMMARY_DATA_END
-->

<!-- TRIAGEBOT_SUMMARY_END -->
<!-- TRIAGEBOT_END -->
2025-05-23 17:37:41 +00:00
nora
6232b33c6c Merge pull request #2404 from lolbinarycat/patch-1
rustdoc.md: reorder list so test suites are not split up
2025-05-23 18:56:05 +02:00
onur-ozkan
17d27c993e let tool::Miri implementation to handle compilers
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-23 19:45:38 +03:00
Eric Huss
a12b455bd0 Update mdbook to 0.4.50 2025-05-23 09:37:23 -07:00
Urgau
343fecabc7 Suggest correct version("..") predicate syntax in check-cfg 2025-05-23 18:14:49 +02:00
onur-ozkan
55298ea6ea if stage isn't set explicitly, default to 1 when running miri
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-23 18:58:34 +03:00
bors
e88e854634 Auto merge of #141437 - matthiaskrgr:rollup-jjagkxd, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #136400 (Improve handling of rustdoc lints when used with raw doc fragments.)
 - #140967 (Async drop poll shim for error dropee generates noop body)
 - #141019 (Update std doctests for android)
 - #141109 (discuss deadlocks in the std::io::pipe() example)
 - #141126 (rustdoc JSON: Don't apply `#[repr]` privacy heuristics)
 - #141376 (Rename `kw::Empty` as `sym::empty`.)
 - #141383 (Miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-23 15:13:45 +00:00
joboet
89a90d6640 std: add safety comments to CStringArray 2025-05-23 17:09:02 +02:00
joboet
a467516c22 std: fix aliasing bug in UNIX process implementation
`CStringArray` contained both `CString`s and their pointers. Unfortunately, since `CString` uses `Box`, moving the `CString`s into the `Vec` can (under stacked borrows) invalidate the pointer to the string, meaning the resulting `Vec<*const c_char>` was, from an opsem perspective, unusable. This PR removes removes the `Vec<CString>` from `CStringArray`, instead recreating the `CString`/`CStr` from the pointers when necessary. Also,`CStringArray` is now used for the process args as well, the old implementation was suffering from the same kind of bug.
2025-05-23 17:09:00 +02:00
Guillaume Gomez
419ba5d28e Merge pull request #2406 from jyn514/rustdoc-bodies
document why rustdoc cannot look at function bodies
2025-05-23 17:07:54 +02:00
jyn
589d03cd05 document why rustdoc cannot look at function bodies 2025-05-23 10:53:36 -04:00
beetrees
dcd3168c97 Use correct sign extension on __powi*f2 arguments 2025-05-23 15:51:51 +01:00
bjorn3
7c026ea31d Add missing space in usage.md 2025-05-23 16:41:37 +02:00
Deadbeef
898b6a13f1 further deduplicate ast visitor code 2025-05-23 22:08:12 +08:00
Petr Sumbera
df61c7ad45 Add 2nd Solaris target maintainer 2025-05-23 15:31:01 +02:00
Ralf Jung
180ab161b0 make teach_help message for cast-before-pass-to-variadic more precise 2025-05-23 15:03:56 +02:00
Yotam Ofek
5c735d154e Small cleanup for qpath_to_string 2025-05-23 12:37:56 +00:00
Yotam Ofek
5b47d340d3 Simplify format_integer_with_underscore_sep
Only ever needs to handle decimal reprs
2025-05-23 12:37:56 +00:00
Michael Goulet
d0413436d5 Do not try to confirm non-dyn compatible method 2025-05-23 12:20:35 +00:00
lcnr
326b7e9a6b yeet CanonicalVarInfo 2025-05-23 12:10:53 +00:00
许杰友 Jieyou Xu (Joe)
55df9f41b7 Merge pull request #2403 from rust-lang/tshepang-patch-1 2025-05-23 19:42:58 +08:00
Matthias Krüger
ee1768c2a3 Rollup merge of #141383 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2025-05-23 13:34:21 +02:00
Matthias Krüger
09c50a4b6f Rollup merge of #141376 - nnethercote:rename-kw-Empty, r=petrochenkov
Rename `kw::Empty` as `sym::empty`.

Because the empty string is not a keyword.

r? `@petrochenkov`
2025-05-23 13:34:20 +02:00
Matthias Krüger
225ed8b9cf Rollup merge of #141376 - nnethercote:rename-kw-Empty, r=petrochenkov
Rename `kw::Empty` as `sym::empty`.

Because the empty string is not a keyword.

r? `@petrochenkov`
2025-05-23 13:34:20 +02:00
Matthias Krüger
893494c90f Rollup merge of #141126 - fmease:rev-rjson-priv-repr, r=aDotInTheVoid
rustdoc JSON: Don't apply `#[repr]` privacy heuristics

Split out from #116882.
Context: https://github.com/rust-lang/rust/pull/116882#issuecomment-2888349161.
Partially reverts #138018.

cc `@obi1kenobi`
r? aDotInTheVoid or rustdoc
2025-05-23 13:34:19 +02:00
Matthias Krüger
dfa3110ed4 Rollup merge of #141109 - oconnor663:pipe_example, r=Mark-Simulacrum
discuss deadlocks in the std::io::pipe() example

I think it's important to discuss deadlocks in examples of how to use pipes. The current example does include an explicit `drop()`, but it also implicitly relies on the fact that the `Command` object is temporary, so that it drops its copy of `pong_tx`. This sort of thing tends to trip people up when they use pipes for the first time. I might've gone overboard with the comments in this version, but I'm curious what folks think.
2025-05-23 13:34:19 +02:00
Matthias Krüger
036607ebba Rollup merge of #141019 - ehuss:android-doctest-xcompile, r=Mark-Simulacrum
Update std doctests for android

This updates some doctests that fail to run on android. We will soon be supporting cross-compiled doctests, and the `arm-android` job fails to run these tests.

In summary:
- Android re-exports some traits from linux under a different path.
- Android doesn't seem to have common unix utilities like `true`, `false`, or `whoami`, so these are disabled.
2025-05-23 13:34:18 +02:00
Matthias Krüger
f7a11798e8 Rollup merge of #140967 - azhogin:azhogin/async-drop-poll-shim-for-error-dropee-fix, r=oli-obk
Async drop poll shim for error dropee generates noop body

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

When dropee type for async drop poll shim is `ty::Error(_)`, the generated poll function will be noop body. To avoid ICE in `elaborate_drop`.
2025-05-23 13:34:17 +02:00
Matthias Krüger
1c2ea28727 Rollup merge of #136400 - lolbinarycat:rustdoc-link-lint-135851, r=GuillaumeGomez
Improve handling of rustdoc lints when used with raw doc fragments.

1. `rustdoc::bare_urls` no longer outputs incoherent suggestions if `source_span_for_markdown_range` returns None, instead outputting no suggestion
2. `source_span_for_markdown_range` has one more heuristic, so it will return `None` less often.
3. add ui test to make sure we don't emit nonsense suggestions.

fixes https://github.com/rust-lang/rust/issues/135851
2025-05-23 13:34:17 +02:00
Jakub Beránek
346ef86a58 Remove mentions of rust-lang-ci/rust
Now that CI has been finally migrated to `rust-lang/rust`.
2025-05-23 13:27:17 +02:00
Samuel Tardieu
c364717b15 needless_return: look inside else if parts as well
`if` expressions don't necessarily contain a block in the `else` part in
the presence of an `else if`. The `else` part, if present, must be
handled as a regular expression, not necessarily as a block expression.
2025-05-23 13:24:04 +02:00
bors
163cb4ea3f Auto merge of #141062 - ChaiTRex:ide_fmt_2024, r=Mark-Simulacrum
Update IDEs to use rustfmt 2024, fix Zed settings

Update IDEs to use rustfmt 2024, fix Zed settings

- Update IDE `rust-analyzer` settings to use 2024 rather than 2021.
- Fix Zed settings by removing `${workspaceFolder}/` from paths.
2025-05-23 11:15:24 +00:00
Lukas Wirth
9d61d8a388 Merge pull request #19853 from Veykril/push-ovpvzkxmpsuk
Bump salsa
2025-05-23 11:08:19 +00:00
Lukas Wirth
69ba323c1c Bump salsa 2025-05-23 12:58:00 +02:00
Folkert de Vries
89a8abc4be use cfg_select! to select the right VaListImpl definition 2025-05-23 12:51:04 +02:00
Michael Goulet
11392f4978 Emit dummy open drop for unsafe binder 2025-05-23 10:43:21 +00:00
Michael Goulet
6059d59548 Properly analyze captures from unsafe binders 2025-05-23 10:43:13 +00:00
Michael Goulet
04ddafc53c Properly analyze captures from unsafe binders 2025-05-23 10:43:13 +00:00
Ralf Jung
d4d0216502 Merge pull request #4347 from RalfJung/ci
test some aarch64 windows targets
2025-05-23 10:17:51 +00:00
Michael Goulet
46606a3f81 Dont walk into unsafe binders when emiting error for non-structural type match 2025-05-23 10:10:50 +00:00
Ralf Jung
20236c6094 test some aarch64 windows targets 2025-05-23 11:49:37 +02:00
Ralf Jung
24d950398c many-seeds tests have become a lot faster thanks to multithreading 2025-05-23 11:49:37 +02:00
Samuel Tardieu
0a059d9e97 needless_borrow: do not contradict dangerous_implicit_autorefs
Rust 1.88 introduces the `dangerous_implicit_autorefs` lint which warns
about using implicit autorefs on a place obtained from a raw pointer,
as this may create aliasing issues.

Prevent `clippy::needless_borrow` from triggering in this case,
by disabling the lint when taking a reference on a raw pointer
dereference. There might be a better way for doing this in the long run
with a finer way of distinguish the problematic cases, but this will
prevent Clippy from contradicting the compiler in the meantime.
2025-05-23 11:12:31 +02:00