Commit Graph

266177 Commits

Author SHA1 Message Date
Yacin Tmimi
eeda9dd070 Merge commit 'b23b69900eab1260be510b2bd8922f4b6de6cf1e' into sync-from-rustfmt 2024-09-19 21:46:44 -04:00
Yacin Tmimi
b23b69900e chore: prep v1.8.0 release 2024-09-19 21:33:01 -04:00
bors
506f22b466 Auto merge of #130572 - matthiaskrgr:rollup-0q3qyg9, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #128001 (Improve documentation for <integer>::from_str_radix)
 - #130553 ([Clippy] Get rid of most `std` `match_def_path` usage, swap to diagnostic items.)
 - #130554 (`pal::unsupported::process::ExitCode`: use an `u8` instead of a `bool`)
 - #130556 (Mark the `link_cfg` feature as internal)
 - #130558 (Support 128-bit atomics on s390x)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-09-19 18:40:30 +00:00
Matthias Krüger
f715815bfb
Rollup merge of #130558 - taiki-e:s390x-atomic-128, r=cuviper
Support 128-bit atomics on s390x

Since LLVM 18 (c568927f3e), 128-bit atomics are fully supported on s390x. And the current minimum external LLVM version is now 18 (https://github.com/rust-lang/rust/pull/130487).

s390x 128-bit atomic instructions (lpq,stpq,cdsg) has been present since [the First Edition of the Principles of Operation](https://publibfp.dhe.ibm.com/epubs/pdf/dz9zr000.pdf). (LLVM's minimal supported architecture level [is z10 (the Eighth Edition of the PoP)](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/SystemZ/SystemZProcessors.td#L16-L17).)

cc https://github.com/rust-lang/rust/issues/99069

r? `@cuviper`
2024-09-19 20:37:09 +02:00
Matthias Krüger
9f0d32c638
Rollup merge of #130556 - Urgau:link_cfg_internal, r=jieyouxu
Mark the `link_cfg` feature as internal

This PR marks the `link_cfg` feature as internal because it's a perme-unstable feature, only used by `core`/`std`and `unwind`.
2024-09-19 20:37:08 +02:00
Matthias Krüger
553c20cc92
Rollup merge of #130554 - ShE3py:unsupported-exitcode, r=Noratrieb
`pal::unsupported::process::ExitCode`: use an `u8` instead of a `bool`

`ExitCode` should “represents the status code the current process can return to its parent under normal termination”, but is currently represented as a `bool` on unsupported platforms, making the `impl From<u8> for ExitCode` lossy.

Fixes #130532.

History: [IRLO thread](https://internals.rust-lang.org/t/mini-pre-rfc-redesigning-process-exitstatus/5426) (`ExitCode` as a `main` return), #48618 (initial impl), #93445 (`From<u8>` impl).
2024-09-19 20:37:08 +02:00
Matthias Krüger
569153a432
Rollup merge of #130553 - GnomedDev:remove-clippy-paths, r=compiler-errors
[Clippy] Get rid of most `std` `match_def_path` usage, swap to diagnostic items.

Part of https://github.com/rust-lang/rust-clippy/issues/5393.

This was going to remove all `std` paths, but `SeekFrom` has issues being cleanly replaced with a diagnostic item as the paths are for variants, which currently cannot be diagnostic items.

This also, as a last step, categories the paths to help with future path removals.
2024-09-19 20:37:07 +02:00
Matthias Krüger
767ae2b33d
Rollup merge of #128001 - Krappa322:master, r=scottmcm
Improve documentation for <integer>::from_str_radix

Two improvements to the documentation:
- Document `-` as a valid character for signed integer destinations
- Make the documentation even more clear that extra whitespace and non-digit characters is invalid. Many other languages, e.g. c++, are very permissive in string to integer routines and simply try to consume as much as they can, ignoring the rest. This is trying to make the transition for developers who are used to the conversion semantics in these languages a bit easier.
2024-09-19 20:37:06 +02:00
bors
749f80ab05 Auto merge of #130069 - GuillaumeGomez:gen-scraped-buttons, r=notriddle
Generate scraped examples buttons in JS

Follow-up of https://github.com/rust-lang/rust/pull/129796.

To reduce the page size when there are scraped examples, we can generate their buttons in JS since they require JS to work in any case. There should be no changes in display or in functionality.

You can test it [here](https://rustdoc.crud.net/imperio/gen-scraped-buttons/doc/scrape_examples/fn.test.html).

cc `@willcrichton`
r? `@notriddle`
2024-09-19 15:53:31 +00:00
Urgau
b67485e196 Make link_cfg internal because it's in perme-unstable 2024-09-19 15:56:27 +02:00
bors
13a5097796 Auto merge of #130529 - onur-ozkan:better-ci-llvm-default, r=Kobzol
change `download-ci-llvm` default from `if-unchanged` to `true`

Since https://github.com/rust-lang/rust/pull/129473 and https://github.com/rust-lang/rust/pull/130202, using `download-ci-llvm=true` is now the better default and it also fixes #130515.
2024-09-19 13:32:00 +00:00
Lieselotte
dc628c8ecb
pal::unsupported::process::ExitCode: use an u8 instead of a bool 2024-09-19 14:22:50 +02:00
GnomedDev
13d5732811
Categorise paths in clippy_utils::paths 2024-09-19 13:13:43 +01:00
GnomedDev
b2eebeeea9
[Clippy] Swap open_options to use diagnostic items instead of paths 2024-09-19 13:13:43 +01:00
GnomedDev
364e552940
[Clippy] Swap iter_over_hash_type to use diagnostic items instead of paths 2024-09-19 13:13:43 +01:00
GnomedDev
43b8e04d46
[Clippy] Swap non_octal_unix_permissions to use diagnostic item instead of path 2024-09-19 13:13:43 +01:00
GnomedDev
5f85f73f63
[Clippy] Swap unnecessary_owned_empty_strings to use diagnostic item instead of path 2024-09-19 13:13:43 +01:00
GnomedDev
5f42ae13c1
[Clippy] Swap manual_strip to use diagnostic items instead of paths 2024-09-19 13:13:43 +01:00
GnomedDev
89532c0f30
[Clippy] Swap unnecessary_to_owned to use diagnostic item instead of path 2024-09-19 13:13:42 +01:00
GnomedDev
1890620b26
[Clippy] Swap instant_subtraction to use diagnostic item instead of path 2024-09-19 13:13:42 +01:00
GnomedDev
372f68b6a6
[Clippy] Swap waker_clone_wake to use diagnostic item instead of path 2024-09-19 13:13:42 +01:00
GnomedDev
5b55270225
[Clippy] Swap filter_map_bool_then to use diagnostic item instead of path 2024-09-19 13:13:42 +01:00
GnomedDev
25da0e2e5d
[Clippy] Swap manual_while_let_some to use diagnostic items instead of paths 2024-09-19 13:13:42 +01:00
GnomedDev
15240a93c9
[Clippy] Swap repeat_vec_with_capacity to use diagnostic item instead of path 2024-09-19 13:13:42 +01:00
GnomedDev
846ae57fc1
[Clippy] Swap VecArgs::hir to use diagnostic items instead of paths 2024-09-19 13:13:40 +01:00
GnomedDev
28f4c8293a
[Clippy] Swap single_char_add_str/format_push_string to use diagnostic items instead of paths 2024-09-19 13:13:20 +01:00
GnomedDev
037b9784b6
[Clippy] Swap manual_main_separator_str to use diagnostic item instead of path 2024-09-19 13:13:20 +01:00
GnomedDev
afe7907914
[Clippy] Swap redundant_clone to use diagnostic items instead of paths 2024-09-19 13:13:20 +01:00
GnomedDev
c891082029
[Clippy] Swap float_equality_without_abs to use diagnostic items instead of paths 2024-09-19 13:13:20 +01:00
GnomedDev
5e4716888a
[Clippy] Swap option_as_ref_deref to use diagnostic items instead of paths 2024-09-19 13:13:19 +01:00
onur-ozkan
05f10f4765 add change-tracker for new download-ci-llvm default
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-19 14:28:08 +03:00
onur-ozkan
4e090e70d1 update llvm.download-ci-llvm documentation
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-19 14:28:06 +03:00
onur-ozkan
7d579046c8 change download-ci-llvm default from "if-unchanged" to true
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-19 14:28:00 +03:00
Taiki Endo
078b067c0d Support 128-bit atomics on s390x 2024-09-19 20:26:43 +09:00
bors
b0af276da3 Auto merge of #130406 - arttet:master, r=onur-ozkan
Bump cc dependency

* The [issue](https://github.com/rust-lang/rust/issues/130231) was fixed in the [PR](https://github.com/rust-lang/cc-rs/pull/1207)
* The build artifacts of arm64e-apple-darwin can be found [here](https://github.com/arttet/rust-compiler-builder/actions/runs/10902308425)
2024-09-19 09:20:08 +00:00
GnomedDev
3ebff28f80
[Clippy] Swap lines_filter_map_ok to use a diagnostic item instead of path 2024-09-19 08:26:41 +01:00
GnomedDev
a786be5d06
[Clippy] Swap map_entry to use diagnostic items instead of paths 2024-09-19 08:26:37 +01:00
bors
b7b9453ea7 Auto merge of #130547 - workingjubilee:rollup-tw30khz, r=workingjubilee
Rollup of 3 pull requests

Successful merges:

 - #130531 (Check params for unsafety in THIR)
 - #130533 (Never patterns constitute a read for unsafety)
 - #130542 (Stabilize const `MaybeUninit::as_mut_ptr`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-09-19 06:58:55 +00:00
Jubilee
0ad2a522b7
Rollup merge of #130542 - ultrabear:stabilize_const_maybeuninit_as_mut_ptr, r=workingjubilee
Stabilize const `MaybeUninit::as_mut_ptr`

This PR stabilizes the following APIs as const stable as of rust `1.83`:
```rs
impl<T> MaybeUninit<T> {
    pub const fn as_mut_ptr(&mut self) -> *mut T;
}
```
This is made possible by const_mut_refs being stabilized (yay).

FCP: #75251 [(comment)](https://github.com/rust-lang/rust/issues/75251#issuecomment-2356197443)
2024-09-18 23:40:31 -07:00
Jubilee
f9b8ef0687
Rollup merge of #130533 - compiler-errors:never-pat-unsafeck, r=Nadrieril
Never patterns constitute a read for unsafety

This code is otherwise unsound if we don't emit an unsafety error here. Noticed when fixing #130528, but it's totally unrelated.

r? `@Nadrieril`
2024-09-18 23:40:30 -07:00
Jubilee
944df8e40f
Rollup merge of #130531 - compiler-errors:thir-unsafeck-param, r=Urgau
Check params for unsafety in THIR

Self-explanatory. I'm not surprised this was overlooked, given the way that THIR visitors work. Perhaps we should provide a better entrypoint.

Fixes #130528
2024-09-18 23:40:29 -07:00
bors
f8192ba0d0 Auto merge of #130511 - bjoernager:const-char-encode-utf8, r=dtolnay
Support `char::encode_utf8` in const scenarios.

This PR implements [`rust-lang/rfcs#3696`](https://github.com/rust-lang/rfcs/pull/3696/).

This assumes [`const_slice_from_raw_parts_mut`](https://github.com/rust-lang/rust/issues/67456/).
2024-09-19 04:17:04 +00:00
ultrabear
b7ca2b6510
run x.py fmt 2024-09-18 20:49:53 -07:00
ultrabear
63f14b3a1e
remove feature attributes as const_maybe_uninit_as_mut_ptr is stabilized 2024-09-18 20:22:10 -07:00
ultrabear
7477f3eb35
stabilize const_maybe_uninit_as_mut_ptr 2024-09-18 20:22:02 -07:00
bors
df7f77811c Auto merge of #123877 - ShE3py:expr-in-pats-2, r=fmease
Further improve diagnostics for expressions in pattern position

Follow-up of #118625, see #121697.

```rs
fn main() {
    match 'b' {
        y.0.0.1.z().f()? as u32 => {},
    }
}
```
Before:
```
error: expected one of `=>`, ``@`,` `if`, or `|`, found `.`
 --> src/main.rs:3:10
  |
3 |         y.0.0.1.z().f()? as u32 => {},
  |          ^ expected one of `=>`, ``@`,` `if`, or `|`
```
After:
```
error: expected a pattern, found an expression
 --> src/main.rs:3:9
  |
3 |         y.0.0.1.z().f()? as u32 => {},
  |         ^^^^^^^^^^^^^^^^^^^^^^^ arbitrary expressions are not allowed in patterns
  |
help: consider moving the expression to a match arm guard
  |
3 |         val if val == y.0.0.1.z().f()? as u32 => {},
  |         ~~~ +++++++++++++++++++++++++++++++++
help: consider extracting the expression into a `const`
  |
2 +     const VAL: /* Type */ = y.0.0.1.z().f()? as u32;
3 ~     match 'b' {
4 ~         VAL => {},
  |
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
  |
3 |         const { y.0.0.1.z().f()? as u32 } => {},
  |         +++++++                         +
```

---

r? fmease
`@rustbot` label +A-diagnostics +A-parser +A-patterns +C-enhancement
2024-09-19 00:36:33 +00:00
Michael Goulet
e138e8760d Never patterns constitute a read for unsafety 2024-09-18 19:17:38 -04:00
Gabriel Bjørnager Jensen
fb475e4759
Mark and implement 'char::encode_utf8' as const. 2024-09-18 14:56:01 -07:00
bors
a5cf8bbd4e Auto merge of #130534 - workingjubilee:rollup-furaug4, r=workingjubilee
Rollup of 9 pull requests

Successful merges:

 - #97524 (Add `Thread::{into_raw, from_raw}`)
 - #127988 (Do not ICE with incorrect empty suggestion)
 - #129422 (Gate `repr(Rust)` correctly on non-ADT items)
 - #129934 (Win: Open dir for sync access in remove_dir_all)
 - #130450 (Reduce confusion about `make_indirect_byval` by renaming it)
 - #130476 (Implement ACP 429: add `Lazy{Cell,Lock}::get[_mut]` and `force_mut`)
 - #130487 (Update the minimum external LLVM to 18)
 - #130513 (Clarify docs for std::fs::File::write)
 - #130522 ([Clippy] Swap `manual_retain` to use diagnostic items instead of paths)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-09-18 21:51:55 +00:00
Jubilee
4bd9de5512
Rollup merge of #130522 - GnomedDev:clippy-manual-retain-paths, r=compiler-errors
[Clippy] Swap `manual_retain` to use diagnostic items instead of paths

Part of https://github.com/rust-lang/rust-clippy/issues/5393, just a chore.
2024-09-18 14:32:28 -07:00