Commit Graph

12509 Commits

Author SHA1 Message Date
bors
8fdb0a9b57 Auto merge of #114709 - ShE3py:wasi-io-error-more, r=workingjubilee
Use `io_error_more` on WASI

#86442 added many variants to [`io::ErrorKind`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html), but `sys::wasi::decode_error_kind()` wasn't modified to use them.

The preview1 `errno` list:
4712d490fd/legacy/preview1/docs.md (-errno-variant)

Original implementation: #63814

`@rustbot` label +A-error-handling +C-enhancement +O-wasi
2023-10-06 22:39:41 +00:00
Sebastian Imlay
3abef68e63 Add tvOS to target_os for register_dtor 2023-10-06 18:11:49 -04:00
Matthias Krüger
7f0cf8c0e4
Rollup merge of #116484 - peterjoel:once-doc-clarify, r=cuviper
Minor doc clarification in Once::call_once
2023-10-06 21:17:51 +02:00
Matthias Krüger
f8dae0c20a
Rollup merge of #116481 - scottmcm:tweak-combinators, r=cuviper
Reuse existing `Some`s in `Option::(x)or`

LLVM still has trouble re-using discriminants sometimes when rebuilding a two-variant enum, so when we have the correct variant already built, just use it.

That's shorter in the Rust code, as well as simpler in MIR and the optimized LLVM, so might as well: <https://rust.godbolt.org/z/KhdE8eToW>

Thanks to `@veber-alex` for pointing out this opportunity in https://github.com/rust-lang/rust/issues/101210#issuecomment-1732470941
2023-10-06 21:17:50 +02:00
Matthias Krüger
4dfa5e5dec
Rollup merge of #114564 - scottmcm:when-to-from, r=dtolnay
Attempt to describe the intent behind the `From` trait further

Inspired by the <https://internals.rust-lang.org/t/allow-use-as-and-try-as-for-from-and-tryfrom-traits/19240/26?u=scottmcm> thread.

`@rustbot` label +T-libs-api
2023-10-06 21:17:48 +02:00
ShE3py
3706e6f61a
Use io_error_more on WASI 2023-10-06 19:05:45 +02:00
The 8472
b018ad3d41 optimize zipping over array iterators 2023-10-06 18:33:25 +02:00
bors
1bc0463b18 Auto merge of #116483 - GuillaumeGomez:rollup-z65pno1, r=GuillaumeGomez
Rollup of 6 pull requests

Successful merges:

 - #115454 (Clarify example in docs of str::char_slice)
 - #115522 (Clarify ManuallyDrop bit validity)
 - #115588 (Fix a comment in std::iter::successors)
 - #116198 (Add more diagnostic items for clippy)
 - #116329 (update some comments around swap())
 - #116475 (rustdoc-search: fix bug with multi-item impl trait)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-10-06 13:07:15 +00:00
Peter Hall
c95015c295 Minor doc clarification in Once::call_once 2023-10-06 12:20:39 +01:00
Guillaume Gomez
9e28a9349c
Rollup merge of #116329 - RalfJung:swap-comments, r=scottmcm
update some comments around swap()

Based on ``@eddyb's`` comment [here](https://github.com/rust-lang/unsafe-code-guidelines/issues/461#issuecomment-1742156410).

And then I noticed the wrong capitalization for Miri and fixed it in some other places as well.
2023-10-06 13:18:35 +02:00
Guillaume Gomez
3785fed021
Rollup merge of #116198 - Jarcho:diag_items, r=WaffleLapkin
Add more diagnostic items for clippy
2023-10-06 13:18:34 +02:00
Guillaume Gomez
382701e6b6
Rollup merge of #115588 - tifv:fix-comment-successors, r=scottmcm
Fix a comment in std::iter::successors

The `unfold` function have since #58062 been renamed to `from_fn`.
(I'm not sure if this whole comment is still useful—it's not like there are many iterators that *can't* be based on `from_fn`. Anyway, in its current form this comment is not correct, and it sent me into a half-hour research of what happened to `unfold` function, so I want to do *something* with it 🙃 deleting these three lines is a perfectly fine alternative, in my opinion.)
2023-10-06 13:18:34 +02:00
Guillaume Gomez
525c661842
Rollup merge of #115522 - joshlf:patch-8, r=scottmcm
Clarify ManuallyDrop bit validity

Clarify that `ManuallyDrop<T>` has the same bit validity as `T`.
2023-10-06 13:18:33 +02:00
Guillaume Gomez
4e818f6b72
Rollup merge of #115454 - vwkd:patch-1, r=scottmcm
Clarify example in docs of str::char_slice

Just a one word improvement.

“Last” can be misread as meaning the last (third) instead of the previous (first).
2023-10-06 13:18:33 +02:00
bors
6683f13fa1 Auto merge of #111595 - fortanix:raoul/waitqueue_clarifications, r=workingjubilee
`waitqueue` clarifications for SGX platform

The documentation of `waitqueue` functions on the `x86_64-fortanix-unknown-sgx` platform is incorrect at some places and on others missing. This PR improves upon this.

cc: `@jethrogb`
2023-10-06 11:12:13 +00:00
Scott McMurray
5432d13bb0 Reuse existing Somes in Option::(x)or
LLVM still has trouble re-using discriminants sometimes when rebuilding a two-variant enum, so when we have the correct variant already built, just use it.

That's simpler in LLVM *and* in MIR, so might as well: <https://rust.godbolt.org/z/KhdE8eToW>
2023-10-06 01:41:48 -07:00
Scott McMurray
1651f1f4b8 Elaborate some caveats to lossless 2023-10-05 23:03:02 -07:00
scottmcm
44f92c1f80
Don't mention "recover the original" in From docs
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2023-10-06 05:31:54 +00:00
Scott McMurray
b80e653ca1 Attempt to describe the intent behind the From trait further 2023-10-05 22:21:45 -07:00
bors
fd80c02c16 Auto merge of #116463 - ChrisDenton:nlibc, r=workingjubilee
Remove libc

We don't use much libc on Windows and it seemed silly to keep if for the sake of [two well documented constants](https://learn.microsoft.com/en-us/cpp/c-runtime-library/exit-success-exit-failure?view=msvc-170).
2023-10-06 03:39:22 +00:00
bors
579be69de9 Auto merge of #101150 - jethrogb:jb/cleanup-sgx-user-memory-copies, r=workingjubilee
Clean up SGX user memory copies

Follow-up on #98126 and #100383

r? `@cuviper`
cc `@raoulstrackx`
2023-10-06 01:50:10 +00:00
Chris Denton
c8f3aa451a
Remove libc
We don't use much libc on Windows.
2023-10-06 00:35:00 +01:00
Jason Newcomb
d464b72970 Add more diagnostic items for clippy 2023-10-05 18:21:47 -04:00
bors
cdca82c2c8 Auto merge of #116455 - matthiaskrgr:rollup-p226a5u, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #116220 (stabilize `Option::as_`(`mut_`)`slice`)
 - #116288 (Add Span to various smir types)
 - #116415 (Move subtyper below reveal_all and change reveal_all)
 - #116428 (Add a note to duplicate diagnostics)
 - #116452 (Do not assert that hidden types don't have erased regions.)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-10-05 17:50:50 +00:00
Matthias Krüger
864e5d8d94
Rollup merge of #116220 - llogiq:stabilize-option-as-slice, r=BurntSushi
stabilize `Option::as_`(`mut_`)`slice`

This is the stabilization to #108545. Thanks to everyone who helped getting this into Rust proper.
2023-10-05 19:24:33 +02:00
bors
3bcad65fbf Auto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee
docs: Correct terminology in std::cmp

This PR is the result of some discussions on URLO:

* [Traits in `std::cmp` and mathematical terminology](https://users.rust-lang.org/t/traits-in-std-cmp-and-mathematical-terminology/69887)
* [Are poker hands `Ord` or `PartialOrd`?](https://users.rust-lang.org/t/are-poker-hands-ord-or-partialord/82644)

Arguably, the documentation currently isn't very precise regarding mathematical terminology. This can lead to misunderstandings of what `PartialEq`, `Eq`, `PartialOrd`, and `Ord` actually do.

While I believe this PR doesn't give any new API guarantees, it expliclitly mentions that `PartialEq::eq(a, b)` may return `true` for two distinct values `a` and `b` (i.e. where `a` and `b` are not equal in the mathematical sense). This leads to the consequence that `Ord` may describe a weak ordering instead of a total ordering.

In either case, I believe this PR should be thoroughly reviewed, ideally by someone with mathematical background to make sure the terminology is correct now, and also to ensure that no unwanted new API guarantees are made.

In particular, the following problems are addressed:

* Some clarifications regarding used (mathematical) terminology:
    * Avoid using the terms "total equality" and "partial equality" in favor of "equivalence relation" and "partial equivalence relation", which are well-defined and unambiguous.
    * Clarify that `Ordering` is an ordering between two values (and not an order in the mathematical sense).
    * Avoid saying that `PartialEq` and `Eq` are "equality comparisons" because the terminology "equality comparison" could be misleading: it's possible to implement `PartialEq` and `Eq` for other (partial) equivalence relations, in particular for relations where `a == b` for some `a` and `b` even when `a` and `b` are not the same value.
    * Added a section "Strict and non-strict partial orders" to document that the `<=` and `>=` operators do not correspond to non-strict partial orders.
    * Corrected section "Corollaries" in documenation of `Ord` in regard to `<` only describing a strict total order in cases where `==` conforms to mathematical equality.
    * ~~Added a section "Weak orders" to explain that `Ord` may also describe a weak order or total preorder, depending on how `PartialEq::eq` has been implemented.~~ (Removed, see [comment](https://github.com/rust-lang/rust/pull/103046#issuecomment-1279929676))
* Made documentation easier to understand:
    * Explicitly state at the beginning of `PartialEq`'s documentation comment that implementing the trait will provide the `==` and `!=` operators.
    * Added an easier to understand rule when to implement `Eq` in addition to `PartialEq`: "if it’s guaranteed that `PartialEq::eq(a, a)` always returns `true`."
    *  Explicitly mention in documentation of `Eq` that the properties "symmetric" and "transitive" are already required by `PartialEq`.
2023-10-05 15:24:54 +00:00
bors
cf9fd95b1c Auto merge of #114042 - liushuyu:ubuntu/i586-fpmath, r=workingjubilee
core library: Disable fpmath tests for i586 ...

This patch disables the floating-point epsilon test for i586 since x87 registers are too imprecise and can't produce the expected results.
2023-10-05 13:35:18 +00:00
Jan Behrens
86b031b734 docs: Correct terminology in std::cmp
Some clarifications regarding used (mathematical) terminology:

* Avoid using the terms "total equality" and "partial equality" in favor
  of "equivalence relation" and "partial equivalence relation", which
  are well-defined and unambiguous.
* Clarify that `Ordering` is an ordering between two values (and not an
  order in the mathematical sense).
* Avoid saying that `PartialEq` and `Eq` are "equality comparisons"
  because the terminology "equality comparison" could be misleading:
  it's possible to implement `PartialEq` and `Eq` for other (partial)
  equivalence relations, in particular for relations where `a == b` for
  some `a` and `b` even when `a` and `b` are not the same value.
* Added a section "Strict and non-strict partial orders" to document
  that the `<=` and `>=` operators do not correspond to non-strict
  partial orders.
* Corrected section "Corollaries" in documenation of Ord in regard to
  `<` only describing a strict total order in cases where `==` conforms
  to mathematical equality.

Made documentation easier to understand:

* Explicitly state at the beginning of `PartialEq`'s documentation
  comment that implementing the trait will provide the `==` and `!=`
  operators.
* Added an easier to understand rule when to implement `Eq` in addition
  to `PartialEq`: "if it’s guaranteed that `PartialEq::eq(a, a)` always
  returns `true`."
* Explicitly mention in documentation of `Eq` that the properties
  "symmetric" and "transitive" are already required by `PartialEq`.
2023-10-05 14:44:42 +02:00
bors
90f3a6f920 Auto merge of #104153 - tspiteri:doc-float-constants, r=workingjubilee
doc: expand description for f32 and f64 associated constants

This explains the meaning of some of the floating-point associated constants.
2023-10-05 11:46:55 +00:00
Jubilee
ea3454eabb
Rollup merge of #116223 - catandcoder:master, r=cjgillot
Fix misuses of a vs an

Fixes the misuse of "a" vs "an", according to English grammatical
expectations and using https://www.a-or-an.com/
2023-10-05 00:56:29 -07:00
Ramon de C Valle
7b45674015 Disable CFI for core and std CFI violations
Works around #115199 by temporarily disabling CFI for core and std CFI
violations to allow the user rebuild and use both core and std with CFI
enabled using the Cargo build-std feature.
2023-10-04 10:05:54 -07:00
joboet
b18990b1e9
std: abort instead of panicking if the global allocator uses TLS 2023-10-04 11:49:48 +02:00
bors
a7bb2f67bf Auto merge of #116408 - matthiaskrgr:rollup-hmolg4m, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #115961 (Replace 'mutex' with 'lock' in RwLock documentation)
 - #116146 (Clarify `arg` and `args` documentation)
 - #116363 (Adapt `todo!` documentation to mention displaying custom values)
 - #116365 (bootstrap: make copying linker binaries conditional)
 - #116388 (rustdoc: fix & clean up handling of cross-crate higher-ranked parameters)
 - #116393 (Emit feature gate *warning* for `auto` traits pre-expansion)
 - #116395 (Mark myself as vacation or whatever)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-10-04 03:38:42 +00:00
Matthias Krüger
0363cc561d
Rollup merge of #116363 - Colonial-Dev:issue-116130-fix, r=thomcc
Adapt `todo!` documentation to mention displaying custom values

Resolves #116130.

I copied from the [existing documentation](https://doc.rust-lang.org/std/macro.unimplemented.html) for `unimplemented!` more or less directly, down to the example trait used. I also took the liberty of fixing some formatting and typographical errors that I noticed.
2023-10-04 05:02:04 +02:00
Matthias Krüger
d5bd019645
Rollup merge of #116146 - Milo123459:milo/clarify-arg-documentation, r=thomcc
Clarify `arg` and `args` documentation

Fixes #95400
2023-10-04 05:02:04 +02:00
Matthias Krüger
36e234a0fa
Rollup merge of #115961 - Kriskras99:master, r=thomcc
Replace 'mutex' with 'lock' in RwLock documentation

When copying the documentation for `clear_poison` from Mutex, not every occurence of 'mutex' was replaced with 'lock'.
2023-10-04 05:02:03 +02:00
bors
4910642aab Auto merge of #116386 - elichai:patch-2, r=thomcc
Add missing inline attributes to Duration trait impls

Currently `Duration::checked_add` is marked `#[inline]` but it's trait relative `Add::add` is not.
Leading to a case where:
```rust
pub fn foo() -> Duration {
    Duration::from_secs(10) + Duration::from_millis(6)
}

pub fn bar() -> Duration {
    Duration::from_secs(10).checked_add(Duration::from_millis(6)).expect("overflow when adding durations")
}
```
compiles to:
```asm

playground::foo:
	movl	$10, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$6000000, %ecx
	jmpq	*<core::time::Duration as core::ops::arith::Add>::add@GOTPCREL(%rip)

playground::bar:
	movl	$10, %eax
	movl	$6000000, %edx
	retq
```
(The same happens for all arithmetic operation)
2023-10-04 01:49:24 +00:00
Mark Rousskov
787d32324c Bump version placeholders 2023-10-03 20:26:36 -04:00
bors
79f38b7914 Auto merge of #116367 - scottmcm:more-addr-eq, r=workingjubilee
Use `addr_eq` in `{Arc,Rc}::ptr_eq`

Since it's made for stuff like this (see #106447)
2023-10-04 00:03:54 +00:00
cui fliter
f44d116e1f Fix misuses of a vs an
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-10-04 08:01:11 +08:00
joboet
fd23276ca8
std: panic when the global allocator tries to register a TLS destructor 2023-10-03 23:57:37 +02:00
bors
187b8131d4 Auto merge of #105394 - Patiga:improve-udpsocket-docs, r=workingjubilee
Improve UdpSocket documentation

I tried working with `UdpSocket` and ran into `EINVAL` errors with no clear indication of what causes the error. Also, it was uncharacteristically hard to figure this module out, compared to other Rust `std` modules.

1. `send` and `send_to` return a `usize` This one is just clarity. Usually, returned `usize`s indicate that the buffer might have only been sent partially. This is not the case with UDP. Since that `usize` must always be `buffer.len()`, I have documented that.

2. `bind` limits `connect` and `send_to` When you bind to a limited address space like localhost, you can only `connect` to addresses in that same address space. Error kind: `AddrNotAvailable`.

3. `connect`ing to localhost locks you to localhost On Linux, if you first `connect` to localhost, subsequent `connect`s to
non-localhost addresses fail. Error kind: `InvalidInput`.

For debugging the third one, it was really hard to find someone else who already had that problem. I only managed to find this thread: https://www.mail-archive.com/netdev@vger.kernel.org/msg159519.html
2023-10-03 20:35:38 +00:00
Elichai Turkel
92c9bcdff4
Add missing inline attributes to Duration trait impls 2023-10-03 18:39:56 +03:00
Matthias Krüger
a4ba529474
Rollup merge of #116282 - rustaceanclub:master, r=davidtwco
Fix broken links

The previous address is no longer available, replace it with the latest available one.
2023-10-03 16:24:16 +02:00
Matthias Krüger
c3daf77132
Rollup merge of #116361 - eduardosm:bump-stdarch, r=Amanieu
Bump stdarch submodule

r? `@Amanieu`
2023-10-03 08:58:50 +02:00
Matthias Krüger
043fcc487a
Rollup merge of #116355 - orlp:signed-zero-rounding-mode, r=thomcc
Clarify float rounding direction for signed zero

Closes https://github.com/rust-lang/rust/issues/116339.
2023-10-03 08:58:50 +02:00
Matthias Krüger
cebe393a4a
Rollup merge of #116351 - asquared31415:ptr_eq_must_use, r=workingjubilee
Add `must_use` on pointer equality functions

`ptr == ptr` (like all use of `==`) has a similar warning, and these functions are simple convenience wrappers over that.
2023-10-03 08:58:49 +02:00
Peter Jaszkowiak
93677276bc Invoke backtrace-rs buildscript in std buildscript
Based on #99883 by @Arc-blroth
Depends on rust-lang/backtrace-rs#556 and rust-lang/cc-rs#705
2023-10-02 19:34:27 -06:00
Scott McMurray
f8fc0d7716 Use addr_eq in {Arc,Rc}::ptr_eq
Since it's made for stuff like this (see 106447)
2023-10-02 17:32:01 -07:00
James Haywood
0c6d279728 Appease tidy 2023-10-02 19:22:42 -04:00
James Haywood
f96cfb533a Adapt todo! documentation to mention displaying custom values
Correct hidden trait in doc test
2023-10-02 19:09:11 -04:00
Eduardo Sánchez Muñoz
f2918b4a3d Bump stdarch submodule 2023-10-02 23:43:35 +02:00
Tyler Mandry
132e38366f
Rollup merge of #116350 - Nilstrieb:in-situ, r=Dylan-DPC
Improve wording of `hint::black_box` docs

The wording is a bit confusing.

squash of #109634
2023-10-02 16:09:43 -04:00
Tyler Mandry
1edf7233fa
Rollup merge of #116289 - linkmauve:patch-1, r=the8472
Add missing #[inline] on AsFd impl for sys::unix::fs::File

This operation should be extremely cheap, at most the `mov` of the underlying file descriptor, but due to this missing `#[inline]` it is currently a function call.
2023-10-02 16:09:42 -04:00
Orson Peters
07e96314ec Clarify float rounding direction for signed zero 2023-10-02 22:05:17 +02:00
4gboframram
44c9818993 Improve wording of hint::black_box docs
The wording is a bit confusing.

Co-authored-by: Chris Denton <christophersdenton@gmail.com>
2023-10-02 20:07:14 +02:00
asquared31415
34ea540720 add must_use on pointer equality functions 2023-10-02 15:10:51 +00:00
Matthias Krüger
b3853ccc9d
Rollup merge of #116326 - Colonial-Dev:issue-116165-fix, r=joshtriplett
Correct misleading std::fmt::Binary example (#116165)

Nothing too crazy...

- Add two to the width specifier (so all 32 bits are correctly displayed)
- Pad out the compared string so the assert passes
- Add `// Note` comment highlighting the need for the extra width when using the `#` flag.

The exact contents (and placement?) of the note are, of course, highly bikesheddable.
2023-10-02 16:23:53 +02:00
Ralf Jung
bfc0f23acb MIRI -> Miri 2023-10-02 08:35:08 +02:00
Ralf Jung
ec2e00c404 update some comments around swap() 2023-10-02 08:34:10 +02:00
bors
15783292e5 Auto merge of #116325 - scottmcm:addr_eq, r=dtolnay
Add `ptr::addr_eq`

Seconded ACP: https://github.com/rust-lang/libs-team/issues/274#issuecomment-1741853598
Tracking issue: https://github.com/rust-lang/rust/issues/116324
cc `@dtolnay` https://github.com/rust-lang/rust/issues/106447
2023-10-02 04:17:01 +00:00
James Haywood
f2ecf7c511 Correct misleading std::fmt::Binary example 2023-10-01 23:58:54 -04:00
bors
30ec74728d Auto merge of #116317 - ravenclaw900:track-caller-unwrap-or-else, r=Mark-Simulacrum
Add track_caller attribute to Result::unwrap_or_else

Fixes issue where panics in unwrap_or_else callbacks marked with the `track_caller` attribute appear as errors in core.
2023-10-02 02:26:38 +00:00
Scott McMurray
18787914aa Add ptr::addr_eq 2023-10-01 18:56:38 -07:00
bors
79bfd93d5a Auto merge of #116207 - Ayush1325:uefi_stdio, r=Mark-Simulacrum
Stdio support for UEFI

- Uses Simple Text Output Protocol and Simple Text Input Protocol
- Reading is done one character at a time
- Writing is done with max 4096 characters

# Quirks
## Output Newline
- UEFI uses CRLF for newline. So when running the application in UEFI shell (qemu VGA), the output of `println` looks weird.
- However, since the UEFI shell supports piping output, I am unsure if doing any output post-processing is a good idea. UEFI shell `cat` command seems to work fine with just LF.

## Input Newline
- `Stdin.read_line()` method is broken in UEFI shell. Pressing enter seems to be read as CR, which means LF is never encountered.
- Works fine with input redirection from file.

CC `@dvdhrm`
2023-10-02 00:03:52 +00:00
Ayush Singh
3f4a289016
Stdio for UEFI
- Uses Simple Text Output Protocol and Simple Text Input Protocol
- Reading is done one character at a time
- Writing is done with max 4096 characters

Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2023-10-02 00:07:11 +05:30
ravenclaw900
ba0b7f0f01
Add track_caller attribute to Result::unwrap_or_else 2023-10-01 09:42:37 -05:00
Matthias Krüger
de7053133a
Rollup merge of #116295 - asquared31415:mem_drop_docs, r=WaffleLapkin
Fix `core::mem::drop` docs inaccuracy

r? `@Nilstrieb`
2023-10-01 12:18:12 +02:00
bors
8fa7bdf191 Auto merge of #115670 - Zoxc:outline-panic-macro-1, r=Mark-Simulacrum
Partially outline code inside the panic! macro

This outlines code inside the panic! macro in some cases. This is split out from https://github.com/rust-lang/rust/pull/115562 to exclude changes to rustc.
2023-10-01 05:56:47 +00:00
bors
2f89c414f2 Auto merge of #116157 - the8472:doc-monotonoic-suspend, r=Mark-Simulacrum
Document that Instant may or may not include system-suspend time

Since people are still occasionally surprised by this let's make it more explicit. This doesn't add any new guarantees, only documents the status quo.

Related issues: #87906 #79462
2023-09-30 19:49:34 +00:00
asquared31415
bc3c445764 mem::drop docs 2023-09-30 14:41:56 -04:00
linkmauve
133aa56a84
Add missing #[inline] on AsFd impl for sys::unix::fs::File
This operation should be extremely cheap, at most the mov of the underlying
file descriptor, but due to this missing #[inline] it is currently a function
call.
2023-09-30 17:56:42 +02:00
cui fliter
6ef3fd7138 Fix broken links
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-09-30 10:26:04 +08:00
bors
4efd65571e Auto merge of #115546 - SUPERCILEX:patch-2, r=Amanieu
Weaken needlessly restrictive orderings on Arc::*_count

Follow up to https://github.com/rust-lang/rust/pull/95183 from this zulip: https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Why.20does.20Arc.3A.3Astrong_count.20use.20Acquire.20instead.20of.20Relaxed.3F/near/386213850

I'd like to use the strong_count for a lockless algorithm I'm writing, but I don't need acquire semantics so that's pointlessly restrictive on arm/risc-v.
2023-09-30 02:15:19 +00:00
Matthias Krüger
4db2b741c8
Rollup merge of #116241 - dtolnay:exclusivefwd, r=Amanieu
Add Exclusive forwarding impls (FnOnce, FnMut, Generator)

This is adapted from #104057.
2023-09-29 22:27:51 +02:00
bors
a6dfd89fa7 Auto merge of #113797 - RalfJung:offset_from_docs, r=workingjubilee
offset_from: docs improvements

This is the part of https://github.com/rust-lang/rust/pull/112837 that doesn't add a new function, just tweaks the existing docs.
2023-09-29 13:53:11 +00:00
bors
b8536c1aa1 Auto merge of #116176 - FedericoStra:isqrt, r=dtolnay
Add "integer square root" method to integer primitive types

For every suffix `N` among `8`, `16`, `32`, `64`, `128` and `size`, this PR adds the methods

```rust
const fn uN::isqrt() -> uN;
const fn iN::isqrt() -> iN;
const fn iN::checked_isqrt() -> Option<iN>;
```

to compute the [integer square root](https://en.wikipedia.org/wiki/Integer_square_root), addressing issue #89273.

The implementation is based on the [base 2 digit-by-digit algorithm](https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Binary_numeral_system_(base_2)) on Wikipedia, which after some benchmarking has proved to be faster than both binary search and Heron's/Newton's method. I haven't had the time to understand and port [this code](http://atoms.alife.co.uk/sqrt/SquareRoot.java) based on lookup tables instead, but I'm not sure whether it's worth complicating such a function this much for relatively little benefit.
2023-09-29 07:35:44 +00:00
Christopher Durham
5facc32e22 fix char imports 2023-09-29 00:04:57 -04:00
Christopher Durham
1efea31385 add str_from_utf16_endian tracking issue 2023-09-28 23:56:27 -04:00
Christopher Durham
3d448bd067 style nits
Co-authored-by: David Tolnay <dtolnay@gmail.com>
2023-09-28 23:56:10 -04:00
CAD97
8047f8fb51 Add feature(str_from_utf16_endian) 2023-09-28 23:54:38 -04:00
David Tolnay
a95f20c9ad
Add Exclusive forwarding impls (FnOnce, FnMut, Generator) 2023-09-28 10:22:19 -07:00
Federico Stra
25648de28f isqrt: disable long running tests in Miri 2023-09-28 17:43:01 +02:00
bors
925f844164 Auto merge of #116230 - matthiaskrgr:rollup-hi1ciwy, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #116191 (Add regression test for rust-lang#56098)
 - #116214 (rustdoc: rename `issue-\d+.rs` tests to have meaningful names)
 - #116221 (core/slice: Fix inconsistency between docs for `rotate_left` and `rotate_right`)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-09-28 15:24:06 +00:00
DaniPopes
58ed8ad0df
Stabilize const_maybe_uninit_assume_init_read 2023-09-28 16:19:33 +02:00
Matthias Krüger
ff958ae3e4
Rollup merge of #116221 - ArchUsr64:patch-1, r=ChrisDenton
core/slice: Fix inconsistency between docs for `rotate_left` and `rotate_right`

A minor fix for documentation inconsistency as shown below:
## Before:
![2023_09_28_0k3_Kleki](https://github.com/rust-lang/rust/assets/83179501/569a49d3-0d72-49ac-92a2-ef5e1d94130b)
## After:
![image](https://github.com/rust-lang/rust/assets/83179501/afd0c8d7-6fb7-4878-801b-b47c8fe23c7d)
Docs url: https://doc.rust-lang.org/stable/core/primitive.slice.html#method.rotate_left
2023-09-28 15:58:44 +02:00
bors
dd91aba2fd Auto merge of #114882 - ChrisDenton:riddle-me, r=dtolnay
Update windows ffi bindings

Bump `windows-bindgen` to version 0.51.1. This brings with it some changes to the generated FFI bindings, but little that affects the code.

One change that does have more of an impact is `SOCKET` being `usize` instead of either `u64` or `u32` (as is used in std's public `SOCKET` type). However, it's now easy enough to abstract over that difference.

Finally I added a few new bindings that are likely to be used in pending PRs, mostly to make sure they're ok with the new metadata.

r? libs
2023-09-28 13:35:36 +00:00
Federico Stra
fcdfd5b0b9 isqrt: assume that isqrt takes half as many bits
https://github.com/rust-lang/rust/issues/89273#issuecomment-970581089
2023-09-28 14:05:10 +02:00
bors
c01d8d238c Auto merge of #114428 - ChaiTRex:master, r=dtolnay
Convert `Into<ExitStatus> for ExitStatusError` to `From<ExitStatusError> for ExitStatus` in `std::process`

Implementing suggestion from https://github.com/rust-lang/rust/issues/84908#issuecomment-912352902:

> I believe the impl on ExitStatusError should be
>
> ```rust
> impl From<ExitStatusError> for ExitStatus
> ```
>
> rather than
>
> ```rust
> impl Into<ExitStatus> for ExitStatusError
> ```
>
> (there is generally never anything implemented as `Into` first, because implementing `From` reflexively provides `Into`)
2023-09-28 11:47:54 +00:00
Federico Stra
77f9eae995 fixup! isqrt: fix stability 2023-09-28 12:32:58 +02:00
Federico Stra
51463175a4 isqrt: cite source and rename variables to match original C code 2023-09-28 12:12:18 +02:00
bors
e2d6aa77ed Auto merge of #98704 - vthib:impl-from-raw-for-childstd-structs, r=dtolnay
Implement From<OwnedFd/Handle> for ChildStdin/out/err object

## Summary

Comments in `library/std/src/process.rs` ( ab08639e59 ) indicates that `ChildStdin`, `ChildStdout`, `ChildStderr` implements some traits that are not actually implemented: `FromRawFd`, `FromRawHandle`, and the `From<OwnedFd>/From<OwnedHandle>` from the io_safety feature.

In this PR I implement `FromRawHandle` and `FromRawFd` for those 3 objects.

## Usecase

I have a usecase where those implementations are basically needed. I want to customize
in the `Command::spawn` API how the pipes for the parent/child communications are created (mainly to strengthen the security attributes on them). I can properly setup the pipes,
and the "child" handles can be provided to `Child::spawn` easily using `Stdio::from_raw_handle`. However, there is no way to generate the `ChildStd*` objects from the raw handle of the created name pipe, which would be very useful to still expose the same API
than in other OS (basically a `spawn(...) -> (Child, ChildStdin, ChildStdout, ChildSterr)`, where on windows this is customized), and to for example use `tokio::ChildStdin::from_std` afterwards.

## Questions

* Are those impls OK to add? I have searched to see if those impls were missing on purpose, or if it was just never implemented because never needed. I haven't found any indication on why they couldn't be added, although the user clearly has to be very careful that the handle provided makes sense (i think, mainly that it is in overlapped mode for windows).
* If this change is ok, adding the impls for the io_safety feature would probably be best, or should it be done in another PR?
* I just copy-pasted the `#[stable(...)]` attributes, but the `since` value has to be updated, I'm not sure to which value.
2023-09-28 09:59:03 +00:00
Federico Stra
c97ab23141 isqrt: fix stability 2023-09-28 11:39:55 +02:00
Federico Stra
17dfb18bd1 fixup! isqrt: initial implementation
Fix C-ism and type inference.
2023-09-28 11:39:17 +02:00
bors
6e09cff6d7 Auto merge of #116222 - matthiaskrgr:rollup-dnag90q, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #112959 (Change the wording in `std::fmt::Write::write_str`)
 - #115535 (format doc-comment code examples in std::process)
 - #115888 (fix a comment about assert_receiver_is_total_eq)
 - #116211 (more clippy complextity fixes )
 - #116213 (Document -Zlink-native-libraries)
 - #116215 (Tweak wording of missing angle backets in qualified path)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-09-28 08:05:39 +00:00
Matthias Krüger
698448c0cd
Rollup merge of #115888 - RalfJung:assert_receiver_is_total_eq, r=dtolnay
fix a comment about assert_receiver_is_total_eq

"a type implements #[deriving]" doesn't make any sense, so I assume they meant "implement `Eq`"? Also the attribute is called `derive`.
2023-09-28 09:14:06 +02:00
Matthias Krüger
0e338d7e23
Rollup merge of #115535 - tshepang:patch-2, r=dtolnay
format doc-comment code examples in std::process
2023-09-28 09:14:05 +02:00
Matthias Krüger
980fba7345
Rollup merge of #112959 - tbu-:pr_fmt_error_wording, r=dtolnay
Change the wording in `std::fmt::Write::write_str`

Refer to the error instead of expanding its name.
2023-09-28 09:14:05 +02:00
David Tolnay
9bdf9e754e
Update stability attribute for child stream From impls 2023-09-28 00:13:02 -07:00
Andre Bogus
702da3b89c stabilize Option::as_(mut_)slice 2023-09-28 08:31:14 +02:00
Anshul
5e26e8c5bd
changed 'rotate' to 'rotating' 2023-09-28 11:58:37 +05:30
bors
46da927abb Auto merge of #114041 - nvzqz:nvzqz/shared_from_array, r=dtolnay
Implement `From<[T; N]>` for `Rc<[T]>` and `Arc<[T]>`

Given that `Box<[T]>` already has this conversion, the shared counterparts should also have it.
2023-09-28 06:16:01 +00:00
David Tolnay
e2f7032408
Fix "unresolved link to std::fmt::Error"
error: unresolved link to `std::fmt::Error`
       --> library/core/src/fmt/mod.rs:115:52
        |
    115 |     /// This function will return an instance of [`std::fmt::Error`] on error.
        |
        |
        = note: `-D rustdoc::broken-intra-doc-links` implied by `-D warnings`
2023-09-27 22:55:34 -07:00
bors
aeaa5c30e5 Auto merge of #111278 - EFanZh:implement-from-array-refs-for-vec, r=dtolnay
Implement `From<{&,&mut} [T; N]>` for `Vec<T>` where `T: Clone`

Currently, if `T` implements `Clone`, we can create a `Vec<T>` from an `&[T]` or an `&mut [T]`, can we also support creating a `Vec<T>` from an `&[T; N]` or an `&mut [T; N]`? Also, do I need to add `#[inline]` to the implementation?

ACP: rust-lang/libs-team#220. [Accepted]

Closes #100880.
2023-09-28 04:26:40 +00:00
Ralf Jung
9b7f9c4328 take more clarifying text from Gankra's PR
original source: https://github.com/rust-lang/rust/pull/95851
2023-09-26 16:41:06 +02:00
Federico Stra
d49da0fe54 isqrt: add more tests 2023-09-26 16:05:51 +02:00
Federico Stra
68f0b475c7 isqrt: remove duplication by delegating to unsigned integers 2023-09-26 15:46:14 +02:00
joboet
559ec69e41
std: broaden the allowed behaviour for recursive TLS initialization 2023-09-26 12:54:01 +02:00
bors
27b4eb96d1 Auto merge of #116125 - RalfJung:const-param-ty-eq, r=compiler-errors
ConstParamTy: require Eq as supertrait

As discussed with `@BoxyUwu` [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/.60ConstParamTy.60.20and.20.60Eq.60).

We want to say that valtree equality on const generic params agrees with `==`, but that only makes sense if `==` actually exists, hence we should have an appropriate bound. Valtree equality is an equivalence relation, so such a type can always be `Eq` and not just `PartialEq`.
2023-09-26 05:33:55 +00:00
bors
a6dce3bac5 Auto merge of #116124 - WaffleLapkin:fix-proc-macro-literal-to-string, r=compiler-errors
Properly print cstr literals in `proc_macro::Literal::to_string`

Previously we printed the contents of the string, rather than the actual string literal (e.g. `the c string` instead of `c"the c string"`).

Fixes #112820
cc #105723
2023-09-26 03:39:25 +00:00
bors
7bf47a4792 Auto merge of #116070 - eduardosm:IoSlice-advance_slices-checked_add, r=Mark-Simulacrum
Avoid overflow in `IoSlice::advance_slices`

Noticed in https://github.com/rust-lang/rust/issues/62726#issuecomment-1713997431.
2023-09-25 18:29:26 +00:00
The 8472
b0412d597e Document that Instant may or may not include system-suspend time 2023-09-25 19:54:26 +02:00
Milo
221d0a661a update other place 2023-09-25 13:55:50 +00:00
Milo
7bda9b1255
clarify documentation about variable substituion 2023-09-25 14:53:38 +01:00
bors
8c04c06317 Auto merge of #116074 - fzs111:clarify-pin-docs, r=Mark-Simulacrum
Clarify example in `Pin::new_unchecked` docs

This example in the docs of `Pin::new_unchecked` puzzled me for a relatively long time. Now I understand that it comes down to the difference between dropping the `Pin` vs dropping the pinned value.

I have extended the explanation to highlight this difference. In my opinion it is clearer now, and I hope it helps others understand `Pin` better.
2023-09-25 03:50:59 +00:00
bors
5105b1ec58 Auto merge of #116057 - RalfJung:io-safety, r=Mark-Simulacrum
fix OS-specific I/O safety docs since the io_safety feature is stable

Looks like this text was forgotten to be updated when `io_safety` got stabilized: it still says "once the io_safety feature is stable".

Also adjust the wording a bit for how these docs relate to the general concept of I/O safety.
2023-09-25 00:17:13 +00:00
Ralf Jung
ad509633a2 ConstParamTy: require Eq 2023-09-24 23:38:07 +02:00
Maybe Waffle
285e574b8e Fix .to_string() of proc_macro::Literal (properly print cstr literals) 2023-09-24 20:05:27 +00:00
bors
c7224e3c95 Auto merge of #105861 - Ayush1325:uefi-std-minimial, r=workingjubilee
Add Minimal Std implementation for UEFI

# Implemented modules:
1. alloc
2. os_str
3. env
4. math

# Related Links
Tracking Issue: https://github.com/rust-lang/rust/issues/100499
API Change Proposal: https://github.com/rust-lang/libs-team/issues/87

# Additional Information
This was originally part of https://github.com/rust-lang/rust/pull/100316. Since that PR was becoming too unwieldy and cluttered, and with suggestion from `@dvdhrm,` I have extracted a minimal std implementation to this PR.

The example in `src/doc/rustc/src/platform-support/unknown-uefi.md` has been tested for `x86_64-unknown-uefi` and `i686-unknown-uefi` in OVMF. It would be great if someone more familiar with AARCH64 can help with testing for that target.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2023-09-24 09:47:30 +00:00
bors
44bd31c216 Auto merge of #116075 - Colonial-Dev:issue-116063-fix, r=Mark-Simulacrum
Document panics on unsigned wrapping_div/rem calls (#116063)

Add missing `# Panics` sections to the `uint_impl!` macro, documenting that the `wrapping_rem/div` calls will panic if passed zero.
2023-09-24 07:59:00 +00:00
bors
8a6bae2824 Auto merge of #115416 - c410-f3r:match_cfg, r=Amanieu
Add the `cfg_match!` macro

# Movitation

Adds a match-like version of the `cfg_if` crate without a RFC [for the same reasons that caused `matches!` to be included in the standard library](https://github.com/rust-lang/rust/pull/65479).

* General-purpose (not domain-specific)
* Simple (the implementation is short) and useful (things can become difficult with several `cfg`s)
* Very popular [on crates.io ](https://crates.io/crates/cfg-if) (currently 3th in all-time downloads)
* The two previous points combined make it number three in [left-pad index](https://twitter.com/bascule/status/1184523027888988160) score

```rust
match_cfg! {
    cfg(unix) => {
        fn foo() { /* unix specific functionality */ }
    }
    cfg(target_pointer_width = "32") => {
        fn foo() { /* non-unix, 32-bit functionality */ }
    }
    _ => {
        fn foo() { /* fallback implementation */ }
    }
}
```

# Considerations

A match-like syntax feels more natural in the sense that each macro fragment resembles an arm but I personally don't mind switching to any other desired syntax.

The lack of `#[ ... ]` is intended to reduce typing, nevertheless, the same reasoning described above can also be applied to this aspect.

Since blocks are intended to only contain items, anything but `cfg` is not expected to be supported at the current or future time.

~~Credits goes to `@gnzlbg` because most of the code was shamelessly copied from https://github.com/gnzlbg/match_cfg.~~
Credits goes to `@alexcrichton` because most of the code was shamelessly copied from https://github.com/rust-lang/cfg-if.
2023-09-24 04:23:43 +00:00
bors
42ca6e4e57 Auto merge of #104385 - BlackHoleFox:apple-minimum-bumps, r=petrochenkov
Raise minimum supported Apple OS versions

This implements the proposal to raise the minimum supported Apple OS versions as laid out in the now-completed MCP (https://github.com/rust-lang/compiler-team/issues/556).

As of this PR, rustc and the stdlib now support these versions as the baseline:
- macOS: 10.12 Sierra
- iOS: 10
- tvOS: 10
- watchOS: 5 (Unchanged)

In addition to everything this breaks indirectly, these changes also erase the `armv7-apple-ios` target (currently tier 3) because the oldest supported iOS device now uses ARMv7s. Not sure what the policy around tier3 target removal is but shimming it is not an option due to the linker refusing.

[Per comment](https://github.com/rust-lang/compiler-team/issues/556#issuecomment-1297175073), this requires a FCP to merge. cc `@wesleywiser.`
2023-09-24 02:35:05 +00:00
BlackHoleFox
3b52befdce Raise minimum supported iOS version to 10.0
Drop the armv7-apple-ios target too because its no longer supported
with the hardware iOS 10 requires.
2023-09-23 19:14:25 -05:00
BlackHoleFox
58bbca958d Raise minimum supported macOS to 10.12 2023-09-23 19:14:25 -05:00
Emil Gardström
74f5261345
implement Literal::byte_character
without this, the only way to create a `LitKind::Byte` is by
doing `"b'a'".parse::<Literal>()`, this solves that by enabling
`Literal::byte_character(b'a')`
2023-09-23 23:29:47 +02:00
Caio
d63959f2fa Add the cfg_match! macro 2023-09-23 14:23:51 -03:00
FZs
0f248d8ea9 Clarify example in Pin::new_unchecked docs 2023-09-23 17:28:43 +02:00
Eduardo Sánchez Muñoz
93863383c8 Avoid overflow in IoSlice::advance_slices 2023-09-23 16:27:57 +02:00
James Haywood
f286a75692 Extend fix to wrapping_div, wrapping_div_euclid and wrapping_rem_euclid 2023-09-22 18:07:17 -04:00
James Haywood
1170b7b447 Resolve rust-lang/rust#116063 2023-09-22 15:52:07 -04:00
Ayush Singh
984ecefed8
Fixes from PR
- Hide Docs
- Use repr_unpacked error

Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2023-09-22 23:56:51 +05:30
Federico Stra
1b34f1c6b2 isqrt: add tests 2023-09-22 16:11:26 +02:00
Federico Stra
3e8676c327 isqrt: initial implementation 2023-09-22 16:11:26 +02:00
Ayush Singh
c7e5f3ca08
Rebase to master
- Update Example
- Add thread_parking to sys::uefi
- Fix unsafe in unsafe errors
- Improve docs
- Improve os/exit
- Some asserts
- Switch back to atomics

Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2023-09-22 17:23:33 +05:30
Ayush Singh
40c3dacc76
Use RawOsError for UEFI
Some changes from this commit will probably be converted to its own PR.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2023-09-22 17:23:33 +05:30
Ayush Singh
7a956441a1
Fixes from PR
- Some comment fixes.
- Make some functions unsafe.
- Make helpers module private.
- Rebase on master
- Update r-efi to v4.2.0

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2023-09-22 17:23:33 +05:30
Ayush Singh
5df24d18b6
Add support for building std::os::uefi docs
Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2023-09-22 17:23:33 +05:30
Ayush Singh
032e3766d5
Handle ExitBootServices
- Make BootServices unavailable if ExitBootServices event is signaled.
- Use thread locals for SystemTable and ImageHandle

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2023-09-22 17:23:33 +05:30
Ayush Singh
8e56b33d59
Fixes from PR
Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2023-09-22 17:23:32 +05:30
Ayush Singh
48c6ae0611
Add Minimal Std implementation for UEFI
Implemented modules:
1. alloc
2. os_str
3. env
4. math

Tracking Issue: https://github.com/rust-lang/rust/issues/100499
API Change Proposal: https://github.com/rust-lang/libs-team/issues/87

This was originally part of https://github.com/rust-lang/rust/pull/100316. Since
that PR was becoming too unwieldy and cluttered, and with suggestion
from @dvdhrm, I have extracted a minimal std implementation to this PR.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2023-09-22 17:23:30 +05:30
Ralf Jung
813fed2904 fix OS-specific I/O safety docs since the io_safety feature is stable 2023-09-22 13:23:19 +02:00
bors
03c199af8e Auto merge of #116054 - matthiaskrgr:rollup-3pusno6, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #114379 (Command: also print removed env vars)
 - #116034 (add UI test for delimiter errors)
 - #116036 (tests/ui: Split large_moves.rs and move to lint/large_assignments)
 - #116038 (Fall back to _SC_NPROCESSORS_ONLN if sched_getaffinity returns an empty mask)
 - #116039 (Account for nested `impl Trait` in TAIT)
 - #116041 (Add note to `is_known_rigid`)
 - #116049 (give FutureIncompatibilityReason variants more explicit names)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-09-22 10:34:45 +00:00
Matthias Krüger
faf13dd112
Rollup merge of #116038 - the8472:panic-on-sched_getaffinity-bug, r=cuviper
Fall back to _SC_NPROCESSORS_ONLN if sched_getaffinity returns an empty mask

Followup to #115946
A gentler fix for #115868, one that doesn't panic, [suggested on zulip](https://rust-lang.zulipchat.com/#narrow/stream/259402-t-libs.2Fmeetings/topic/Meeting.202023-09-19/near/391942927)

In that situation - on the buggy kernel versions - a zero-mask means no affinities have been set so `_SC_NPROCESSORS_ONLN` provides the right value.
2023-09-22 12:15:27 +02:00
Matthias Krüger
9887dfab2c
Rollup merge of #114379 - RalfJung:command-removed-env-vars, r=m-ou-se
Command: also print removed env vars

There is no real shell syntax for unsetting an env var so easily, so we have to make one up. But we already do that for showing the 'program' name so I hope that's okay here, too. No strong opinion on what that should look like, I went with `unset(VAR_NAME)` for now.
2023-09-22 12:15:25 +02:00
bors
5a4e47ebed Auto merge of #114780 - RalfJung:io-safety, r=Amanieu
add more explicit I/O safety documentation

Fixes https://github.com/rust-lang/unsafe-code-guidelines/issues/434
Cc https://github.com/rust-lang/rust/issues/114167
Cc `@Manishearth` `@sunfishcode` `@joshtriplett`
2023-09-22 08:47:51 +00:00
bors
8759de0a49 Auto merge of #114776 - fee1-dead-contrib:enable-effects-in-libcore, r=oli-obk
Enable effects for libcore

~~r? `@oli-obk~~`

forgot you are on vacation, oops
2023-09-22 07:00:52 +00:00
bors
f73d376fb6 Auto merge of #115230 - Vtewari2311:mod-hurd-latest, r=b-naber
added support for GNU/Hurd

adding support for i686-unknown-hurd-gnu
2023-09-21 19:24:01 +00:00
The 8472
31cfa4a956 Fall back to _SC_NPROCESSORS_ONLN if sched_getaffinity returns an empty mask 2023-09-21 20:05:24 +02:00
Samuel Thibault
dcea7709f2 added support for GNU/Hurd 2023-09-21 17:31:25 +02:00
Guillaume Gomez
0d2c603b12
Rollup merge of #116007 - m-ou-se:const-panic-fmt-panic-display, r=oli-obk
Call panic_display directly in const_panic_fmt.

`panic_str` just directly calls `panic_display`. The only reason `panic_str` exists, is for a lint to detect an expansion of `panic_2015!(expr)` (which expands to `panic_str`).

It is `panic_display` that is hooked by const-eval, which is the reason we call it here.

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

r? ``@oli-obk``
2023-09-21 13:25:40 +02:00