summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2020-03-09Update deprecation version to 1.42 for Error::descriptionDylan Nugent-1/+1
Error::description is deprecated as of version 1.42, as the commit was not in the release for 1.41.
2020-01-26updatecomet-1/+1
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-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
2020-01-10inline `impl From<String> for Box<dyn Error + Send + Sync>`Lzu Tao-0/+2
2020-01-10inline `impl AsRef<Path> for PathBuf`Lzu Tao-0/+1
2020-01-10inline `impl AsRef<OsStr> for OsString`Lzu Tao-0/+1
2020-01-10Inline `impl From<OsString> for PathBuf`Lzu Tao-0/+1
2020-01-10Inline `AsRef<Path> for str`Lzu Tao-0/+1
2020-01-10Inline PathBuf::deref to make it zero costLzu Tao-1/+1
2020-01-10Inline to make OsStr::is_empty zero costLzu Tao-0/+2
2020-01-10make use of pointer::is_nullLzu Tao-20/+25
2020-01-10Rollup merge of #67358 - cuviper:get_or_insert_owned, r=LukasKalbertodtYuki Okushi-0/+32
Add HashSet::get_or_insert_owned This is an extension for tracking issue #60896. The more-general `get_or_insert_with` has potential for misuse, so we might remove it, but I think `get_or_insert_owned` covers most use cases.
2020-01-09stabalize ManuallyDrop::takeCAD97-1/+0
2020-01-09Remove sanitizer runtime cratesTomasz Miąsko-10/+0
2020-01-08Add HashSet::get_or_insert_ownedJosh Stone-0/+32
2020-01-09Rollup merge of #67966 - popzxc:core-std-matches, r=CentrilMazdak Farrokhzad-34/+8
Use matches macro in libcore and libstd This PR replaces matches like ```rust match var { value => true, _ => false, } ``` with use of `matches!` macro. r? @Centril
2020-01-08Don't use f64 shims for f32 cmath functions on none 32-bit x86 MSVCOliver Middleton-57/+13
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-09Rollup merge of #67985 - dtolnay:cstr, r=Mark-SimulacrumYuki Okushi-10/+0
Remove insignificant notes from CStr documentation The to_str and to_string_lossy methods contain a note about the behavior possibly changing in the future. But those notes are referring to a distinction that is not observable in the API. Whether or not the UTF-8 check knows the string length ahead of time, these methods require linear time.
2020-01-09Rollup merge of #67977 - Wind-River:master_2020, r=alexcrichtonYuki Okushi-66/+2
Updates for VxWorks r? @alexcrichton