104153 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
84ef88975b
Rollup merge of #66570 - lzutao:stabilize-result-map_or, r=Dylan-DPC
stabilize Result::map_or

r? @SimonSapin
Closes #66293
2019-12-16 05:23:30 +01:00
Mazdak Farrokhzad
c34ea91a9d
Rollup merge of #65778 - bdonlan:stable_weak_count, r=dtolnay
Stabilize `std::{rc,sync}::Weak::{weak_count, strong_count}`

* Original PR: #56696
* Tracking issue: #57977

Closes: #57977

Supporting comments:

> Although these were added for testing, it is occasionally useful to have a way to probe optimistically for whether a weak pointer has become dangling, without actually taking the overhead of manipulating atomics. Are there any plans to stabilize this?

_Originally posted by @bdonlan in https://github.com/rust-lang/rust/issues/57977#issuecomment-516970921_

> Having this stabilized would help. Currently, the only way to check if a weak pointer has become dangling is to call `upgrade`, which is by far expensive.

_Originally posted by @glebpom in https://github.com/rust-lang/rust/issues/57977#issuecomment-526934709_

Not sure if stabilizing these warrants a full RFC, so throwing this out here as a start for now.

Note: per CONTRIBUTING.md, I ran the tidy checks, but they seem to be failing on unchanged files (primarily in `src/stdsimd`).
2019-12-16 05:23:26 +01:00
Guillaume Gomez
5f68732b04 Fix JS error when loading page with search 2019-12-15 21:27:25 +01:00
Robin Kruppe
6ad0b55597 Remove now-redundant range check on u128 -> f32 casts
This code was added to avoid UB in LLVM 6 and earlier, but we no longer support those LLVM versions.
Since https://reviews.llvm.org/D47807 (released in LLVM 7), uitofp does exactly what we need.

Closes #51872
2019-12-15 18:17:00 +01:00
Mazdak Farrokhzad
2d96f2097f cleanup with push_fake_read 2019-12-15 16:11:01 +01:00
Elichai Turkel
a9d6889e4d
Replace prints in fmt docs with asserts 2019-12-15 16:53:26 +02:00
Mazdak Farrokhzad
8a5969d2e9 Fix repetition in matches/mod.rs 2019-12-15 15:40:47 +01:00
Mazdak Farrokhzad
5d73af2d4c make transparent enums more ordinary 2019-12-15 15:11:34 +01:00
Lzu Tao
7bf55f4aa5 use Self alias in place of macros 2019-12-15 13:55:10 +00:00
Lzu Tao
3594d8b8a1 make htons const fn 2019-12-15 13:41:32 +00:00
Mazdak Farrokhzad
66bb978ab6 improve hir::PatKind::Slice docs 2019-12-15 13:16:29 +01:00
Mazdak Farrokhzad
d848ce0ddf document check_pat_slice 2019-12-15 13:16:01 +01:00
Mazdak Farrokhzad
f2d6413eb2 comment -> doc comment 2019-12-15 13:13:52 +01:00
lcnr/Bastian Kauschke
e28153e7a6 fix doc comment 2019-12-15 12:59:02 +01:00
SOFe
6176051dd0
Set tracking issue for str_strip 2019-12-15 17:07:57 +08:00
bors
a605441e04 Auto merge of #67310 - Centril:rollup-22jiyow, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #67255 (Remove i686-unknown-dragonfly target)
 - #67267 (Fix signature of `__wasilibc_find_relpath`)
 - #67282 (Fix example code of OpenOptions::open)
 - #67289 (Do not ICE on unnamed future)
 - #67300 (Restore original implementation of Vec::retain)
 - #67305 (Doc typo)

Failed merges:

r? @ghost
2019-12-15 07:17:06 +00:00
Mazdak Farrokhzad
e5c34411f9
Rollup merge of #67305 - kappa:patch-1, r=jonas-schievink
Doc typo
2019-12-15 05:57:28 +01:00
Mazdak Farrokhzad
64f83915de
Rollup merge of #67300 - aloucks:issue-65970, r=rkruppe
Restore original implementation of Vec::retain

This PR reverts #48065, which aimed to optimize `Vec::retain` by making use of `Vec::drain_filter`. Unfortunately at that time, `drain_filter` was unsound.

The soundness hole in `Vec::drain_filter` was fixed in #61224 by guaranteeing that cleanup logic runs via a nested `Drop`, even in the event of a panic. Implementing this nested drop affects codegen (apparently?) and results in slower code.

Fixes #65970
2019-12-15 05:57:27 +01:00
Mazdak Farrokhzad
8e2689c42e
Rollup merge of #67289 - estebank:unnamed-closure, r=Centril
Do not ICE on unnamed future

Fix #67252.
2019-12-15 05:57:25 +01:00
Mazdak Farrokhzad
541dc62d64
Rollup merge of #67282 - pjw91:patch-1, r=Dylan-DPC
Fix example code of OpenOptions::open

The example didn't set the access mode flag, which resulted in an `Err(InvalidInput)`.

r? @steveklabnik
2019-12-15 05:57:24 +01:00
Mazdak Farrokhzad
39c5d8199a
Rollup merge of #67267 - alexcrichton:update-wasi-libc, r=Dylan-DPC
Fix signature of `__wasilibc_find_relpath`

Looks like this function changed upstream, so it needs to be adjusted
for when used by libstd.
2019-12-15 05:57:22 +01:00
Mazdak Farrokhzad
009585ab29
Rollup merge of #67255 - tuxillo:remove-i686-unknown-dragonfly, r=alexcrichton
Remove i686-unknown-dragonfly target

DragonFly BSD removed support for i386 a while ago. It only supports x86_64 right now.
2019-12-15 05:57:21 +01:00
David Tolnay
9778e03665
Bump Weak::strong_count/weak_count stabilizations from 1.40 to 1.41 2019-12-14 19:26:25 -08:00
David Tolnay
2514cd555b
Delete flaky test net::tcp::tests::fast_rebind 2019-12-14 18:44:09 -08:00
bors
fc6b5d6efe Auto merge of #67216 - ecstatic-morse:const-loop, r=oli-obk
Enable `loop` and `while` in constants behind a feature flag

This PR is an initial implementation of #52000. It adds a `const_loop` feature gate, which allows `while` and `loop` expressions through both HIR and MIR const-checkers if enabled. `for` expressions remain forbidden by the HIR const-checker, since they desugar to a call to `IntoIterator::into_iter`, which will be rejected anyways.

`while` loops also require [`#![feature(const_if_match)]`](https://github.com/rust-lang/rust/pull/66507), since they have a conditional built into them. The diagnostics from the HIR const checker will suggest this to the user.

r? @oli-obk
cc @rust-lang/wg-const-eval
2019-12-15 01:28:28 +00:00
Alex Kapranoff
d0008baebd
Doc typo 2019-12-14 17:12:40 -08:00
Esteban Küber
e08944fdaf Do not ICE on unnamed future 2019-12-14 14:50:32 -08:00
bors
6f829840f7 Auto merge of #67224 - nikomatsakis:revert-stabilization-of-never-type, r=centril
Revert stabilization of never type

Fixes https://github.com/rust-lang/rust/issues/66757

I decided to keep the separate `never-type-fallback` feature gate, but tried to otherwise revert https://github.com/rust-lang/rust/pull/65355. Seemed pretty clean.

( cc @Centril, author of #65355, you may want to check this over briefly )
2019-12-14 22:02:59 +00:00
Niko Matsakis
775076ff4d update reference 2019-12-14 15:41:36 -05:00
Niko Matsakis
96d18ac479 update clippy to the rustc-pr-67224 branch
Actually to commit <69f99e74ac2266dff4b5adc7c59b35236f0abef1>.
2019-12-14 15:22:24 -05:00
Aaron Loucks
7ea6c46a6d Restore original implementation of Vec::retain
This PR reverts #48065, which aimed to optimize `Vec::retain` by
making use of `Vec::drain_filter`. Unfortunately at that time,
`drain_filter` was unsound.

The soundness hole in `Vec::drain_filter` was fixed in #61224 by
guaranteeing that cleanup logic runs via a nested `Drop`, even in
the event of a panic. Implementing this nested drop affects codegen
(apparently?) and results in slower code.

Fixes #65970
2019-12-14 12:38:45 -05:00
Niko Matsakis
b217587f04 [WIP] fix tests after rebase 2019-12-14 09:01:23 -05:00
Niko Matsakis
405eefe467 add #![feature(never_type)] to tests as needed 2019-12-14 09:01:18 -05:00
Niko Matsakis
dc49b2cdfd Add regression test for #66757 2019-12-14 09:01:13 -05:00
Niko Matsakis
d286113024 Revert "Stabilize the never_type, written !."
This reverts commit 15c30ddd69d6cc3fffe6d304c6dc968a5ed046f1.
2019-12-14 09:01:09 -05:00
Niko Matsakis
1719337d02 Revert "Remove #![feature(never_type)] from tests."
This reverts commit 8f6197f39f7d468dfc5b2bd41dae4769992a2f83.
2019-12-14 09:01:04 -05:00
Niko Matsakis
ca8154861e Revert "Redefine core::convert::Infallible as !."
This reverts commit 089229a1935fa9795cfdefa518c8f8c3beb66db8.
2019-12-14 09:00:49 -05:00
bors
c8ea4ace92 Auto merge of #67136 - oli-obk:const_stability, r=Centril
Require stable/unstable annotations for the constness of all stable fns with a const modifier

r? @RalfJung @Centril

Every `#[stable]` const fn now needs either a `#[rustc_const_unstable]` attribute or a `#[rustc_const_stable]` attribute. You can't silently stabilize the constness of a function anymore.
2019-12-14 10:21:32 +00:00
Ohad Ravid
8a4632dec6 Indicate origin of where type parameter for uninferred types 2019-12-14 11:10:21 +01:00
bors
12307b3b08 Auto merge of #67084 - Pagten:feature/print-msg-from-elf-entrypoint, r=Amanieu
SGX: Change ELF entrypoint

This fixes [rust-sgx issue #148](https://github.com/fortanix/rust-sgx/issues/148).

A new entry point is created for the ELF file generated by `rustc`, separate from the enclave entry point. When the ELF file is executed as a Linux binary, the error message below is written to stderr.

> Error: This file is an SGX enclave which cannot be executed as a standard Linux binary.
> See the installation guide at https://edp.fortanix.com/docs/installation/guide/ on how to use 'cargo run' or follow the steps at https://edp.fortanix.com/docs/tasks/deployment/ for manual deployment.

When the ELF file is converted to an SGXS using `elf2sgxs`, the old entry point is still set as the enclave entry point. In a future pull request in the rust-sgx repository, `elf2sgxs` will be modified to remove the code in the ELF entry point, since this code is not needed in the enclave.
2019-12-14 04:08:50 +00:00
bors
8843b28e64 Auto merge of #65951 - estebank:type-inference-error, r=nikomatsakis
Point at method call when type annotations are needed

- Point at method call instead of whole expression when type annotations are needed.
- Suggest use of turbofish on function and methods.

Fix #49391, fix #46333, fix #48089. CC #58517, #63502, #63082.

Fixes https://github.com/rust-lang/rust/issues/40015

r? @nikomatsakis
2019-12-13 22:56:27 +00:00
Josh Stone
6c7c512020 Fix the configure.py TOML field for a couple LLVM options
The actual fields in `config.toml.example` have dashes, not underscores.
2019-12-13 14:00:47 -08:00
Mateusz Mikuła
2d8d8136fa Update tokio crates to latest versions 2019-12-13 20:51:31 +01:00
bors
ff15e96708 Auto merge of #67284 - Centril:rollup-ghiukob, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #67026 (Improve diagnostics and code for exhaustiveness of empty matches)
 - #67235 (VecDeque: drop remaining items on destructor panic)
 - #67254 (dont ICE in case of invalid drop fn)
 - #67256 (Reduce allocs for validation errors)
 - #67274 (be explicit that mem::uninitialized is the same as MaybeUninit::uninit().assume_init())
 - #67278 (`coerce_inner`: use initial `expected_ty`)
 - #67280 (docs: std::convert::From: Fix typo)

Failed merges:

r? @ghost
2019-12-13 19:39:20 +00:00
Mazdak Farrokhzad
d0cc289ec0
Rollup merge of #67280 - shalzz:patch-1, r=jonas-schievink
docs: std::convert::From: Fix typo

Fix a minor typo
2019-12-13 20:35:37 +01:00
Mazdak Farrokhzad
0f30462efa
Rollup merge of #67278 - Centril:67273, r=oli-obk
`coerce_inner`: use initial `expected_ty`

Fixes #67273.
Follow-up to #59439.

r? @oli-obk
2019-12-13 20:35:36 +01:00
Mazdak Farrokhzad
83536a5c82
Rollup merge of #67274 - RalfJung:uninit, r=Centril
be explicit that mem::uninitialized is the same as MaybeUninit::uninit().assume_init()

Cc @Centril @nikomatsakis
2019-12-13 20:35:34 +01:00
Mazdak Farrokhzad
88e702a6ec
Rollup merge of #67256 - RalfJung:reduce-allocs, r=oli-obk
Reduce allocs for validation errors

This probably doesn't really matter, but I just felt like I had to do this...

r? @oli-obk
2019-12-13 20:35:33 +01:00
Mazdak Farrokhzad
a0be3a683d
Rollup merge of #67254 - RalfJung:vtable-ice, r=oli-obk
dont ICE in case of invalid drop fn

Fixes https://github.com/rust-lang/miri/issues/1112

r? @oli-obk
2019-12-13 20:35:31 +01:00
Mazdak Farrokhzad
48164f8a17
Rollup merge of #67235 - jonas-schievink:vecdeque-leak, r=KodrAus
VecDeque: drop remaining items on destructor panic

Closes https://github.com/rust-lang/rust/issues/67232
2019-12-13 20:35:30 +01:00