Commit graph

878 commits

Author SHA1 Message Date
Eric Arellano
d2de69da2e Dogfood 'str_split_once()` in the std lib 2020-12-07 14:24:05 -07:00
bors
ddafcc0b66 Auto merge of #79650 - the8472:fix-take, r=dtolnay
Fix incorrect io::Take's limit resulting from io::copy specialization

The specialization introduced in #75272 fails to update `io::Take` wrappers after performing the copy syscalls which bypass those wrappers. The buffer flushing before the copy does update them correctly, but the bytes copied after the initial flush weren't subtracted.

The fix is to subtract the bytes copied from each `Take` in the chain of wrappers, even when an error occurs during the syscall loop. To do so the `CopyResult` enum now has to carry the bytes copied so far in the error case.
2020-12-06 01:15:37 +00:00
bors
a5fbaed6c3 Auto merge of #79673 - ijackson:intoinnerintoinnererror, r=m-ou-se
Provide IntoInnerError::into_parts

Hi.  This is an updated version of the IntoInnerError bits of my previous portmanteau MR #78689.  Thanks to `@jyn514` and `@m-ou-se` for helpful comments there.

I have made this insta-stable since it seems like it will probably be uncontroversial, but that is definitely something that someone from the libs API team should be aware of and explicitly consider.

I included a tangentially-related commit providing documentation of the buffer full behaviiour of `&mut [u8] as Write`; the behaviour I am documenting is relied on by the doctest for `into_parts`.
2020-12-04 22:30:19 +00:00
Ian Jackson
b777552167 IntoInnerError: Provide into_error
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-12-04 18:43:02 +00:00
Ian Jackson
19c7619dcd IntoInnerError: Provide into_parts
In particular, IntoIneerError only currently provides .error() which
returns a reference, not an owned value.  This is not helpful and
means that a caller of BufWriter::into_inner cannot acquire an owned
io::Error which seems quite wrong.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-12-04 18:43:02 +00:00
Ian Jackson
db5d697004 std: impl of Write for &mut [u8]: document the buffer full error
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-12-04 18:38:44 +00:00
Tim Diekmann
9274b37d99 Rename AllocRef to Allocator and (de)alloc to (de)allocate 2020-12-04 14:47:15 +01:00
Dylan DPC
88f0c72dc6
Rollup merge of #79611 - poliorcetics:use-std-in-docs, r=jyn514
Use more std:: instead of core:: in docs for consistency

``@rustbot`` label T-doc

Some cleanup work to use `std::` instead of `core::` in docs as much as possible. This helps with terminology and consistency, especially for newcomers from other languages that have often heard of `std` to describe the standard library but not of `core`.

Edit: I also added more intra doc links when I saw the opportunity.
2020-12-04 03:30:27 +01:00
Dylan DPC
6b42900e40
Rollup merge of #79602 - jethrogb:sgx-fix-79038, r=Mark-Simulacrum
Fix SGX CI

Broken in #79038
2020-12-04 03:30:25 +01:00
Guillaume Gomez
50eb3a89f8 Only deny doc_keyword in std and set it as "allow" by default 2020-12-03 16:48:17 +01:00
The8472
a9b1381b8d fix copy specialization not updating Take wrappers 2020-12-03 00:02:01 +01:00
The8472
9b390e73db update test to check Take limits after copying 2020-12-02 23:34:59 +01:00
bors
af69066aa6 Auto merge of #69864 - LinkTed:master, r=Amanieu
unix: Extend UnixStream and UnixDatagram to send and receive file descriptors

Add the functions `recv_vectored_fds` and `send_vectored_fds` to `UnixDatagram` and `UnixStream`. With this functions `UnixDatagram` and `UnixStream` can send and receive file descriptors, by using `recvmsg` and `sendmsg` system call.
2020-12-02 17:36:29 +00:00
Alexis Bourget
4eb76fcc8e Use more std:: instead of core:: in docs for consistency, add more intra doc links 2020-12-02 00:41:53 +01:00
Guillaume Gomez
9e26fc60b1
Rollup merge of #79600 - nicokoch:kernel_copy_unixstream, r=m-ou-se
std::io: Use sendfile for UnixStream

`UnixStream` was forgotten in #75272 .

Benchmark yields the following results.
Before:
`running 1 test
test sys::unix::kernel_copy::tests::bench_file_to_uds_copy        ... bench:      54,399 ns/iter (+/- 6,817) = 2409 MB/s`

After:
`running 1 test
test sys::unix::kernel_copy::tests::bench_file_to_uds_copy        ... bench:      18,627 ns/iter (+/- 6,007) = 7036 MB/s`
2020-12-01 23:46:13 +01:00
Jethro Beekman
b787d723fc Fix SGX CI
Broken in #79038
2020-12-01 18:15:00 +01:00
Nicolas Koch
59874516fa Leverage kernel copy for UnixStream
UDS can be a sendfile destination, just like TCP sockets.
2020-12-01 14:45:36 +01:00
Nicolas Koch
eda4c63fdc Add benchmark for File to UnixStream copy 2020-12-01 14:44:40 +01:00
Mara Bos
2404409c6c
Rollup merge of #79444 - sasurau4:test/move-const-ip, r=matklad
Move const ip in ui test to unit test

Helps with #76268

r? ``@matklad``
2020-12-01 10:50:15 +00:00
Christiaan Dirkx
be554c4101 Make ui test that are run-pass and do not test the compiler itself library tests 2020-11-30 02:47:32 +01:00
Jonas Schievink
13375864ed
Rollup merge of #79383 - abdnh:patch-1, r=shepmaster
Fix bold code formatting in keyword docs
2020-11-28 15:58:21 +01:00
Jonas Schievink
772b1a6d79
Rollup merge of #78086 - poliorcetics:as-placeholder, r=Mark-Simulacrum
Improve doc for 'as _'

Fix #78042.

`@rustbot` modify labels: A-coercions T-doc
2020-11-28 15:58:13 +01:00
LinkTed
8983752c12 Add comment for the previous android bug fix 2020-11-26 18:54:13 +01:00
Daiki Ihara
d4ee2f6dc5 Move const ip in ui test to unit test 2020-11-26 23:15:32 +09:00
bors
ec039bd075 Auto merge of #79336 - camelid:rename-feature-oibit-to-auto, r=oli-obk
Rename `optin_builtin_traits` to `auto_traits`

They were originally called "opt-in, built-in traits" (OIBITs), but
people realized that the name was too confusing and a mouthful, and so
they were renamed to just "auto traits". The feature flag's name wasn't
updated, though, so that's what this PR does.

There are some other spots in the compiler that still refer to OIBITs,
but I don't think changing those now is worth it since they are internal
and not particularly relevant to this PR.

Also see <https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/opt-in.2C.20built-in.20traits.20(auto.20traits).20feature.20name>.

r? `@oli-obk` (feel free to re-assign if you're not the right reviewer for this)
2020-11-25 07:25:19 +00:00
abdo
38cc998da0 Fix bold code formatting in keyword docs 2020-11-25 01:05:46 +03:00
LinkTed
9b9dd4aeea Bug fix for android platform, because of the wrong behavior of CMSG_NXTHDR 2020-11-24 22:15:04 +01:00
Jonas Schievink
ed5d539c62
Rollup merge of #79351 - Takashiidobe:keyword-docs-typo, r=m-ou-se
Fix typo in `keyword` docs for traits

This PR fixes a small typo in the `keyword_docs.rs` file, describing the differences between the 2015 and 2018 editions of traits.
2020-11-24 13:17:43 +01:00
bors
4167d731dc Auto merge of #78953 - mzohreva:mz/from_raw_fd, r=Mark-Simulacrum
Add Metadata in std::os::fortanix_sgx::io::FromRawFd

Needed for https://github.com/fortanix/rust-sgx/pull/291

cc `@jethrogb`
2020-11-24 03:12:20 +00:00
Camelid
810324d1f3 Rename optin_builtin_traits to auto_traits
They were originally called "opt-in, built-in traits" (OIBITs), but
people realized that the name was too confusing and a mouthful, and so
they were renamed to just "auto traits". The feature flag's name wasn't
updated, though, so that's what this PR does.

There are some other spots in the compiler that still refer to OIBITs,
but I don't think changing those now is worth it since they are internal
and not particularly relevant to this PR.

Also see <https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/opt-in.2C.20built-in.20traits.20(auto.20traits).20feature.20name>.
2020-11-23 14:14:06 -08:00
bors
d9a105fdd4 Auto merge of #78439 - lzutao:rm-clouldabi, r=Mark-Simulacrum
Drop support for all cloudabi targets

`cloudabi` is a tier-3 target, and [it is no longer being maintained upstream][no].

This PR drops supports for cloudabi targets. Those targets are:
* aarch64-unknown-cloudabi
* armv7-unknown-cloudabi
* i686-unknown-cloudabi
* x86_64-unknown-cloudabi

Since this drops supports for a target, I'd like somebody to tag `relnotes` label to this PR.

Some other issues:
* The tidy exception for `cloudabi` crate is still remained because
  * `parking_lot v0.9.0` and `parking_lot v0.10.2` depends on `cloudabi v0.0.3`.
  * `parking_lot v0.11.0` depends on `cloudabi v0.1.0`.

[no]: https://github.com/NuxiNL/cloudabi#note-this-project-is-unmaintained
2020-11-23 19:01:19 +00:00
takashiidobe
c5c3d7bdf4 Fix typo in keyword docs for traits 2020-11-23 10:51:30 -05:00
Alexis Bourget
e31e627238 Add doc for 'as _' about '_' and its possibilities and problems 2020-11-23 09:18:13 +01:00
bors
1823a87986 Auto merge of #76226 - CDirkx:const-ipaddr, r=dtolnay
Stabilize `IpAddr::is_ipv4` and `is_ipv6` as const

Insta-stabilize the methods `is_ipv4` and `is_ipv6` of `std::net::IpAddr` as const, in the same way as [PR#76198](https://github.com/rust-lang/rust/pull/76198).

Possible because of the recent stabilization of const control flow.

Part of #76225 and #76205.
2020-11-23 04:47:25 +00:00
bors
f32459c7ba Auto merge of #79172 - a1phyr:cold_abort, r=Mark-Simulacrum
Add #[cold] attribute to `std::process::abort` and `alloc::alloc::handle_alloc_error`
2020-11-23 02:25:13 +00:00
Christiaan Dirkx
4613bc96a4 Bump version to 1.50.0 2020-11-23 01:40:26 +01:00
Christiaan Dirkx
3f8fdf83ff Stabilize IpAddr::is_ipv4 and is_ipv6 as const
Insta-stabilize the methods `is_ipv4` and `is_ipv6` of `IpAddr`.

Possible because of the recent stabilization of const control flow.

Also adds a test for these methods in a const context.
2020-11-23 01:33:46 +01:00
bors
32da90b431 Auto merge of #79319 - m-ou-se:rollup-d9n5viq, r=m-ou-se
Rollup of 10 pull requests

Successful merges:

 - #76941 (Add f{32,64}::is_subnormal)
 - #77697 (Split each iterator adapter and source into individual modules)
 - #78305 (Stabilize alloc::Layout const functions)
 - #78608 (Stabilize refcell_take)
 - #78793 (Clean up `StructuralEq` docs)
 - #79267 (BTreeMap: address namespace conflicts)
 - #79293 (Add test for eval order for a+=b)
 - #79295 (BTreeMap: fix minor testing mistakes in #78903)
 - #79297 (BTreeMap: swap the names of NodeRef::new and Root::new_leaf)
 - #79299 (Stabilise `then`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2020-11-22 23:59:48 +00:00
Lzu Tao
6bfe27a3e0 Drop support for cloudabi targets 2020-11-22 17:11:41 -05:00
Mara Bos
41c033b2f7
Rollup merge of #79299 - varkor:stabilise-then, r=m-ou-se
Stabilise `then`

Stabilises the lazy variant of https://github.com/rust-lang/rust/issues/64260 now that the FCP [has ended](https://github.com/rust-lang/rust/issues/64260#issuecomment-731636203).

I've kept the original feature gate `bool_to_option` for the strict variant (`then_some`), and created a new insta-stable feature gate `lazy_bool_to_option` for `then`.
2020-11-22 23:01:08 +01:00
bors
a0d664bae6 Auto merge of #79219 - shepmaster:beta-bump, r=Mark-Simulacrum
Bump bootstrap compiler version

r? `@Mark-Simulacrum`

/cc `@pietroalbini`
2020-11-22 21:38:03 +00:00
ThinkChaos
5c6689baff Stabilize refcell_take 2020-11-22 20:13:31 +01:00
varkor
cf32afcf48 Stabilise then 2020-11-22 13:45:14 +00:00
bors
5d5ff84130 Auto merge of #77872 - Xaeroxe:stabilize-clamp, r=scottmcm
Stabilize clamp

Tracking issue: https://github.com/rust-lang/rust/issues/44095

Clamp has been merged and unstable for about a year and a half now. How do we feel about stabilizing this?
2020-11-22 10:50:04 +00:00
bors
3adedb8f4c Auto merge of #79237 - alexcrichton:update-backtrace, r=Mark-Simulacrum
std: Update the bactrace crate submodule

This commit updates the `library/backtrace` submodule which primarily
pulls in support for split-debuginfo on macOS, avoiding the need for
`dsymutil` to get run to get line numbers and filenames in backtraces.
2020-11-21 18:05:07 +00:00
bors
502c477b34 Auto merge of #79003 - petrochenkov:innertest, r=estebank
rustc_expand: Mark inner `#![test]` attributes as soft-unstable

Custom inner attributes are feature gated (https://github.com/rust-lang/rust/issues/54726) except for attributes having name `test` literally, which are not gated for historical reasons.

`#![test]` is an inner proc macro attribute, so it has all the issues described in https://github.com/rust-lang/rust/issues/54726 too.
This PR gates it with the `soft_unstable` lint.
2020-11-21 05:52:16 +00:00
Alex Crichton
f99410bb4b std: Update the backtrace crate submodule
This commit updates the `library/backtrace` submodule which primarily
pulls in support for split-debuginfo on macOS, avoiding the need for
`dsymutil` to get run to get line numbers and filenames in backtraces.
2020-11-20 11:56:07 -08:00
Jacob Kiesel
fb6ceac46b We missed 1.49.0, so bump version to 1.50.0 2020-11-20 10:37:22 -07:00
Vadim Petrochenkov
993bb072ff rustc_expand: Mark inner #![test] attributes as soft-unstable 2020-11-20 19:35:03 +03:00
bors
c9c57fadc4 Auto merge of #79205 - rust-lang:jdm-patch-1, r=m-ou-se
Extend meta parameters to all generated code in compat_fn.

Fixes https://github.com/rust-lang/rust/issues/79203. This addresses a regression from 7e2032390c for UWP targets.
2020-11-20 13:42:44 +00:00