Commit Graph

154399 Commits

Author SHA1 Message Date
bors
8dc83770f7 Auto merge of #133089 - eholk:stabilize-noop-waker, r=dtolnay
Stabilize noop_waker

Tracking Issue: #98286

This is a handy feature that's been used widely in tests and example async code and it'd be nice to make it available to users.

cc `@rust-lang/wg-async`
2024-12-06 18:34:16 +00:00
bors
cdeddae4f6 Auto merge of #133956 - bjorn3:sync_cg_clif-2024-12-06, r=bjorn3
Sync cg clif 2024 12 06

The main highlights this time are a Cranelift update disabling the clif ir verifier by default for better performance.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
2024-12-06 15:49:11 +00:00
bjorn3
063e21b4c4 Cargo decided to add serde to cg_clif's lockfile despite serde support in Cranelift being disabled 2024-12-06 12:16:54 +00:00
Matthias Krüger
026d21d2c1
Rollup merge of #133930 - chriskrycho:mdbook-trpl-package, r=ehuss
rustbook: update to use new mdbook-trpl package from The Book

Updates to the latest merge from `rust-lang/book` and simplifies the dependency chain there. There are now three preprocessors, but only one package, so everything is a lot nicer to deal with from the consuming POV (i.e. here).
2024-12-06 09:27:40 +01:00
Matthias Krüger
576176d8b7
Rollup merge of #133211 - Strophox:miri-correct-state-update-ffi, r=RalfJung
Extend Miri to correctly pass mutable pointers through FFI

Based off of https://github.com/rust-lang/rust/pull/129684, this PR further extends Miri to execute native calls that make use of pointers to *mutable* memory.
We adapt Miri's bookkeeping of internal state upon any FFI call that gives external code permission to mutate memory.

Native code may now possibly write and therefore initialize and change the pointer provenance of bytes it has access to: Such memory is assumed to be *initialized* afterwards and bytes are given *arbitrary (wildcard) provenance*. This enables programs that correctly use mutating FFI calls to run Miri without errors, at the cost of possibly missing Undefined Behaviour caused by incorrect usage of mutating FFI.

> <details>
>
> <summary> Simple example </summary>
>
> ```rust
> extern "C" {
>   fn init_int(ptr: *mut i32);
> }
>
> fn main() {
>   let mut x = std::mem::MaybeUninit::<i32>::uninit();
>   let x = unsafe {
>     init_int(x.as_mut_ptr());
>     x.assume_init()
>   };
>
>   println!("C initialized my memory to: {x}");
> }
> ```
> ```c
> void init_int(int *ptr) {
>   *ptr = 42;
> }
> ```
> should now show `C initialized my memory to: 42`.
>
> </details>

r? ``@RalfJung``
2024-12-06 09:27:39 +01:00
Matthias Krüger
820ddaf67a
Rollup merge of #130777 - azhogin:azhogin/reg-struct-return, r=workingjubilee
rust_for_linux: -Zreg-struct-return commandline flag for X86 (#116973)

Command line flag `-Zreg-struct-return` for X86 (32-bit) for rust-for-linux.
This flag enables the same behavior as the `abi_return_struct_as_int` target spec key.

- Tracking issue: https://github.com/rust-lang/rust/issues/116973
2024-12-06 09:27:38 +01:00
Guillaume Gomez
9765a4ee75
Rollup merge of #133827 - ojeda:ci-rfl, r=lqd
CI: rfl: move job forward to Linux v6.13-rc1

Linux v6.13-rc1 contains commit 28e848386b92 ("rust: block: fix formatting of `kernel::block::mq::request` module"), which in turn contains commit c95bbb59a9b2 ("rust: enable arbitrary_self_types and remove `Receiver`"), which is why we had a hash rather than a tag.

r? ```@Kobzol``` ```@lqd```
try-job: x86_64-rust-for-linux
```@rustbot``` label A-rust-for-linux
```@bors``` try
2024-12-05 23:47:11 +01:00
Guillaume Gomez
5a9c9ef541
Rollup merge of #133821 - Kobzol:replace-black-with-ruff, r=onur-ozkan
Replace black with ruff in `tidy`

`ruff` can both lint and format Python code (in fact, it should be a mostly drop-in replacement for `black` in terms of formatting), so it's not needed to use `black` anymore. This PR removes `black` and replaces it with `ruff`, to get rid of one Python dependency, and also to make Python formatting faster (although that's a small thing).

If we decide to merge this, we'll need to "reformat the world" - `ruff` is not perfectly compatible with `black`, and it also looks like `black` was actually ignoring some files before. I tried it locally (`./x test tidy --extra-checks=py:fmt --bless`) and it also reformatted some code in subtrees (e.g. `clippy` or `rustc_codegen_gcc`) - I'm not sure how to handle that.
2024-12-05 23:47:11 +01:00
Guillaume Gomez
7416c33780
Rollup merge of #133256 - MarcoIeni:use-linux-free-runners, r=Kobzol
CI: use free runners for i686-gnu jobs

try-job: i686-gnu-1
try-job: i686-gnu-2
try-job: i686-gnu-nopt-1
try-job: i686-gnu-nopt-2
2024-12-05 23:47:09 +01:00
Eric Holk
72ce1ab42f
Stabilize noop_waker
Co-authored-by: zachs18 <8355914+zachs18@users.noreply.github.com>
2024-12-05 14:14:17 -08:00
Guillaume Gomez
90feb9a645 Improve positioning of "..." in collapsed impl block 2024-12-05 22:50:21 +01:00
Guillaume Gomez
448d9adc38 Use text ellipsis instead of bottom blurring 2024-12-05 22:50:21 +01:00
Guillaume Gomez
6e0dabd9e2 Turn markdown_split_summary_and_content into a method of Markdown 2024-12-05 22:50:21 +01:00
Guillaume Gomez
32e6826a95 Update browser-ui-test version to 0.18.2 2024-12-05 22:50:21 +01:00
Guillaume Gomez
fad5f51183 Always display first line of impl blocks even when collapsed 2024-12-05 22:50:20 +01:00
Strophox
712ceaba35 extend Miri to correctly pass mutable pointers through FFI
Co-authored-by: Ralf Jung <post@ralfj.de>
2024-12-05 22:41:07 +01:00
Chris Krycho
74756c1f45
rustbook: update to use new mdbook-trpl package from The Book 2024-12-05 11:01:42 -07:00
Jacob Pratt
6b58941688
Rollup merge of #133898 - onur-ozkan:ignore-git-hook-on-dist-sources, r=jieyouxu
skip `setup::Hook` on non-git sources

Running `setup::Hook` (with `x setup`) leads tarball sources to panic and this PR resolves that problem by skipping `Hook` step on non-git sources.
2024-12-05 05:50:55 -05:00
Jacob Pratt
3c58e5d522
Rollup merge of #133888 - ChrisDenton:job, r=jieyouxu
Improve bootstrap job objects

This attempts to fix a few comments on bootstrap job objects.

I also fixed an issue where if duplicating the job object handle into the python process failed, it would close the job object. This would then result in the job object closing all attached processes, which at that point includes the current process. The fix is to simply never close the job object handle at any point after the current process is assigned to it.
2024-12-05 05:50:54 -05:00
Jacob Pratt
5dd102e2f8
Rollup merge of #133867 - taiki-e:platform-support, r=Noratrieb
Fix "std" support status of some tier 3 targets

https://github.com/rust-lang/rust/pull/127265 marked targets with empty "std" support status as no-std targets in target-spec metadata:

> * Where a targets 'std' or 'host tools' support is listed as '?' in the rust docs, these are left as 'None' with this PR. The corresponding changes in cargo will only reject an attempt to build std if the 'std' field is 'Some(false)'. In the case it is 'None', cargo will continue trying to build

However, this is not accurate because "std" support status has a marker indicating that it is a no-std target. (empty status is just invalid.)

https://doc.rust-lang.org/nightly/rustc/platform-support.html#tier-3

> The `std` column in the table below has the following meanings:
>
> * ✓ indicates the full standard library is available.
> * \* indicates the target only supports [`no_std`] development.
> * ? indicates the standard library support is unknown or a work-in-progress.
>
> [`no_std`]: https://rust-embedded.github.io/book/intro/no-std.html

This PR fixes the status of targets whose "std" support status is currently set to empty and update target-spec metadata.

The new status is set based on the following criteria:

- Set to ✓ for targets that I regularly check in [rust-cross-toolchain](https://github.com/taiki-e/rust-cross-toolchain) that the `cargo test` works. (riscv32-unknown-linux-gnu,{riscv64,s390x}-unknown-linux-musl)
  - Targets where `cargo run` works but `cargo test` does not work tend to have incomplete std support (e.g., riscv32 musl f3068b66e0), so I included them in the group below that means “work in progress” rather than in this group.
- Set powerpc64le FreeBSD to ✓ on both std and host_tools, because the [Rust package](https://www.freshports.org/lang/rust/) is available.
- Set to ? (which means "unknown" or “work in progress”) for all other affected targets because these are Linux, Android, FreeBSD, or Fuchsia, all of which are operating systems that support std if properly supported.

r? Noratrieb
cc ``@harmou01``
2024-12-05 05:50:52 -05:00
onur-ozkan
34d6a269e9 skip setup::Hook on non-git sources
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-12-05 11:17:13 +03:00
León Orell Valerian Liehr
1f1dfd54eb
Rollup merge of #133892 - jieyouxu:revert-eprintln, r=jieyouxu
Revert #133817

This reverts commit 0585134e70, reversing changes made to 5530869e0f.

#133817 unfortunately only converted the `println!` instances to `eprintln!`, meaning that some test output (via compiletest/bootstrap) was messed up because stdout/stderr output interleaved improperly when some `println!` instances were converted to `eprintln!` instances, while some `print!` instances remain unchanged. This made reading test output annoying for contributors cc #133879.

Closes #133879 by reverting.

#133817 can be relanded in the future when `print!` instances are also matched with `println!` instances.

cc `@clubby789`

This is a clean revert so I'm going to self-approve this PR.
2024-12-05 07:29:59 +01:00
León Orell Valerian Liehr
44174d9213
Rollup merge of #133863 - oli-obk:push-pystoxvtvssx, r=lqd
Rename `core_pattern_type` and `core_pattern_types` lib feature  gates to `pattern_type_macro`

That's what the gates are actually gating, and the single char difference in naming was not helpful either

fixes #128987
2024-12-05 07:29:56 +01:00
León Orell Valerian Liehr
d692b1fb2b
Rollup merge of #133761 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/book

12 commits in e16dd73690a6cc3ecdc5f5d94bbc3ce158a42e16..614c19cb4025636eb2ba68ebb3d44e3bd3a5e6e4
2024-12-02 16:22:15 UTC to 2024-11-26 21:15:51 UTC

- Fix more inverted uses of “shadowed” (rust-lang/book#4122)
- Fix a couple inverted uses of “shadowed” (rust-lang/book#4121)
- Fix confusion between variable `hello` and string `"hello"` (rust-lang/book#4118)
- Ch. 17: fix some wording issues (rust-lang/book#4117)
- Rephrase for clarity (rust-lang/book#3809)
- Link to tests section of rustc book for `cargo test -- --help` docs (rust-lang/book#4116)
- Drop a pedantry-triggering sentence about IEEE-754 (rust-lang/book#4114)
- Very small clarification on if let (rust-lang/book#4113)
- Ch17-05: Typos (rust-lang/book#4099)
- Ch20-01: Fix typos (rust-lang/book#4105)
- Add a short paragraph on editors and IDEs in installation (rust-lang/book#4112)
- Rust 2024: update Ch. 20 for new `unsafe` rules (rust-lang/book#4111)

## rust-lang/reference

8 commits in 5c86c739ec71b8bc839310ff47fa94e94635bba9..ede56d1bbe132bac476b5029cd6d7508ca9572e9
2024-11-25 17:23:35 +0000 to 2024-12-03 22:26:55 +0000
- Claim to follow Unicode 16 for lexing identifiers. (rust-lang/reference#1688)
- Clarify rules for on_unimplemented warnings (rust-lang/reference#1680)
- Enable triagebot merge-conflict notifications (rust-lang/reference#1682)
- Update default edition to 2024 for code examples (rust-lang/reference#1684)
- Fix weak keywords (rust-lang/reference#1685)
- `const` expression can borrow static items (rust-lang/reference#1610)
- Update function-pointer.md for stabilization of `extended_varargs_abi_support` (rust-lang/reference#1687)
- fix inconsistent spacing in example (rust-lang/reference#1686)

## edition-guide

1 commits in f48b0e842a3911c63240e955d042089e9e0894c7..128669297c8a7fdf771042eaec18b8adfaeaf0cd
2024-11-25 16:20:27 +0000 to 2024-12-03 22:02:43 +0000
- Fix `if_let_rescope` applicability (rust-lang/edition-guide#339)

## rust-lang/rustc-dev-guide

6 commits in 787b4166ccc67bd8f72a6e3ef6685ce9ce82909a..b21d99b770f9aceb0810c843847c52f86f45d2ed
2024-12-02 04:45:30 UTC to 2024-11-27 10:31:58 UTC

- Spell out `git submodule deinit -f --all` (rust-lang/rustc-dev-guide#2153)
- Explain how to deal with exploded git submodules (rust-lang/rustc-dev-guide#2152)
- Update `//@ proc-macro` aux build directive docs (rust-lang/rustc-dev-guide#2149)
- Remove `pretty-expanded` as it no longer exists (rust-lang/rustc-dev-guide#2147)
- Fix trivial typo (rust-lang/rustc-dev-guide#2148)
- Remove -Zfuel. (rust-lang/rustc-dev-guide#2032)
2024-12-05 07:29:55 +01:00
León Orell Valerian Liehr
626db06409
Rollup merge of #133233 - estebank:const-errors, r=Nadrieril
Add context to "const in pattern" errors

*Each commit addresses specific diagnostics.*

- Add primary span labels
- Point at `const` item, and `const` generic param definition
- Reword messages and notes
- Point at generic param through which an associated `const` is being referenced
- Silence const in pattern with evaluation errors when they come from `const` items that already emit a diagnostic
- On non-structural type in const used as pattern, point at the type that should derive `PartialEq`
2024-12-05 07:29:54 +01:00
León Orell Valerian Liehr
35ea48d588
Rollup merge of #118833 - Urgau:lint_function_pointer_comparisons, r=cjgillot
Add lint against function pointer comparisons

This is kind of a follow-up to https://github.com/rust-lang/rust/pull/117758 where we added a lint against wide pointer comparisons for being ambiguous and unreliable; well function pointer comparisons are also unreliable. We should IMO follow a similar logic and warn people about it.

-----

## `unpredictable_function_pointer_comparisons`

*warn-by-default*

The `unpredictable_function_pointer_comparisons` lint checks comparison of function pointer as the operands.

### Example

```rust
fn foo() {}
let a = foo as fn();

let _ = a == foo;
```

### Explanation

Function pointers comparisons do not produce meaningful result since they are never guaranteed to be unique and could vary between different code generation units. Furthermore different function could have the same address after being merged together.

----

This PR also uplift the very similar `clippy::fn_address_comparisons` lint, which only linted on if one of the operand was an `ty::FnDef` while this PR lints proposes to lint on all `ty::FnPtr` and `ty::FnDef`.

```@rustbot``` labels +I-lang-nominated

~~Edit: Blocked on https://github.com/rust-lang/libs-team/issues/323 being accepted and it's follow-up pr~~
2024-12-05 07:29:53 +01:00
Jieyou Xu
5b75493d99 Revert "Rollup merge of #133817 - clubby789:bootstrap-eprintln, r=jieyouxu"
This reverts commit 0585134e70, reversing
changes made to 5530869e0f.

The PR unfortunately only converted the `ln!` instances, meaning that
test output was messed up because stdout/stderr output interleaved when
some `println!` instances were converted to `eprintln!` instances, while
some `println!` instances remain unchanged.
2024-12-05 05:59:28 +00:00
Chris Denton
898d75122f
Update comments on Windows job objects 2024-12-05 03:45:05 +00:00
Chris Denton
a89f340efe
Nested job objects are now supported in CI
Nested job objects aren't supported on Windows 7 but we've long since moved on from that.
2024-12-05 03:18:53 +00:00
Chris Denton
01442e70a7
Never close a job after the process is assigned 2024-12-05 03:13:47 +00:00
Eric Huss
1c14127fd6 Update edition-guide and reference 2024-12-04 15:42:24 -08:00
Jakub Beránek
536516f949
Reformat Python code with ruff 2024-12-04 23:03:44 +01:00
Jakub Beránek
0b737a163e
Exclude additional subtrees in ruff config 2024-12-04 23:01:58 +01:00
Esteban Küber
c0f00086f8 Tweak ptr in pattern error
Conform to error style guide.
2024-12-04 20:29:36 +00:00
Taiki Endo
76f9aa1d7e Fix "std" support status of some tier 3 targets 2024-12-05 04:23:57 +09:00
Matthias Krüger
670affb122
Rollup merge of #133856 - GuillaumeGomez:update-sysinfo, r=clubby789
Update sysinfo version to 0.33.0
2024-12-04 18:23:44 +01:00
Matthias Krüger
adeb603052
Rollup merge of #133737 - Walnut356:msvc_visualizers, r=onur-ozkan
Include LLDB and GDB visualizers in MSVC distribution

MSVC distributions currently don't include the lldb or GDB python files. MSVC and LLDB/GDB are not mutually exclusive (and end up being a common case with vscode + codelldb/lldb-dap), so they should probably be included.

the existing visualizers currently only partially work on MSVC due to the differences in how the debug info is generated, but they also only partially work on GNU anyway - both of which are actively being fixed.
2024-12-04 18:23:36 +01:00
Oli Scherer
f613636ae8 Rename core_pattern_type and core_pattern_types lib feature gates to pattern_type_macro
That's what the gates are actually gating, and the single char difference in naming was not helpful either
2024-12-04 16:16:24 +00:00
Guillaume Gomez
52a6badb96 Update sysinfo version to 0.33.0 2024-12-04 14:42:39 +01:00
bors
96e51d9482 Auto merge of #133799 - DianQK:llvm/19.1.5, r=nikic
Update LLVM to 19.1.5

Fixes #133276. Fixes #133203.

r? nikic or wg-llvm
2024-12-04 10:33:33 +00:00
bors
733616f723 Auto merge of #133841 - matthiaskrgr:rollup-2snj3hc, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #133651 (Update `NonZero` and `NonNull` to not field-project (per MCP#807))
 - #133764 (rustdoc: Rename `set_back_info` to `restore_module_data`.)
 - #133784 (Fix MutVisitor's default implementations to visit Stmt's and BinOp's spans)
 - #133798 (stop replacing bivariant args with `'static` when computing closure requirements)
 - #133804 (Improve code for FileName retrieval in rustdoc)
 - #133817 (Use `eprintln` instead of `println` in bootstrap/compiletest/tidy)

Failed merges:

 - #133810 (remove unnecessary `eval_verify_bound`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-04 07:24:25 +00:00
Matthias Krüger
0585134e70
Rollup merge of #133817 - clubby789:bootstrap-eprintln, r=jieyouxu
Use `eprintln` instead of `println` in bootstrap/compiletest/tidy

A big unconditional CTRL-F replace to start with to check if there's anything that CI expects to be on stdout

r? `@jieyouxu`
2024-12-04 05:42:10 +01:00
Matthias Krüger
5530869e0f
Rollup merge of #133804 - GuillaumeGomez:improve-code, r=notriddle
Improve code for FileName retrieval in rustdoc

Some calls were performed twice (first in `is_real_and_local` and then in the function calling it). Also the `FileName` was matched on a few times too.

r? `@notriddle`
2024-12-04 05:42:09 +01:00
Matthias Krüger
afffc1a865
Rollup merge of #133764 - aDotInTheVoid:rename, r=GuillaumeGomez
rustdoc: Rename `set_back_info` to `restore_module_data`.

Follow-up to #133345, r? `@GuillaumeGomez`

Most of the references to `info` got removed as it was clear that `module_data` makes more sense here. Makes it clearer that `save_module_data` and `restore_module_data` are a pair.
2024-12-04 05:42:07 +01:00
bors
2633e01929 Auto merge of #133825 - weihanglo:update-cargo, r=weihanglo
Update cargo

17 commits in 4c39aaff66862cc0da52fe529aa1990bb8bb9a22..05f54fdc34310f458033af8a63ce1d699fae8bf6
2024-11-25 16:36:17 +0000 to 2024-12-03 03:14:12 +0000
- test(pgo): only run on nightly (rust-lang/cargo#14887)
- chore: Bump to 0.86.0; update changelog (rust-lang/cargo#14885)
- docs(ref): Finish a sentence on rust-versions (rust-lang/cargo#14884)
- chore(deps): update rust crate cargo_metadata to 0.19.0 (rust-lang/cargo#14878)
- chore(deps): update rust crate gix to 0.68.0 (rust-lang/cargo#14879)
- fix: Remove default registry reference in `info` cmd docs (rust-lang/cargo#14880)
- test(pgo): determine test runnability at compile time (rust-lang/cargo#14874)
- test: `requires` attribute accepts string literals for cmds (rust-lang/cargo#14875)
- chore(deps): update msrv (3 versions) to v1.81 (rust-lang/cargo#14871)
- chore(deps): update msrv (rust-lang/cargo#14867)
- fix(fix): Migrate cargo script manifests across editions (rust-lang/cargo#14864)
- feat(toml): Allow adding/removing from cargo scripts (rust-lang/cargo#14857)
- Add future-incompat warning against keywords in cfgs and add raw-idents (rust-lang/cargo#14671)
- test(build-std): download deps first (rust-lang/cargo#14861)
- test(pgo): ensure PGO works (rust-lang/cargo#14859)
- git-fetch-with-cli: Set `GIT_DIR` for bare repository compatibility (rust-lang/cargo#14860)
- fix(build-std): always link to std when testing proc-macros (rust-lang/cargo#14850)
2024-12-04 04:36:50 +00:00
bors
3b382642ab Auto merge of #133818 - matthiaskrgr:rollup-iav1wq7, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #132937 (a release operation synchronizes with an acquire operation)
 - #133681 (improve TagEncoding::Niche docs, sanity check, and UB checks)
 - #133726 (Add `core::arch::breakpoint` and test)
 - #133768 (Remove `generic_associated_types_extended` feature gate)
 - #133811 ([AIX] change AIX default codemodel=large)
 - #133812 (Update wasm-component-ld to 0.5.11)
 - #133813 (compiletest: explain that UI tests are expected not to compile by default)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-04 00:47:09 +00:00
clubby789
8374f7ceb5 tidy: println! -> eprintln! 2024-12-03 23:46:05 +00:00
clubby789
23725619c4 compiletest: println! -> eprintln! 2024-12-03 23:43:10 +00:00
clubby789
3fadb87d76 bootstrap: println! -> eprintln! 2024-12-03 23:41:47 +00:00
Miguel Ojeda
7cc6f4da88 CI: rfl: move job forward to Linux v6.13-rc1
Linux v6.13-rc1 contains commit 28e848386b92 ("rust: block: fix formatting
of `kernel::block::mq::request` module"), which in turn contains commit
c95bbb59a9b2 ("rust: enable arbitrary_self_types and remove `Receiver`"),
which is why we had a hash rather than a tag.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2024-12-03 23:39:47 +01:00