summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2020-03-12return a pointer to the end of the valid part of the sigstack, no furtheriximeow-5/+7
also unmap the whole thing when cleaning up, rather than leaving a spare page floating around.
2020-03-12unix: Set a guard page at the end of signal stacksiximeow-2/+7
This mitigates possible issues when signal stacks overflow, which could manifest as segfaults or in unlucky circumstances possible clobbering of other memory values as stack overflows tend to enable.
2020-03-12Rollup merge of #69792 - LenaWil:try_reserve_error/impl-error, r=sfacklerMazdak Farrokhzad-0/+3
Implement Error for TryReserveError I noticed that the Error trait wasn't implemented for TryReserveError. (#48043) Not sure if the error messages and code style are 100% correct, it's my first time contributing to the Rust std.
2020-03-10Remove deprecated description function of TryReserveErrorLena Wildervanck-5/+1
2020-03-10Rollup merge of #69799 - TimDiekmann:zst, r=AmanieuMazdak Farrokhzad-11/+36
Allow ZSTs in `AllocRef` Allows ZSTs in all `AllocRef` methods. The implementation of `AllocRef` for `Global` and `System` were adjusted to reflect those changes. This is the second item on the roadmap to support ZSTs in `AllocRef`: https://github.com/rust-lang/wg-allocators/issues/38#issuecomment-595861542 After this has landed, I will adapt `RawVec`, but since this will be a pretty big overhaul, it makes sense to do a different PR for it. ~~Requires #69794 to land first~~ r? @Amanieu
2020-03-10Rollup merge of #69514 - GuillaumeGomez:remove-spotlight, r=kinnisonMazdak Farrokhzad-3/+0
Remove spotlight I had a few comments saying that this feature was at best misunderstood or not even used so I decided to organize a poll about on [twitter](https://twitter.com/imperioworld_/status/1232769353503956994). After 87 votes, the result is very clear: it's not useful. Considering the amount of code we have just to run it, I think it's definitely worth it to remove it. r? @kinnison cc @ollie27
2020-03-10builtin_macros: Add attribute macro `#[cfg_accessible(path)]`Vadim Petrochenkov-0/+10
2020-03-09Write backtrace fmt test using relative pathsDavid Tolnay-5/+5
For some reason the absolute paths were formatted differently on the armhf-gnu target. thread '<unnamed>' panicked at 'assertion failed: `(left == right)` left: `"Backtrace [\n { fn: \"__rust_maybe_catch_panic\" },\n { fn: \"std::rt::lang_start_internal\", file: \"./rust/rt.rs\", line: 300 },\n { fn: \"std::rt::lang_start\", file: \"./rust/rt.rs\", line: 400 },\n]"`, right: `"Backtrace [\n { fn: \"__rust_maybe_catch_panic\" },\n { fn: \"std::rt::lang_start_internal\", file: \"/rust/rt.rs\", line: 300 },\n { fn: \"std::rt::lang_start\", file: \"/rust/rt.rs\", line: 400 },\n]"`', src/libstd/backtrace.rs:486:5
2020-03-09Add test of Debug representation of BacktraceDavid Tolnay-0/+52
2020-03-09Make it possible to instantiate hardcoded Backtrace from testDavid Tolnay-3/+28
2020-03-09Change disabled and unsupported backtraces to print using placeholder styleDavid Tolnay-2/+2
2020-03-09Add quotes around filename in Backtrace debugDavid Tolnay-1/+1
2020-03-09Remove quotes around unknown fn placeholder in backtraceDavid Tolnay-1/+1
2020-03-09Use GetSystemTimePreciseAsFileTime if it is availableDan Aloni-1/+5
2020-03-08unix: Don't override existing SIGSEGV/BUS handlersJosh Stone-8/+20
Although `stack_overflow::init` runs very early in the process, even before `main`, there may already be signal handlers installed for things like the address sanitizer. In that case, just leave it alone, and don't bother trying to allocate our own signal stacks either.
2020-03-08Rollup merge of #69777 - lukas-code:patch-1, r=jonas-schievinkMazdak Farrokhzad-1/+1
Add missing ` in doc for File::with_options()
2020-03-08Allow ZSTs in `AllocRef`Tim Diekmann-11/+36
2020-03-07reduce references on match patterns (clippy::match_ref_pats)Matthias Krüger-5/+5
2020-03-07Use writeln!(fmt, "word") instead of write!(fmt, "word\n") ↵Matthias Krüger-1/+1
(clippy::write_with_newline)
2020-03-07Rollup merge of #69773 - matthiaskrgr:typos, r=petrochenkovMazdak Farrokhzad-6/+6
fix various typos
2020-03-07Rollup merge of #69782 - matthiaskrgr:redundant_field_name_rep, r=cramertjMazdak Farrokhzad-10/+7
Don't redundantly repeat field names (clippy::redundant_field_names)
2020-03-07Implement Error for TryReserveErrorLena Wildervanck-0/+7
2020-03-06Don't redundantly repeat field names (clippy::redundant_field_names)Matthias Krüger-10/+7
2020-03-06Fix missing ` in doc for File::with_optionsLukas-1/+1
2020-03-06fix various typosMatthias Krüger-6/+6
2020-03-05Update 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-03-05Rollup merge of #69736 - matthiaskrgr:even_more_clippy, r=Dylan-DPCDylan DPC-2/+2
even more clippy cleanups * Don't pass &mut where immutable reference (&) is sufficient (clippy::unnecessary_mut_passed) * Use more efficient &&str to String conversion (clippy::inefficient_to_string) * Don't always eval arguments inside .expect(), use unwrap_or_else and closure. (clippy::expect_fun_call) * Use righthand '&' instead of lefthand "ref". (clippy::toplevel_ref_arg) * Use simple 'for i in x' loops instead of 'while let Some(i) = x.next()' loops on iterators. (clippy::while_let_on_iterator) * Const items have by default a static lifetime, there's no need to annotate it. (clippy::redundant_static_lifetimes) * Remove redundant patterns when matching ( x @ _ to x) (clippy::redundant_pattern)
2020-03-05Simplify the try intrinsic by using a callback in the catch blockAmanieu d'Antras-13/+52
2020-03-05Const items have by default a static lifetime, there's no need to annotate ↵Matthias Krüger-2/+2
it. (clippy::redundant_static_lifetimes)
2020-03-04Update macros.rs: fix documentation typo.Penelope Phippen-1/+1
2020-03-04Auto merge of #68952 - faern:stabilize-assoc-int-consts, r=dtolnaybors-27/+8
Stabilize assoc_int_consts associated int/float constants The next step in RFC https://github.com/rust-lang/rfcs/pull/2700 (tracking issue #68490). Stabilizing the associated constants that were added in #68325. * Stabilize all constants under the `assoc_int_consts` feature flag. * Update documentation on old constants to say they are soft-deprecated and the new ones should be preferred. * Update documentation examples to use new constants. * Remove `uint_macro` and use `int_macro` for all integer types since the macros were identical anyway. r? @LukasKalbertodt
2020-03-03Rollup merge of #69637 - matthiaskrgr:if_let_some_result, r=ecstatic-morseYuki Okushi-1/+1
Don't convert Results to Options just for matching.
2020-03-03Rollup merge of #69619 - matthiaskrgr:misc, r=eddybYuki Okushi-1/+1
more cleanups * use starts_with() instead of chars().next() == Some(x) * use subsec_micros() instead of subsec_nanos() / 1000 * use for (idx, item) in iter.enumerate() instead of manually counting loop iterations with variables * use values() or keys() respectively when iterating only over keys or values of maps.
2020-03-03Rollup merge of #69609 - TimDiekmann:excess, r=AmanieuYuki Okushi-6/+10
Remove `usable_size` APIs This removes the usable size APIs: - remove `usable_size` (obv) - change return type of allocating methods to include the allocated size - remove `_excess` API r? @Amanieu closes rust-lang/wg-allocators#17
2020-03-03Remove `usable_size` APIsTim Diekmann-6/+10
2020-03-02Don't convert Results to Options just for matching.Matthias Krüger-1/+1
2020-03-02Apply review feedbackAmanieu d'Antras-28/+6
2020-03-02Fix some minor issuesAmanieu d'Antras-2/+2
2020-03-02Mark cleanup coldMark Rousskov-0/+5
2020-03-02Inline catching panics into std::catch_unwindMark Rousskov-26/+44
This allows LLVM to inline the happy path, such that catching unwinding is zero-cost when no panic occurs. This also allows us to match the code generated by C++ try/catch.
2020-03-01use subdsec_micros() instead of subsec_nanos() / 1000Matthias Krüger-1/+1
2020-03-01Rollup merge of #69569 - matthiaskrgr:nonminimal_bool, r=mark-SimulacrumDylan DPC-1/+1
simplify boolean expressions
2020-02-29Rollup merge of #69584 - zantysor:fix-saturating-duration-since-comment, ↵Dylan DPC-1/+1
r=varkor Correct comment to match behavior Corrects the header comment on `saturating_duration_since` to match the behavior of returning 0 if the other timestamp is _later_ than the invocant, not earlier, This is purely a documentation change, so hopefully it doesn't require an issue; if it does, I'll open one and resubmit.
2020-02-29Rollup merge of #69571 - matthiaskrgr:useless_asref, r=CentrilDylan DPC-1/+1
remove unneeded .as_ref() calls.
2020-02-29correct comment to match behaviorZan Tysor-1/+1
2020-02-29simplify boolean expressionsMatthias Krüger-1/+1
2020-02-29Rollup merge of #69551 - matthiaskrgr:len_zero, r=Mark-SimulacrumDylan DPC-1/+1
use is_empty() instead of len() == x to determine if structs are empty.
2020-02-29Rollup merge of #69477 - Pulkit07:issue69298, r=cramertjDylan DPC-0/+9
docs: add mention of async blocks in move keyword docs Fixes #69298
2020-02-29remove unneeded .as_ref() calls.Matthias Krüger-1/+1
2020-02-28Rollup merge of #69481 - matthiaskrgr:single_char, r=ecstatic-morseMazdak Farrokhzad-2/+2
use char instead of &str for single char patterns