Commit graph

358 commits

Author SHA1 Message Date
Mark Rousskov
a06baa56b9 Format the world 2019-12-22 17:42:47 -05:00
Ross MacArthur
f7256d28d1
Require issue = "none" over issue = "0" in unstable attributes 2019-12-21 13:16:18 +02:00
David Tolnay
4436c9d354
Format libstd with rustfmt
This commit applies rustfmt with rust-lang/rust's default settings to
files in src/libstd *that are not involved in any currently open PR* to
minimize merge conflicts. THe list of files involved in open PRs was
determined by querying GitHub's GraphQL API with this script:
https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8

With the list of files from the script in outstanding_files, the
relevant commands were:

    $ find src/libstd -name '*.rs' \
        | xargs rustfmt --edition=2018 --unstable-features --skip-children
    $ rg libstd outstanding_files | xargs git checkout --

Repeating this process several months apart should get us coverage of
most of the rest of libstd.

To confirm no funny business:

    $ git checkout $THIS_COMMIT^
    $ git show --pretty= --name-only $THIS_COMMIT \
        | xargs rustfmt --edition=2018 --unstable-features --skip-children
    $ git diff $THIS_COMMIT  # there should be no difference
2019-11-29 18:43:27 -08:00
Yuki Okushi
de401900b4
Rollup merge of #66146 - 3442853561:patch-2, r=Mark-Simulacrum
Remove unused parameters in `__thread_local_inner`

Fixes #65993.
2019-11-07 09:20:45 +09:00
Pyry Kontio
8568204f4e Try with crate::error::Error 2019-11-07 01:45:46 +09:00
3442853561
936349c81b
Update local.rs
Removed parameters not used in the macro
2019-11-06 16:39:48 +08:00
Pyry Kontio
4317263a31 Fix the Error linking. 2019-11-06 16:59:53 +09:00
Pyry Kontio
f1bc4ef170 Addressed review comments. 2019-11-06 14:48:23 +09:00
Pyry Kontio
002c1c74d9 Improve std:🧵:Result documentation 2019-11-05 19:23:12 +09:00
Mateusz Mikuła
bedbf3bacb Apply clippy::single_match suggestion 2019-10-22 19:23:10 +02:00
Tyler Mandry
ae2a720e92
Rollup merge of #64765 - alexcrichton:less-check-backtrace, r=sfackler
std: Reduce checks for `feature = "backtrace"`

This is a stylistic change to libstd to reduce the number of checks of
`feature = "backtrace"` now that we unconditionally depend on the
`backtrace` crate and rely on it having an empty implementation.
otherwise.
2019-10-05 21:54:51 -07:00
Alex Crichton
1d06058a77 std: Reduce checks for feature = "backtrace"
This is a stylistic change to libstd to reduce the number of checks of
`feature = "backtrace"` now that we unconditionally depend on the
`backtrace` crate and rely on it having an empty implementation.
otherwise.
2019-09-25 06:43:49 -07:00
Tomas Tauber
68c3739f12
updated the panic message wording 2019-09-16 12:13:02 +08:00
Tomas Tauber
df7789c902 Made a thread local storage panic message more explanatory
(TLS is usually understood as Transport Layer Security
outside rust-std internals)
2019-09-15 13:35:02 +08:00
bors
f6ecdc2f61 Auto merge of #61491 - stjepang:impls-for-accesserror, r=dtolnay
Add a few trait impls for AccessError
2019-08-05 15:30:40 +00:00
Stjepan Glavina
d2c9c12546 Add #[stable] to Error impl 2019-08-04 15:11:08 +02:00
Vadim Petrochenkov
42a317a1cd Remove run-pass test suites 2019-07-27 18:56:17 +03:00
Stjepan Glavina
d6c3196d02 Add a few trait impls for AccessError 2019-06-20 09:30:45 +02:00
bors
3c805ce183 Auto merge of #60341 - mtak-:macos-tlv-workaround, r=alexcrichton
macos tlv workaround

fixes: #60141

Includes:
* remove dead code: `requires_move_before_drop`. This hasn't been needed for a while now (oops I should have removed it in #57655)
* redox had a copy of `fast::Key` (not sure why?). That has been removed.
* Perform a `read_volatile` on OSX to reduce `tlv_get_addr` calls per `__getit` from (4-2 depending on context) to 1.

`tlv_get_addr` is relatively expensive (~1.5ns on my machine).

Previously, in contexts where `__getit` was inlined, 4 calls to `tlv_get_addr` were performed per lookup. For some reason when `__getit` is not inlined this is reduced to 2x - and performance improves to match.

After this PR, I have only ever seen 1x call to `tlv_get_addr` per `__getit`, and macos now benefits from situations where `__getit` is inlined.

I'm not sure if the `read_volatile(&&__KEY)` trick is working around an LLVM bug, or a rustc bug, or neither.

r? @alexcrichton
2019-06-20 02:36:49 +00:00
tyler
2c3796172b fix wasm unused import in thread local implementation 2019-05-15 14:35:24 -07:00
tyler
9289d03c9d llvm makes good inlining choices with only the #[cold] attribute 2019-05-15 07:30:34 -07:00
tyler
2b3642b95b remove trailing whitespace 2019-05-15 07:30:34 -07:00
tyler
c3241d0ba0 cold was necessary on try_initialize_nodrop to get more straight line asm 2019-05-15 07:30:34 -07:00
tyler
1a7f774914 - remove unnecessary inlines
- add comment explaining that the fast::Key data structure was carefully constructed for fast access on OSX
- remove inline(never) from the initializer for types where `needs_drop::<T>()` is false
2019-05-15 07:30:34 -07:00
tyler
060d8bb6b0 add #[allow(unused)] 2019-05-15 07:30:34 -07:00
tyler
dfe51a7249 restructure thread_local! for better codegen (especially on macos) 2019-05-15 07:30:33 -07:00
tyler
7acfb99adc Revert "ensure fast thread local lookups occur once per access on macos"
This reverts commit d252f3b77f3b7d4cd59620588f9d026633c05816.
2019-05-15 07:30:33 -07:00
tyler
430a091cd8 ensure fast thread local lookups occur once per access on macos 2019-05-15 07:30:33 -07:00
tyler
48e3da6d59 remove dead code: requires_move_before_drop 2019-05-15 07:30:33 -07:00
Taiki Endo
ccb9dac5ed Fix intra-doc link resolution failure on re-exporting libstd 2019-05-04 23:48:57 +09:00
Aleksey Kladov
be69785ea2
Use more realistic example for thread builder
Stack size of 10 **bytes** does not make any sense: the minimal possible stack size is greater anyway.
2019-04-18 14:58:38 +03:00
CrLF0710
6635fbed4c Eliminate FnBox usages from libstd. 2019-04-10 09:40:44 +08:00
Mazdak Farrokhzad
379c380a60 libstd: deny(elided_lifetimes_in_paths) 2019-03-31 12:56:51 +02:00
Josh Stone
a2c4562690
Rollup merge of #59460 - xfix:include-id-in-thread-debug, r=Amanieu
Include id in Thread's Debug implementation

Since Rust 1.19.0, `id` is a stable method, so there is no reason to not include it in Debug implementation.
2019-03-27 18:15:44 -07:00
Konrad Borowski
ba21e0b368 Include id in Thread's Debug implementation
Since Rust 1.19.0, id is a stable method, so there is no reason to
not include it in Debug implementation.
2019-03-27 12:28:17 +01:00
bors
54479c624c Auto merge of #59136 - jethrogb:jb/sgx-std-test, r=sanxiyn
SGX target: fix std unit tests

This fixes some tests and some code in the SGX sys implementation to make the `std` unit test suite pass.

#59009 must be merged first.
2019-03-26 01:48:34 +00:00
Jethro Beekman
f229422cc1 SGX target: fix std unit tests 2019-03-25 11:31:19 -07:00
Simon Sapin
c1d9191fa5 Add a test for size_of Option<ThreadId> 2019-03-20 19:04:38 +01:00
Simon Sapin
8cf720bd19 Make Option<ThreadId> no larger than ThreadId, with NonZeroU64 2019-03-19 14:00:13 +01:00
benaryorg
2293d2260a
race condition in thread local storage example
The example had a potential race condition that would still pass the test.
If the thread which was supposed to modify it's own thread local was slower than the instruction to
modify in the main thread, then the test would pass even in case of a failure.
This is would be minor if the child thread was waited for since it check using an `assert_eq` for
the same thing, but vice versa.
However, if the `assert_eq` failed this would trigger a panic, which is not at all caught by the
example since the thread is not waited on.

Signed-off-by: benaryorg <binary@benary.org>
2019-03-03 20:53:50 +01:00
Mark Rousskov
2870015b7b Bootstrap compiler update for 1.35 release 2019-03-02 09:05:34 -07:00
Taiki Endo
93b6d9e086 libstd => 2018 2019-02-28 04:06:15 +09:00
bors
b244f61b77 Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnik
Cosmetic improvements to doc comments

This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase).

r? @steveklabnik

Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-12 19:09:24 +00:00
Oliver Scherer
d3c212c552 Require a list of features to allow in allow_internal_unstable 2019-02-11 15:08:16 +01:00
Alexander Regueiro
b87363e763 tests: doc comments 2019-02-10 23:42:32 +00:00
Jethro Beekman
2ec0e85305 Print a slightly clearer message when failing to spawn a thread 2019-01-22 18:55:12 +05:30
tyler
1a51bb8174 OSX: fix #57534 registering thread dtors while running thread dtors 2019-01-15 20:09:06 -08:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
bors
3a75e80557 Auto merge of #56157 - RalfJung:park, r=nagisa
expand thread::park explanation

Cc @carllerche @parched @stjepang
2018-12-10 12:19:47 +00:00
Alexander Regueiro
ee89c088b0 Various minor/cosmetic improvements to code 2018-12-07 23:53:34 +00:00