about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2020-02-02Strip unnecessary subexpressionFriedrich von Never-1/+0
It became unnecessary since a06baa56b95674fc626b3c3fd680d6a65357fe60 reformatted the file.
2020-02-01stdarch: update submodule.Tyler Lanphear-6/+1
2020-01-31Drop cfg(bootstrap) codeMark Rousskov-23/+1
2020-01-31Rollup merge of #68660 - kubo39:patch-1, r=Dylan-DPCDylan DPC-2/+2
Fix typo.
2020-01-31Remove incorrect debug assertions from catch_unwindTomasz Miąsko-2/+0
Previously the debug assertions in the implementation of catch_unwind used to verify consistency of the panic count by checking that the count is zero just before leaving the function. This incorrectly assumed that no panic was in progress when entering `catch_unwind`.
2020-01-30Auto merge of #68325 - faern:move-numeric-consts-to-associated-consts-step1, ↵bors-0/+1
r=LukasKalbertodt Move numeric consts to associated consts step1 A subset of #67913. Implements the first step of RFC https://github.com/rust-lang/rfcs/pull/2700 This PR adds the new constants as unstable constants and defines the old ones in terms of the new ones. Then fix a tiny bit of code that started having naming collisions because of the new assoc consts. Removed a test that did not seem relevant any longer. Since doing just `u8::MIN` should now indeed be valid.
2020-01-30UpdateHiroki Noda-2/+2
2020-01-30Fix typo.Hiroki Noda-1/+1
2020-01-29Document remaining undocumented `From` implementations for IPsLeSeulArtichaut-0/+72
2020-01-29Rollup merge of #68627 - joshtriplett:write-all-none, r=Dylan-DPCYuki Okushi-0/+2
Document that write_all will not call write if given an empty buffer Some types of Write instances have a semantic meaning associated with writing an empty buffer, such as sending an empty packet. This works when calling `write` directly, and supplying an empty buffer. However, calling `write_all` on an empty buffer will simply never call `write`, because `write_all` assumes it has no work to do. Document this behavior, to help prospective users of datagram-packet-style Write instances.
2020-01-28Document that write_all will not call write if given an empty bufferJosh Triplett-0/+2
Some types of Write instances have a semantic meaning associated with writing an empty buffer, such as sending an empty packet. This works when calling `write` directly, and supplying an empty buffer. However, calling `write_all` on an empty buffer will simply never call `write`, because `write_all` assumes it has no work to do. Document this behavior, to help prospective users of datagram-packet-style Write instances.
2020-01-28Update links to WASI docs in time.rs moduleJakub Konka-2/+2
Since the docs for the WASI API are now evolving in [WebAssembly/WASI] repo, I thought it might be useful to update the links in the docs to point to that location instead of using the outdated `CraneStation/wasmtime` destination. [WebAssembly/WASI]: https://github.com/WebAssembly/WASI
2020-01-28Add capacity to BufReader with same unstable gateAndreas Molzer-0/+26
2020-01-28Auto merge of #68529 - TimDiekmann:rename-alloc, r=Amanieubors-2/+2
Rename `Alloc` to `AllocRef` The allocator-wg has decided to merge this change upstream in https://github.com/rust-lang/wg-allocators/issues/8#issuecomment-577122958. This renames `Alloc` to `AllocRef` because types that implement `Alloc` are a reference, smart pointer, or ZSTs. It is not possible to have an allocator like `MyAlloc([u8; N])`, that owns the memory and also implements `Alloc`, since that would mean, that moving a `Vec<T, MyAlloc>` would need to correct the internal pointer, which is not possible as we don't have move constructors. For further explanation please see https://github.com/rust-lang/wg-allocators/issues/8#issuecomment-489464843 and the comments after that one. Additionally it clarifies the semantics of `Clone` on an allocator. In the case of `AllocRef`, it is clear that the cloned handle still points to the same allocator instance, and that you can free data allocated from one handle with another handle. The initial proposal was to rename `Alloc` to `AllocHandle`, but `Ref` expresses the semantics better than `Handle`. Also, the only appearance of `Handle` in `std` are for windows specific resources, which might be confusing. Blocked on https://github.com/rust-lang/miri/pull/1160
2020-01-27Rename `Alloc` to `AllocRef`Tim Diekmann-2/+2
2020-01-26updatecomet-1/+1
2020-01-26Add a method to query the capacity of a BufWriterAndreas Molzer-0/+19
2020-01-25Rollup merge of #68515 - Wind-River:master_2020, r=alexcrichtonYuki Okushi-5/+39
Support feature process_set_argv0 for VxWorks r? @alexcrichton
2020-01-24Support feature process_set_argv0 for VxWorksBaoshanPang-5/+39
2020-01-24Remove unused ignore-license directivesTomasz Miąsko-4/+0
The tidy check was removed in rust-lang/rust#53617
2020-01-23Unlock assoc_int_consts in core+stdLinus Färnstrand-0/+1
2020-01-21Rollup merge of #68313 - batrla:master, r=alexcrichtonMazdak Farrokhzad-73/+51
Options IP_MULTICAST_TTL and IP_MULTICAST_LOOP are 1 byte on BSD Options IP_MULTICAST_TTL and IP_MULTICAST_LOOP are 1 byte on BSD and Solaris See ip(4P) man page: IP_MULTICAST_TTL Time to live for multicast datagrams. This option takes an unsigned character as an argument. Its value is the TTL that IP uses on outgoing multi- cast datagrams. The default is 1. IP_MULTICAST_LOOP Loopback for multicast datagrams. Normally multi- cast datagrams are delivered to members on the sending host (or sending zone). Setting the unsigned character argument to 0 causes the oppo- site behavior, meaning that when multiple zones are present, the datagrams are delivered to all zones except the sending zone. https://docs.oracle.com/cd/E88353_01/html/E37851/ip-4p.html https://man.openbsd.org/ip.4
2020-01-20Auto merge of #68066 - CAD97:stabilize-manuallydrop-take, ↵bors-1/+0
r=Amanieu,Mark-Simulacrum Stabilize ManuallyDrop::take Tracking issue: closes #55422 FCP merge: https://github.com/rust-lang/rust/issues/55422#issuecomment-572653619 Reclaims the doc improvements from closed #62198. ----- Stable version is a simple change if necessary. Proposal: [relnotes] (this changes how to best take advantage of `ManuallyDrop`, esp. wrt. `Drop::drop` and finalize-by-value members)
2020-01-20refactor fix using cfg_if! (fix build on Solaris)Vita Batrla-0/+1
2020-01-18Rollup merge of #68341 - fusion-engineering-forks:instant-docs, r=Dylan-DPCMazdak Farrokhzad-4/+4
Fix syscalls tables in docs of std::time.
2020-01-18slice_patterns: remove internal uses of gateMazdak Farrokhzad-1/+1
2020-01-18Fix table of syscalls in docs of std::time::SystemTime.Mara Bos-2/+2
2020-01-18Fix table of syscalls in docs of std::time::Instant.Mara Bos-2/+2
2020-01-18refactor fix using cfg_if! (fix build)Vita Batrla-6/+16
2020-01-17refactor fix using cfg_if!Vita Batrla-120/+55
2020-01-17Options IP_MULTICAST_TTL and IP_MULTICAST_LOOP are 1 byte on BSD and SolarisVita Batrla-18/+50
See ip(4P) man page: IP_MULTICAST_TTL Time to live for multicast datagrams. This option takes an unsigned character as an argument. Its value is the TTL that IP uses on outgoing multi- cast datagrams. The default is 1. IP_MULTICAST_LOOP Loopback for multicast datagrams. Normally multi- cast datagrams are delivered to members on the sending host (or sending zone). Setting the unsigned character argument to 0 causes the oppo- site behavior, meaning that when multiple zones are present, the datagrams are delivered to all zones except the sending zone. https://docs.oracle.com/cd/E88353_01/html/E37851/ip-4p.html https://man.openbsd.org/ip.4
2020-01-16Rollup merge of #68033 - ollie27:win_f32, r=dtolnayDylan DPC-57/+13
Don't use f64 shims for f32 cmath functions on non 32-bit x86 MSVC These shims are only needed on 32-bit x86. Additionally since https://reviews.llvm.org/rL268875 LLVM handles adding the shims itself for the intrinsics.
2020-01-16Rollup merge of #68266 - Stromberg90:patch-2, r=Dylan-DPCDylan DPC-4/+4
Changed docs for f32 and f64.
2020-01-16Rollup merge of #68223 - SOF3:float-fract-doc, r=varkorDylan DPC-8/+8
Use 3.6 instead of 3.5 in float fract() documentation It is not self-explanatory whether the fract() function inverts the fractional part of negative numbers. This change clarifies this possible question (so that it is `.6` not `.4`)
2020-01-16Rollup merge of #68096 - varkor:diagnostic-cleanup, r=CentrilDylan DPC-1/+1
Clean up some diagnostics by making them more consistent In general: - Diagnostic should start with a lowercase letter. - Diagnostics should not end with a full stop. - Ellipses contain three dots. - Backticks should encode Rust code. I also reworded a couple of messages to make them read more clearly. It might be sensible to create a style guide for diagnostics, so these informal conventions are written down somewhere, after which we could audit the existing diagnostics. r? @Centril
2020-01-16Update f32.rsStrømberg-1/+1
2020-01-16Update f64.rsStrømberg-2/+2
2020-01-16Update f32.rsStrømberg-1/+1
2020-01-15Use 3.6 instead of 3.5 in float fract() documentationSOFe-8/+8
It is not self-explanatory whether the fract() function inverts the fractional part of negative numbers. Co-Authored-By: Mateusz Mikuła <mati865@users.noreply.github.com>
2020-01-14Auto merge of #67711 - Amanieu:fix_unwind_leak, r=alexcrichtonbors-0/+9
Fix memory leak if C++ catches a Rust panic and discards it If C++ catches a Rust panic using `catch (...)` and then chooses not to rethrow it, the `Box<dyn Any>` in the exception may be leaked. This PR fixes this by adding the necessary destructors to the exception object. r? @Mark-Simulacrum
2020-01-14Auto merge of #67076 - mbrubeck:condvar, r=dtolnaybors-43/+34
Stabilize Condvar::wait_while and wait_timeout_while (previously wait_until, wait_timeout_until) Closes #47960.
2020-01-14Rollup merge of #68150 - tillarnold:master, r=cramertjYuki Okushi-0/+8
Document behavior of set_nonblocking on UnixListener The description on `set_nonblocking` in `UnixListener` was rather brief so I adapted it to be more like the documentation of `set_nonblocking` in `TcpListener`.
2020-01-12Fix system call docs for time::InstantRuud van Asseldonk-1/+1
The link for UNIX was pointing to the Cloud ABI docs. It should have been pointing to the clock_gettime docs instead. The table is repeated in the docs for SystemTime, but there the UNIX entry was already correct.
2020-01-12Don't include __rust_drop_panic when testing libstdAmanieu d'Antras-0/+1
2020-01-12Diagnostics should not end with a full stopvarkor-1/+1
2020-01-12Document behavior of set_nonblocking on UnixListenerTill Arnold-0/+8
2020-01-11Abort if C++ tries to swallow a Rust panicAmanieu d'Antras-0/+8
2020-01-11Rollup merge of #68102 - lzutao:inline, r=alexcrichtonMazdak Farrokhzad-1/+9
Inline some conversion methods around OsStr Diff on the assembly of this snippet before and after this PR: https://www.diffchecker.com/NeGMjaJ2 ```rust use std::env; use std::io; use std::path::{Path, PathBuf}; pub fn cargo_home_with_cwd(cwd: &Path) -> io::Result<PathBuf> { match env::var_os("CARGO_HOME").filter(|h| !h.is_empty()) { Some(home) => { let home = PathBuf::from(home); if home.is_absolute() { Ok(home) } else { Ok(cwd.join(&home)) } } _ => env::home_dir() .map(|p| p.join(".cargo")) .ok_or_else(|| io::Error::new(io::ErrorKind::Other, "could not find cargo home dir")), } } ```
2020-01-11Rollup merge of #67666 - lzutao:ptr-null-cmp, r=dtolnayMazdak Farrokhzad-20/+25
make use of pointer::is_null r? @Mark-Simulacrum
2020-01-10Auto merge of #65241 - tmiasko:no-std-san, r=alexcrichtonbors-10/+0
build-std compatible sanitizer support ### Motivation When using `-Z sanitizer=*` feature it is essential that both user code and standard library is instrumented. Otherwise the utility of sanitizer will be limited, or its use will be impractical like in the case of memory sanitizer. The recently introduced cargo feature build-std makes it possible to rebuild standard library with arbitrary rustc flags. Unfortunately, those changes alone do not make it easy to rebuild standard library with sanitizers, since runtimes are dependencies of std that have to be build in specific environment, generally not available outside rustbuild process. Additionally rebuilding them requires presence of llvm-config and compiler-rt sources. The goal of changes proposed here is to make it possible to avoid rebuilding sanitizer runtimes when rebuilding the std, thus making it possible to instrument standard library for use with sanitizer with simple, although verbose command: ``` env CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS=-Zsanitizer=thread cargo test -Zbuild-std --target x86_64-unknown-linux-gnu ``` ### Implementation * Sanitizer runtimes are no long packed into crates. Instead, libraries build from compiler-rt are used as is, after renaming them into `librusc_rt.*`. * rustc obtains runtimes from target libdir for default sysroot, so that they are not required in custom build sysroots created with build-std. * The runtimes are only linked-in into executables to address issue #64629. (in previous design it was hard to avoid linking runtimes into static libraries produced by rustc as demonstrated by sanitizer-staticlib-link test, which still passes despite changes made in #64780). cc @kennytm, @japaric, @firstyear, @choller