Commit Graph

12113 Commits

Author SHA1 Message Date
bors 5bb2094d89 Auto merge of #52936 - felixrabe:patch-1, r=alexcrichton
Document #39364 – Panic in mpsc::Receiver::recv_timeout

I can still reproduce #39364 with the example code at https://github.com/rust-lang/rust/issues/39364#issuecomment-320637702.

I'm opening this PR in an attempt to document this bug as a known issue in [libstd/sync/mpsc/mod.rs](https://github.com/rust-lang/rust/blob/master/src/libstd/sync/mpsc/mod.rs).

Inputs very much welcome. ([Nightly docs for `recv_timeout`.](https://doc.rust-lang.org/nightly/std/sync/mpsc/struct.Receiver.html?search=#method.recv_timeout))
2018-08-14 22:22:18 +00:00
kennytm 11484c6a6a Rollup merge of #53257 - faern:ip-method-idiomatic-improvement, r=TimNN
Idiomatic improvements to IP method

Since match ergonomics and slice patterns are stable this might be more idiomatic modern Rust implementations of these methods? Or well, slice patterns with `..` are not stabilized yet, so maybe we want to specify all fields but with `_`?
2018-08-14 23:59:13 +08:00
kennytm 700c5e89f2 Rollup merge of #53208 - BurntPizza:protect-the-environment, r=alexcrichton
Don't panic on std::env::vars() when env is null.

Fixes #53200.

Reviewer(s):
* Do I need to do any `#[cfg()]` here?
* Is this use of libc ok for a dev-dependency?
2018-08-14 23:59:05 +08:00
Guillaume Gomez f618071c46 Rollup merge of #53273 - frewsxcv:frewsxcv-ufffd, r=GuillaumeGomez
Add links to std::char::REPLACEMENT_CHARACTER from docs.

There are a few places where we mention the replacement character in the
docs, and it could be helpful for users to utilize the constant which is
available in the standard library, so let’s link to it!
2018-08-12 23:27:04 +02:00
Guillaume Gomez 17d4bd0c0b Rollup merge of #53264 - Havvy:patch-3, r=GuillaumeGomez
Show that Command can be reused and remodified

The prior documentation did not make it clear this was possible.

I wanted to make the `list_dir` example work on Windows, but I don't know if passing "/" will error or show the root of the current volume (e.g. `C:`).

r? @GuillaumeGomez
2018-08-12 23:27:01 +02:00
Guillaume Gomez dfb122ecc6 Rollup merge of #53231 - GuillaumeGomez:let-keyword, r=QuietMisdreavus
Add let keyword doc

Part of #34601.

r? @rust-lang/docs
2018-08-12 23:26:57 +02:00
Guillaume Gomez 3e9a1a1b82 Rollup merge of #53230 - memoryruins:nll_bootstrap_4, r=nikomatsakis
[nll] enable feature(nll) on various crates for bootstrap: part 4

#53172

r? @nikomatsakis
2018-08-12 23:26:56 +02:00
Guillaume Gomez d509e31b93 Rollup merge of #53165 - jakllsch:netbsd-ad22a005-b917-47f3-8156-f717d36f6bbe, r=estebank
Add aarch64-unknown-netbsd target

Depends on #53116.
2018-08-12 23:26:52 +02:00
Havvy (Ryan Scheel) 0070b46626 Fix indent 2018-08-11 13:02:49 -07:00
Corey Farwell ec18991492 Add links to std::char::REPLACEMENT_CHARACTER from docs.
There are a few places where we mention the replacement character in the
docs, and it could be helpful for users to utilize the constant which is
available in the standard library, so let’s link to it!
2018-08-11 15:42:35 -04:00
Guillaume Gomez f9f934f7fd Add let keyword doc 2018-08-11 20:06:46 +02:00
Ryan Scheel 53d308fdf8 Show that Command can be reused and remodified
The prior documentation did not make it clear this was possible.
2018-08-11 05:26:12 -07:00
Linus Färnstrand cbe80a9752 Replace _.. with just .. in slice pattern 2018-08-10 23:42:33 +02:00
Linus Färnstrand f0eed1e3ff Make use of match ergonomics in ip methods 2018-08-10 21:06:37 +02:00
Linus Färnstrand 2f1f43fcd4 Use slice patterns to check IP octets 2018-08-10 21:06:36 +02:00
memoryruins e8d95a5ba1 [nll] libstd: enable feature(nll) for bootstrap 2018-08-10 06:27:10 -04:00
bors 8958ed6722 Auto merge of #53216 - kennytm:rollup, r=kennytm
Rollup of 15 pull requests

Successful merges:

 - #52773 (Avoid unnecessary pattern matching against Option and Result)
 - #53082 (Fix doc link (again))
 - #53094 (Automatically expand section if url id point to one of its component)
 - #53106 (atomic ordering docs)
 - #53110 (Account for --remap-path-prefix in save-analysis)
 - #53116 (NetBSD: fix signedess of char)
 - #53179 (Whitelist wasm32 simd128 target feature)
 - #53183 (Suggest comma when missing in macro call)
 - #53207 (Add individual docs for rotate_{left, right})
 - #53211 ([nll] enable feature(nll) on various crates for bootstrap)
 - #53214 ([nll] enable feature(nll) on various crates for bootstrap: part 2)
 - #53215 (Slightly refactor syntax_ext/format)
 - #53217 (inline some short functions)
 - #53219 ([nll] enable feature(nll) on various crates for bootstrap: part 3)
 - #53222 (A few cleanups for rustc_target)
2018-08-09 19:05:14 +00:00
BurntPizza c9aca02320 Don't panic on std::env::vars() when env in null.
Fixes #53200
2018-08-09 12:56:42 -04:00
kennytm 23601d08e6 Rollup merge of #53116 - jakllsch:netbsd-unsigned-char, r=alexcrichton
NetBSD: fix signedess of char
2018-08-09 16:58:44 +08:00
bors fbb6275f4f Auto merge of #53108 - RalfJung:mutex, r=alexcrichton
clarify partially initialized Mutex issues

Using a `sys_common::mutex::Mutex` without calling `init` is dangerous, and yet there are some places that do this. I tried to find all of them and add an appropriate comment about reentrancy.

I found two places where (I think) reentrancy can actually occur, and was not able to come up with an argument for why this is okay. Someone who knows `io::lazy` and/or `sys_common::at_exit_imp` should have a careful look at this.
2018-08-09 07:30:14 +00:00
Ralf Jung 25db84206b missed one 2018-08-08 18:14:06 +02:00
Ralf Jung 31bec788f4 avoid using the word 'initialized' to talk about that non-reentrant-capable state of the mutex 2018-08-08 18:12:33 +02:00
Linus Färnstrand c0041f4a17 Use repr(align(x)) for redox in6_addr 2018-08-08 10:52:10 +02:00
Linus Färnstrand 83464591ed Simplify Ipv6Addr::from(octets) to not use unsafe 2018-08-08 10:52:10 +02:00
Linus Färnstrand d45a703a74 Simplify is_broadcast 2018-08-08 10:52:10 +02:00
Linus Färnstrand 7167a065d1 Add Ipv4Addr BROADCAST assoc const 2018-08-08 10:52:10 +02:00
Linus Färnstrand e9a96c0433 Move IPs to assoc consts 2018-08-08 10:52:10 +02:00
Linus Färnstrand 02c272db2d Make Ipv{4,6}Addr::new const fns 2018-08-08 10:52:10 +02:00
Jonathan A. Kollasch 1dd53f73b2 Add aarch64-unknown-netbsd target 2018-08-07 12:03:42 -05:00
Felix Rabe 025f41f4c0 "Panics" -> "Known Issues"; rm trailing WS 2018-08-07 17:34:34 +02:00
Felix Rabe 6e2051cd08 Less words better than moar words 2018-08-07 16:39:09 +02:00
Felix Rabe c574720d88 Rephrase 2018-08-07 16:38:02 +02:00
Felix Rabe b1f47aa838 Document panic in mpsc::Receiver::recv_timeout 2018-08-07 16:35:03 +02:00
kennytm a5cd4b5607 Rollup merge of #53107 - RalfJung:static-mutex, r=alexcrichton
Remove references to `StaticMutex` which got removed a while ago

`StaticMutex` got removed two years ago with https://github.com/rust-lang/rust/pull/34705, but still got referenced in some comments and even an error explanation.
2018-08-07 16:55:44 +08:00
Jonathan A. Kollasch b011b091cb NetBSD: fix signedess of char 2018-08-06 12:20:10 -05:00
Ralf Jung 645388583c actually, reentrant uninitialized mutex acquisition is outright UB 2018-08-06 14:39:55 +02:00
Ralf Jung ab3e4a2789 argue why at_exit_imp is fine 2018-08-06 13:53:38 +02:00
Ralf Jung 22457deef7 make Lazy::new unsafe and check reentrancy condition in the callers 2018-08-06 13:52:15 +02:00
Ralf Jung 819645bfc4 I think we have to strengthen Mutex::init UB 2018-08-06 13:39:47 +02:00
Ralf Jung d3d31105e9 clarify partially initialized Mutex issues 2018-08-06 12:54:44 +02:00
Ralf Jung a92b5cc916 Remove references to StaticMutex which got removed a while ago 2018-08-06 12:34:00 +02:00
varkor d19832105e Remove bad features after rebase 2018-08-05 15:54:49 +01:00
varkor 319b052357 Fix stage 2 tests 2018-08-05 15:54:49 +01:00
varkor 64185f205d Remove unnecessary or invalid feature attributes 2018-08-05 15:54:48 +01:00
kennytm 43410981ae Rollup merge of #53024 - matklad:patch-1, r=alexcrichton
Specify reentrancy gurantees of `Once::call_once`

I don't think the docs are clear about what happens in the following code

```rust
static INIT: Once = ONCE_INIT;

INIT.call_once(|| INIT.call_once(|| println!("huh?")));
```

[Playground](https://play.rust-lang.org/?gist=15dde1f68a6ede263c7250c36977eade&version=stable&mode=debug&edition=2015)

Let's "specify" the behavior to make it clear that the current behavior (deadlock I think?) is not a strict guarantee.
2018-08-04 14:35:59 +08:00
Aleksey Kladov a2f9aaf7a3 Fix trailnig WS 2018-08-03 16:50:30 +03:00
Aleksey Kladov 94de821002 Specify reentrancy gurantees of Once::call_once 2018-08-03 14:18:06 +03:00
Taylor Cramer 3a93e914eb Remove unnecessary local in await! macro 2018-08-02 13:07:55 -07:00
bors 03da14ba8c Auto merge of #52949 - Mark-Simulacrum:snap, r=alexcrichton
Switch to bootstrapping from 1.29 beta

r? @alexcrichton
2018-08-02 15:34:21 +00:00
bors db5476571d Auto merge of #52847 - upsuper:thread-stack-reserve, r=alexcrichton
Don't commit thread stack on Windows

On Windows, there is a system level resource limitation called commit limit, which is roughly the sum of physical memory + paging files[1]. `CreateThread` by default commits the stack size[2], which unnecessarily takes such resource from the shared limit.

This PR changes it to only reserve the stack size rather than commit it. Reserved memory would only take the address space of the current process until it's actually accessed.

This should make the behavior on Windows match other platforms, and is also a pretty standard practice on Windows nowadays.

[1] https://blogs.technet.microsoft.com/markrussinovich/2008/11/17/pushing-the-limits-of-windows-virtual-memory/
[2] https://docs.microsoft.com/zh-cn/windows/desktop/api/processthreadsapi/nf-processthreadsapi-createthread
2018-08-02 04:22:23 +00:00