Commit Graph

86274 Commits

Author SHA1 Message Date
Ralf Jung
7b6ad7a960 make park/unpark example more realistic 2018-11-23 11:04:16 +01:00
Ralf Jung
2d46ae7c37 expand thread::park explanation 2018-11-22 10:54:04 +01:00
bors
4bec59c93b Auto merge of #56147 - petrochenkov:impice, r=nikomatsakis
resolve: Fix some asserts in import validation

The asserts are not actually correct in presence of ambiguity errors.

Fixes https://github.com/rust-lang/rust/issues/56125
2018-11-22 02:40:44 +00:00
bors
6612100de5 Auto merge of #56065 - oli-obk:min_const_fn_loop_ice, r=davidtwco
Replace the ICEing on const fn loops with an error

fixes #56035
2018-11-21 23:24:15 +00:00
Vadim Petrochenkov
1dc1124979 resolve: Fix some asserts in import validation 2018-11-22 01:13:09 +03:00
bors
0b9f19dff1 Auto merge of #56134 - oli-obk:clippy_documentation, r=nrc
Forward rust version number to tools

Clippy uses it to identify the correct documentation to point to

cc @Manishearth @nrc

sibling PR in clippy: https://github.com/rust-lang-nursery/rust-clippy/pull/3442
2018-11-21 20:26:15 +00:00
bors
910ec6d97f Auto merge of #56118 - steveklabnik:update-books, r=alexcrichton
Update books for Rust 2018

This PR:

1. updates all of the books
    * I don't know if @Gankro has further plans for the nomicon or not
2. updates the build process because TRPL is only distributing one edition now
3. fixes up the stdlib links

I think that this passes but it's 3:20 am and so I'm sending it in and will fix up anything i missed in the morning.

/cc @alexcrichton for the big beta backport
2018-11-21 15:56:32 +00:00
Oliver Scherer
33efce1c2f Forward rust version number to tools
Clippy uses it to identify the correct documentation to point to
2018-11-21 14:53:10 +01:00
bors
ee7bb94044 Auto merge of #56117 - petrochenkov:iempty, r=eddyb
resolve: Make "empty import canaries" invisible from other crates

Empty imports `use prefix::{};` are desugared into `use prefix::{self as _};` to make sure the prefix is checked for privacy/stability/etc.
This caused issues in cross-crate scenarios because gensyms are lost in crate metadata (the `_` is a gensym).

Fixes https://github.com/rust-lang/rust/issues/55811
2018-11-21 12:54:10 +00:00
Steve Klabnik
d7b3f5c6ae update various stdlib docs 2018-11-21 06:50:17 -05:00
bors
289ad6e992 Auto merge of #52591 - eddyb:functional-snakes, r=oli-obk
rustc: remove {FxHash,Node,DefId,HirId,ItemLocal}{Map,Set} "constructor" fns.

These are cruft left over from a time when `Foo::default()` didn't "just work".
2018-11-21 08:08:13 +00:00
Eduard-Mihai Burtescu
7683180be5 rustc: implement and use Default on more types. 2018-11-21 08:11:50 +02:00
Eduard-Mihai Burtescu
da622a3796 rustc: remove {FxHash,Node,DefId,HirId,ItemLocal}{Map,Set} "constructor" fns. 2018-11-21 07:27:02 +02:00
bors
780658a464 Auto merge of #56032 - petrochenkov:stabecip, r=nikomatsakis
Stabilize `extern_crate_item_prelude`

Closes https://github.com/rust-lang/rust/issues/55599
2018-11-21 02:30:35 +00:00
Steve Klabnik
57b7d55591 fix more links 2018-11-20 21:25:48 -05:00
Steve Klabnik
0579ef0166 fix rustbuild to build all the books 2018-11-20 21:25:48 -05:00
Steve Klabnik
240a55ce50 update books 2018-11-20 21:22:31 -05:00
Vadim Petrochenkov
1e4cf740cf resolve: Make "empty import canaries" invisible from other crates 2018-11-21 03:59:25 +03:00
Vadim Petrochenkov
d4934c748f Add a couple more tests 2018-11-21 01:28:07 +03:00
Vadim Petrochenkov
1af682a557 Stabilize extern_crate_item_prelude 2018-11-21 01:27:23 +03:00
bors
f1e2fa8f04 Auto merge of #56111 - nrc:update, r=kennytm
Update RLS and Rustfmt

Re-opening https://github.com/rust-lang/rust/pull/56061

@bors: r=kennytm p=2
2018-11-20 21:06:55 +00:00
Nick Cameron
595bea6b33 Update RLS and Rustfmt 2018-11-21 08:30:47 +13:00
bors
c4cf115056 Auto merge of #55720 - RalfJung:const-eval-raw, r=oli-obk
Make const_eval_raw query return just an AllocId

r? @oli-obk
2018-11-20 18:08:12 +00:00
bors
3991bfbbc2 Auto merge of #55663 - varkor:must_use-traits, r=estebank
Allow #[must_use] on traits

Addresses https://github.com/rust-lang/rust/issues/55506, but we'll probably want to add it to some library traits like `Iterator` before the issue is considered fixed. Fixes https://github.com/rust-lang/rust/issues/51560.

`#[must_use]` is already permitted on traits, with no effect, so this seems like a bug fix, but I might be overlooking something. This currently warns for `impl Trait` or `dyn Trait` when the `Trait` is `#[must_use]` (although I don't think the latter is currently possible, so it's simply future-proofed).
2018-11-20 15:15:53 +00:00
bors
15e6613281 Auto merge of #55678 - Aaronepower:master, r=Mark-Simulacrum
Updated RELEASES.md for 1.31.0

[Rendered](https://github.com/Aaronepower/rust/blob/master/RELEASES.md)

r? @Mark-Simulacrum

cc @rust-lang/release
2018-11-20 12:09:36 +00:00
Aaron Power
9240ad4571
Update releases to add rename dependencies feature 2018-11-20 10:47:28 +01:00
bors
7a0cef74a8 Auto merge of #56081 - alexcrichton:update-manifest, r=nrc
Add temporary renames to manifests for rustfmt/clippy

This will be part of our strategy for shipping renamed versions of these
components for the Rust 2018 edition.

Closes #55967
2018-11-20 09:08:24 +00:00
bors
046e054a99 Auto merge of #55983 - oli-obk:static_, r=Mark-Simulacrum
Fix stability hole with `static _`

The `underscore_const_names` only gated const items with `_` as the name.

`static _: () = ();` works on beta without feature gates right now, this PR fixes that.
2018-11-20 03:05:11 +00:00
bors
31fa30145e Auto merge of #56049 - newpavlov:revert_51601, r=sfackler
Revert #51601

Closes: #55985

Specialization of `StepBy<Range(Inclusive)>` results in an incorrectly behaving code when `step_by` is combined with `skip` or `nth`.

If this will get merged we probably should reopen issues previously closed by #51601 (if there was any).
2018-11-20 00:02:33 +00:00
Alex Crichton
3c67ed4500 Add temporary renames to manifests for rustfmt/clippy
This will be part of our strategy for shipping renamed versions of these
components for the Rust 2018 edition.

Closes #55967
2018-11-19 14:22:41 -08:00
Ralf Jung
612febcc4b explain why we can use raw 2018-11-19 23:02:28 +01:00
Ralf Jung
c462e44c13 we now do proper validation on scalars 2018-11-19 23:02:28 +01:00
Ralf Jung
ba82f54b04 use RawConst in miri 2018-11-19 22:42:46 +01:00
Ralf Jung
b50c1b243e Make const_eval_raw query return just an AllocId 2018-11-19 22:42:46 +01:00
bors
5aff30734b Auto merge of #55971 - SergioBenitez:skip-non-semantic, r=alexcrichton
Ignore non-semantic tokens for 'probably_eq' streams.

Improves the situation in #43081 by skipping typically non-semantic tokens when checking for 'probably_eq'.

r? @alexcrichton
2018-11-19 19:57:02 +00:00
varkor
737dec0ec1 Fix change to predicates 2018-11-19 18:54:52 +00:00
varkor
0ab70fab19 Fix typo in #[must_use] message 2018-11-19 17:41:10 +00:00
varkor
9178eb41d3 Handle trait objects 2018-11-19 17:41:10 +00:00
varkor
122886842e Test for #[must_use] on traits 2018-11-19 17:41:10 +00:00
varkor
cb5520bc48 Recognise #[must_use] on traits, affecting impl Trait 2018-11-19 17:41:10 +00:00
varkor
b55717f9b0 Use general uninhabitedness checking 2018-11-19 17:41:10 +00:00
bors
39852cae2b Auto merge of #56060 - nrc:save-path-fallback, r=zackmdavis
save-analysis: fallback to using path id

r? @eddyb
2018-11-19 16:59:12 +00:00
bors
9e8a982a23 Auto merge of #56051 - pietroalbini:rollup, r=pietroalbini
Rollup of 25 pull requests

Successful merges:

 - #55562 (Add powerpc- and powerpc64-unknown-linux-musl targets)
 - #55564 (test/linkage-visibility: Ignore on musl targets)
 - #55827 (A few tweaks to iterations/collecting)
 - #55834 (Forward the ABI of the non-zero sized fields of an union if they have the same ABI)
 - #55857 (remove unused dependency)
 - #55862 (in which the E0618 "expected function" diagnostic gets a makeover)
 - #55867 (do not panic just because cargo failed)
 - #55894 (miri enum discriminant handling: Fix treatment of pointers, better error when it is undef)
 - #55916 (Make miri value visitor useful for mutation)
 - #55919 (core/tests/num: Simplify `test_int_from_str_overflow()` test code)
 - #55923 (reword #[test] attribute error on fn items)
 - #55949 (ty: return impl Iterator from Predicate::walk_tys)
 - #55952 (Update to Clang 7 on CI.)
 - #55953 (#53488 Refactoring UpvarId)
 - #55962 (rustdoc: properly calculate spans for intra-doc link resolution errors)
 - #55963 (Stress test for MPSC)
 - #55968 (Clean up some non-mod-rs stuff.)
 - #55970 (Miri backtrace improvements)
 - #56007 (CTFE: dynamically make sure we do not call non-const-fn)
 - #56011 (Replace data.clone() by Arc::clone(&data) in mutex doc.)
 - #56012 (avoid shared ref in UnsafeCell::get)
 - #56016 (Add VecDeque::resize_with)
 - #56027 (docs: Add missing backtick in object_safety.rs docs)
 - #56043 (remove "approx env bounds" if we already know from trait)
 - #56059 (Increase `Duration` approximate equal threshold to 1us)
2018-11-19 14:07:45 +00:00
kennytm
8cea658b90
Rollup merge of #56059 - alexcrichton:fix-tests, r=sfackler
Increase `Duration` approximate equal threshold to 1us

Previously this threshold when testing was 100ns, but the Windows
documentation states:

> which is a high resolution (<1us) time stamp

which presumably means that we could have up to 1us resolution, which
means that 100ns doesn't capture "equivalent" time intervals due to
various bits of rounding here and there.

It's hoped that this..

Closes #56034
2018-11-19 22:06:45 +08:00
Pietro Albini
10565c45ac
Rollup merge of #56043 - nikomatsakis:issue-55756-via-outlives, r=eddyb
remove "approx env bounds" if we already know from trait

Alternative to https://github.com/rust-lang/rust/pull/55988 that fixes #55756 -- smaller fix that I cannot see having (correctness) repercussions beyond the test at hand, and hence better for backporting. (Famous last words, I know.)

r? @eddyb
2018-11-19 22:06:43 +08:00
Pietro Albini
27519c175a
Rollup merge of #56027 - Xanewok:docs-backtick, r=QuietMisdreavus
docs: Add missing backtick in object_safety.rs docs

Closes #56019.

r? @bjorn3
2018-11-19 22:06:41 +08:00
Pietro Albini
f5dc12ebfc
Rollup merge of #56016 - scottmcm:vecdeque-resize-with, r=joshtriplett
Add VecDeque::resize_with

This already exists on `Vec`; I'm just adding it to `VecDeque`.

I wanted to resize a `VecDeque<Vec<T>>` when I didn't know `T: Clone`, so I couldn't use `.resize(n, Vec::new())`.  With this I could do `.resize_with(n, Vec::new)` instead, which doesn't need `T: Clone`.

Tracking issue: https://github.com/rust-lang/rust/issues/41758
2018-11-19 22:06:39 +08:00
Pietro Albini
2a68c0075a
Rollup merge of #56012 - RalfJung:unsafe-cell, r=nikomatsakis
avoid shared ref in UnsafeCell::get

Avoid taking a shared reference in `UnsafeCell::get`. This *should* be taking a raw reference (see https://github.com/rust-lang/rfcs/pull/2582), but that operation is not currently available, so I propose we exploit `repr(transparent)` instead and cast the pointer around.

This is required to make `UnsafeCell::get` pass the [stacked borrows implementation](https://www.ralfj.de/blog/2018/11/16/stacked-borrows-implementation.html) in miri (currently, `UnsafeCell::get` is on a whitelist, but that is of course not very satisfying). It shouldn't affect normal execution/codegen. Would be great if we could get this landed and shrink miri's whitelist!

Cc @nikomatsakis
2018-11-19 22:06:37 +08:00
Pietro Albini
05ae505a4c
Rollup merge of #56011 - CBenoit:master, r=QuietMisdreavus
Replace data.clone() by Arc::clone(&data) in mutex doc.

Arc::clone(&from) is considered as more idiomatic because it conveys more explicitly the meaning of the code.
Since this clone is visible in the official documentation, I thought it could be better to use the more idiomatic version.
2018-11-19 22:06:35 +08:00
Pietro Albini
c0d48ce39a
Rollup merge of #56007 - RalfJung:non-const-call, r=oli-obk
CTFE: dynamically make sure we do not call non-const-fn

I'd love to have a test case for this, but I don't know how.

I am also really surprised by this test case that changed behavior: Why did it even start execution if it already determined that it shouldn't?!?

r? @oli-obk
2018-11-19 22:06:32 +08:00