about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2018-12-01remove some uses of try!Mark Mansi-3/+3
2018-12-01stabilize std::dbg!(...)Mazdak Farrokhzad-10/+2
2018-11-30Deal with EINTR in net timeout testsJosh Stone-12/+28
We've seen sporadic QE failures in the timeout tests on this assertion: assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut); So there's an error, but not either of the expected kinds. Adding a format to show the kind revealed `ErrorKind::Interrupted` (`EINTR`). For the cases that were using `read`, we can just use `read_exact` to keep trying after interruption. For those using `recv_from`, we have to manually loop until we get a non-interrupted result.
2018-12-01Rollup merge of #56324 - Zoxc:int-ext, r=nikomatsakiskennytm-0/+11
Use raw_entry for more efficient interning Fixes https://github.com/rust-lang/rust/issues/56308#issuecomment-442492744
2018-12-01Rollup merge of #55011 - vi:panic_immediate_abort, r=alexcrichtonkennytm-2/+20
Add libstd Cargo feature "panic_immediate_abort" It stop asserts and panics from libstd to automatically include string output and formatting code. Use case: developing static executables smaller than 50 kilobytes, where usual formatting code is excessive while keeping debuggability in debug mode. May resolve #54981.
2018-11-30Inline thingsJohn Kåre Alsaker-0/+11
2018-11-29TypoNathan West-1/+1
2018-11-29Removed unnecessary buf subscriptNathan West-4/+5
2018-11-29Defactored Bytes::readNathan West-13/+9
Removed unneeded refactoring of read_one_byte, which removed the unneeded dynamic dispatch (`dyn Read`) used by that function.
2018-11-30Fix exceeding line width limitVitaly _Vi Shukela-1/+2
2018-11-30panic_immediate_abort: Fix issues from reviewVitaly _Vi Shukela-5/+6
2018-11-30Add libstd and libcore Cargo features "panic_immediate_abort"Vitaly _Vi Shukela-2/+18
It stop asserts and panics from libstd to automatically include string output and formatting code. Use case: developing static executables smaller than 50 kilobytes, where usual formatting code is excessive while keeping debuggability in debug mode. May resolve #54981.
2018-11-29Auto merge of #49878 - dlrobertson:va_list_pt0, r=eddybbors-0/+8
libcore: Add VaList and variadic arg handling intrinsics ## Summary - Add intrinsics for `va_start`, `va_end`, `va_copy`, and `va_arg`. - Add `core::va_list::VaList` to `libcore`. Part 1 of (at least) 3 for #44930 Comments and critiques are very much welcomed 😄
2018-11-29Rollup merge of #56319 - RalfJung:async-mutable-ref, r=cramertjGuillaume Gomez-2/+2
fix futures creating aliasing mutable and shared ref Fixes the problem described in https://github.com/solson/miri/issues/532#issuecomment-442552764: `set_task_waker` takes a shared reference and puts a copy into the TLS (in a `NonNull`), but `get_task_waker` gets it back out as a mutable reference. That violates "mutable references must not alias anything"!
2018-11-29Rollup merge of #56294 - polyfloyd:fix-typo-ffi-doc, r=sfacklerGuillaume Gomez-2/+2
Fix a typo in the documentation of std::ffi
2018-11-29Rollup merge of #56289 - marius:patch-1, r=cramertjGuillaume Gomez-1/+1
Fix small typo in comment of thread::stack_size
2018-11-29Rollup merge of #56149 - ariasuni:improve-amctime-doc, r=TimNNGuillaume Gomez-12/+24
Make std::os::unix/linux::fs::MetadataExt::a/m/ctime* documentation clearer I was confused by this API so I clarified what they are doing. I was wondering if I should try to unify more documentation and examples between `unix` and `linux` (e.g. “of the file” is used in `unix` to refer to the file these metadata is for, “of this file” in `linux`, “of the underlying file” in `std::fs::File`).
2018-11-29Rollup merge of #56124 - antoine-de:fix_read_to_end_doc_mistake, r=TimNNGuillaume Gomez-1/+1
Fix small doc mistake on std::io::read::read_to_end The std::io::read main documentation can lead to error because the buffer is prefilled with 10 zeros that will pad the response. Using an empty vector is better. The `read_to_end` documentation is already correct though. This is my first rust PR, don't hesitate to tell me if I did something wrong.
2018-11-28fix futures aliasing mutable and shared refRalf Jung-2/+2
2018-11-28get_ref -> get_mutRalf Jung-8/+8
2018-11-28fix buildRalf Jung-5/+13
2018-11-28put the MaybeUninit inside the UnsafeCellRalf Jung-10/+7
2018-11-27Fix a typo in the documentation of std::ffipolyfloyd-2/+2
2018-11-27Fix small typo in commentMarius Nuennerich-1/+1
2018-11-27add comments explaining our uses of get_ref/get_mut for MaybeUninitRalf Jung-0/+3
2018-11-27add missing featureRalf Jung-0/+1
2018-11-27fix buildRalf Jung-1/+1
2018-11-27use MaybeUninit instead of mem::uninitialized for Windows MutexRalf Jung-9/+9
2018-11-26libcore: Add va_list lang item and intrinsicsDan Robertson-0/+8
- Add the llvm intrinsics used to manipulate a va_list. - Add the va_list lang item in order to allow implementing VaList in libcore.
2018-11-25Auto merge of #55527 - sgeisler:time-checked-add, r=sfacklerbors-22/+78
Implement checked_add_duration for SystemTime [Original discussion on the rust user forum](https://users.rust-lang.org/t/std-systemtime-misses-a-checked-add-function/21785) Since `SystemTime` is opaque there is no way to check if the result of an addition will be in bounds. That makes the `Add<Duration>` trait completely unusable with untrusted data. This is a big problem because adding a `Duration` to `UNIX_EPOCH` is the standard way of constructing a `SystemTime` from a unix timestamp. This PR implements `checked_add_duration(&self, &Duration) -> Option<SystemTime>` for `std::time::SystemTime` and as a prerequisite also for all platform specific time structs. This also led to the refactoring of many `add_duration(&self, &Duration) -> SystemTime` functions to avoid redundancy (they now unwrap the result of `checked_add_duration`). Some basic unit tests for the newly introduced function were added too. I wasn't sure which stabilization attribute to add to the newly introduced function, so I just chose `#[stable(feature = "time_checked_add", since = "1.32.0")]` for now to make it compile. Please let me know how I should change it or if I violated any other conventions. P.S.: I could only test on Linux so far, so I don't necessarily expect it to compile for all platforms.
2018-11-25Rollup merge of #56151 - alexcrichton:move-out-flaky-test, r=nagisaPietro Albini-36/+0
Move a flaky process test out of libstd This test ensures that everything in `env::vars()` is inherited but that's not actually true because other tests may add env vars after we spawn the process, causing the test to be flaky! This commit moves the test to a run-pass test where it can execute in isolation. Along the way this removes a lot of the platform specificity of the test, using iteslf to print the environment instead of a foreign process.
2018-11-25Rollup merge of #56101 - frewsxcv:frewsxcv-dyn, r=steveklabnikPietro Albini-2/+2
Incorporate `dyn` into more comments and docs. r? @rust-lang/docs
2018-11-23Merge branch 'master' into frewsxcv-dynCorey Farwell-22/+20
2018-11-23make park/unpark example more realisticRalf Jung-4/+15
2018-11-22Fix the tracking issue for hash_raw_entrySteven Fackler-38/+38
It used to point to the implementation PR.
2018-11-22expand thread::park explanationRalf Jung-1/+6
2018-11-22Rollup merge of #55784 - meltinglava:master, r=KodrAusGuillaume Gomez-8/+8
Clarifying documentation for collections::hash_map::Entry::or_insert Previous version does not show that or_insert does not insert the passed value, as the passed value was the same value as what was already in the map.
2018-11-21Move a flaky process test out of libstdAlex Crichton-36/+0
This test ensures that everything in `env::vars()` is inherited but that's not actually true because other tests may add env vars after we spawn the process, causing the test to be flaky! This commit moves the test to a run-pass test where it can execute in isolation. Along the way this removes a lot of the platform specificity of the test, using iteslf to print the environment instead of a foreign process.
2018-11-22Make std::os::unix/linux::fs::MetadataExt::a/m/ctime* documentation clearerariasuni-12/+24
2018-11-21OsStr: clarify `len()` method documentationLyndon Brown-6/+11
2018-11-21OsString: mention storage form in discussionLyndon Brown-0/+7
Helps users to understand capacity related values, which may surpise on Windows. Also is a step towards clarifying understanding of `OsStr`'s len() return value.
2018-11-21Remove trailing whitespaceBastian Gruber-1/+1
2018-11-21Adjust doc commentsBastian Gruber-21/+10
2018-11-21update various stdlib docsSteve Klabnik-11/+9
2018-11-21fix small doc mistakeantoine-de-1/+1
The std::io::read main documentation can lead to error because the buffer is prefilled with 10 zeros that will pad the response. Using an empty vector is better. The `read_to_end` documentation is already correct though. This is my first rust PR, don't hesitate to tell me if I did something wrong.
2018-11-21Update style of commentsBastian Gruber-14/+26
2018-11-21Update commentsBastian Gruber-4/+2
2018-11-21Remove 'unsafe' commentsBastian Gruber-3/+0
2018-11-21Document `From` implementationsBastian Gruber-0/+24
2018-11-20fix more linksSteve Klabnik-5/+5