about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2019-07-26Rollup merge of #62862 - BaoshanPang:cleanup, r=alexcrichtonMazdak Farrokhzad-1042/+1
code cleanup remove all codes that are not used by vxWorks
2019-07-26add repr(transparent) to IoSliceMut where missingNiv Kaminer-0/+3
2019-07-26std: Add more accessors for `Metadata` on WindowsAlex Crichton-16/+69
This commit adds accessors for more fields in `fs::Metadata` on Windows which weren't previously exposed. There's two sources of `fs::Metadata` on Windows currently, one from `DirEntry` and one from a file itself. These two sources of information don't actually have the same set of fields exposed in their stat information, however. To handle this the platform-specific accessors of Windows-specific information all return `Option` to return `None` in the case a metadata comes from a `DirEntry`, but they're guaranteed to return `Some` if it comes from a file itself. This is motivated by some changes in CraneStation/wasi-common#42, and I'm curious how others feel about this platform-specific functionality!
2019-07-26Introduce built-in macros through libcoreVadim Petrochenkov-539/+105
2019-07-26Auto merge of #60260 - videolabs:rust_uwp2, r=alexcrichtonbors-112/+385
Add support for UWP targets Hi, This pull request aims at adding support for UWP (Universal Windows Apps) platform. A few notes: - This requires a very recent mingw-w64 version (containing this commit and the previous related ones: https://github.com/mirror/mingw-w64/commit/e8c433c871687a78408ae9b40ab7776577db908d#diff-eefdfbfe9cec5f4ebab88c9a64d423a9) - This was tested using LLVM/clang rather than gcc, and so far it assumes that LLVM/clang will be the native compiler. This is mostly due to the fact that the support for exceptions/stack unwinding for UWP got much more attention in libunwind - The "uwp" part of the target needs support for it in the `cc-rs` & `backtrace-rs` crates. I'll create the MR there right after I submit this one and will link everything together, but I'm not sure what's the correct way of dealing with external dependencies in the context of rust - Enabling import libraries and copying them across stages requires a change in cargo, for which I'll open a MR right after I submit this one as well - The i686 stack unwinding is unsupported for now, because LLVM assumes SjLj, while rust seems to assume SEH will be used. I'm unsure how to fix this Also, this is my first encounter with rust, so please bear with my code, it might not feel so idiomatic or even correct :) I'm pretty sure there's a way of doing things in a cleaner way when it comes to win/c.rs, maybe having a UWP & desktop specific modules, and import those conditionally? It doesn't feel right to sprinkle `#[cfg(...)]` all over the place Off course, I'll gladly update anything you see fit (to the extent of my abilities/knowledge :) )! Thanks,
2019-07-25Auto merge of #62990 - Centril:rollup-k9n0hvs, r=Centrilbors-51/+74
Rollup of 15 pull requests Successful merges: - #60066 (Stabilize the type_name intrinsic in core::any) - #60938 (rustdoc: make #[doc(include)] relative to the containing file) - #61884 (Stablize Euclidean Modulo (feature euclidean_division)) - #61890 (Fix some sanity checks) - #62528 (Add joining slices of slices with a slice separator, not just a single item) - #62707 (Add tests for overlapping explicitly dropped locals in generators) - #62735 (Turn `#[global_allocator]` into a regular attribute macro) - #62822 (Improve some pointer-related documentation) - #62887 (Make the parser TokenStream more resilient after mismatched delimiter recovery) - #62921 (Add method disambiguation help for trait implementation) - #62930 (Add test for #51559) - #62942 (Use match ergonomics in Condvar documentation) - #62977 (Fix inconsistent highlight blocks.) - #62978 (Remove `cfg(bootstrap)` code for array implementations) - #62981 (Add note suggesting to borrow a String argument to find) Failed merges: - #62964 (clarify and unify some type test names) r? @ghost
2019-07-25Rollup merge of #62942 - KevinWMatthews:condvar_docs_match_ergo, r=sfacklerMazdak Farrokhzad-18/+18
Use match ergonomics in Condvar documentation Documentation was written before match ergonomics was merged. See #62857. In short, replaces ```rust let &(ref lock, ref cvar) = &*pair; ``` with ```rust let (lock, cvar) = &*pair ``` in the docs of `std::sync::Condvar`.
2019-07-25Rollup merge of #62822 - RalfJung:pointers, r=CentrilMazdak Farrokhzad-9/+20
Improve some pointer-related documentation
2019-07-25Rollup merge of #61884 - crlf0710:stablize_euc, r=dtolnay,CentrilMazdak Farrokhzad-8/+4
Stablize Euclidean Modulo (feature euclidean_division) Closes #49048
2019-07-25Rollup merge of #60938 - jonas-schievink:doc-include-paths, r=petrochenkovMazdak Farrokhzad-16/+32
rustdoc: make #[doc(include)] relative to the containing file This matches the behavior of other in-source paths like `#[path]` and the `include_X!` macros. Fixes https://github.com/rust-lang/rust/pull/58373#issuecomment-462349380 Also addresses https://github.com/rust-lang/rust/issues/44732#issuecomment-467660239 cc #44732 This is still missing a stdsimd change (https://github.com/jonas-schievink/stdsimd/commit/42ed30e0b5fb5e2d11765b5d1e1f36234af85984), so CI will currently fail. I'll land that change once I get initial feedback for this PR.
2019-07-25std: win: Disable stack overflow handling on UWPHugo Beauzée-Luyssen-29/+45
The required functions are not available, so hope for the best
2019-07-25std: win: Don't use console APIs on UWPHugo Beauzée-Luyssen-26/+119
2019-07-25std: win: Don't use GetFileInformationByHandle on UWPHugo Beauzée-Luyssen-19/+76
2019-07-25std: win: Don't use GetUserProfileDirectoryW on UWPHugo Beauzée-Luyssen-13/+26
2019-07-25std: win: Don't expose link() on UWPHugo Beauzée-Luyssen-4/+11
Or rather expose it, but always return an error
2019-07-25std: win: Don't use SetHandleInformation on UWPHugo Beauzée-Luyssen-19/+61
Attempt to create sockets with the WSA_FLAG_NO_HANDLE_INHERIT flag, and handle the potential error gracefully (as the flag isn't support on Windows 7 before SP1)
2019-07-25std: rand: Use BCrypt on UWPHugo Beauzée-Luyssen-2/+43
As Rtl* functions are not allowed there
2019-07-25std: Link UWP with allowed libraries onlyHugo Beauzée-Luyssen-0/+2
2019-07-25libstd: windows: compat: Allow use of attributesHugo Beauzée-Luyssen-0/+2
2019-07-25Auto merge of #60340 - mgeier:cap-vs-capacity, r=alexcrichtonbors-7/+7
Rename .cap() methods to .capacity() As mentioned in #60316, there are a few `.cap()` methods, which seem out-of-place because such methods are called `.capacity()` in the rest of the code. This PR renames them to `.capacity()` but leaves `RawVec::cap()` in there for backwards compatibility. I didn't try to mark the old version as "deprecated", because I guess this would cause too much noise.
2019-07-25std: Use native `#[thread_local]` TLS on wasmAlex Crichton-134/+56
This commit moves `thread_local!` on WebAssembly targets to using the `#[thread_local]` attribute in LLVM. This was recently implemented upstream and is [in the process of being documented][dox]. This change only takes affect if modules are compiled with `+atomics` which is currently unstable and a pretty esoteric method of compiling wasm artifacts. This "new power" of the wasm toolchain means that the old `wasm-bindgen-threads` feature of the standard library can be removed since it should now be possible to create a fully functioning threaded wasm module without intrusively dealing with libstd symbols or intrinsics. Yay! [dox]: https://github.com/WebAssembly/tool-conventions/pull/116
2019-07-25Rollup merge of #62814 - androm3da:hexagon_19jul_2019, r=alexcrichtonMazdak Farrokhzad-1/+65
add support for hexagon-unknown-linux-musl
2019-07-24Use match ergonomics in Condvar documentationKevin W Matthews-18/+18
2019-07-23Use raw pointers in std::sys::cloudabi when passing MaybeUninit valuesNathan-6/+6
2019-07-23Cleanup std::sys::cloudabiNathan-19/+19
2019-07-23word things more like we usually doRalf Jung-2/+2
2019-07-23Apply suggestions from code reviewRalf Jung-3/+6
Co-Authored-By: gnzlbg <gnzlbg@users.noreply.github.com>
2019-07-23stage0 -> bootstrapJonas Schievink-32/+32
2019-07-23Make #[doc(include)] paths behave like other pathsJonas Schievink-16/+32
This makes them relative to the containing file instead of the crate root
2019-07-23Modify CloudABI ReentrantMutex to use MaybeUninitNathan-14/+18
Remove uses of mem::uninitialized, which is now deprecated
2019-07-22Remove uses of mem::uninitialized in std::sys::cloudabiNathan-16/+31
Usages still appear in cloudabi tests and in the reentrant mutex implementation
2019-07-22add support for hexagon-unknown-linux-muslBrian Cain-1/+65
2019-07-22account for non-drop-glue typesRalf Jung-2/+3
2019-07-22Rollup merge of #62845 - RalfJung:read, r=rkruppeMazdak Farrokhzad-2/+2
read: fix doc comment No idea how that happened...
2019-07-22Rollup merge of #62787 - Indy2222:master, r=Mark-SimulacrumMazdak Farrokhzad-2/+2
Fix typo in src/libstd/net/udp.rs doc comment Affect is usually used as a verb, effect as a verb.
2019-07-22Rollup merge of #62746 - RalfJung:deprecated, r=KodrAusMazdak Farrokhzad-16/+14
do not use assume_init in std::io Cc https://github.com/rust-lang/rust/issues/62397
2019-07-22Rollup merge of #62709 - nhynes:test-maplike-fromiter, r=cuviperMazdak Farrokhzad-2/+6
Test that maplike FromIter satisfies uniqueness This PR adds a simple assertion to the `HashMap` and `HashSet` tests to ensure that uniqueness is satisfied when `FromIter`ing. This is useful for people who want to test their custom type against the Map/Set interfaces since they'll copy the tests wholesale but possibly miss this bug (where _they_ = _me_).
2019-07-22weasle, weasleRalf Jung-3/+3
2019-07-21code cleanupBaoshan Pang-1042/+1
2019-07-21read: fix doc commentRalf Jung-2/+2
2019-07-21apply feedbackRalf Jung-4/+6
2019-07-21sync with nomicon: raw ptr must be non-dangling and aligned every time it is ↵Ralf Jung-2/+2
dereferenced
2019-07-20references must be aligned; also move up the warning that fn ptrs must be ↵Ralf Jung-7/+8
non-NULL
2019-07-20warn that raw pointers must be aligned when used, and that writes cause dropRalf Jung-2/+6
2019-07-19ONCE_INIT is deprecated-in-future only for bootstrapRalf Jung-2/+3
2019-07-19do not use mem::uninitialized in std::ioRalf Jung-14/+11
2019-07-19warn about deprecated-in-future in most of libstdRalf Jung-3/+3
2019-07-18Fix typo in src/libstd/net/udp.rs doc commentMartin Indra-2/+2
Affect is usually used as a verb, effect as a verb.
2019-07-18Rollup merge of #62732 - nathanwhit:fix_mem_uninit, r=AmanieuMark Rousskov-4/+9
Remove last use of mem::uninitialized from std::io::util Addresses #62397 for std::io::util
2019-07-18Fix clippy::len_zero warningsMateusz Mikuła-3/+3