Commit Graph

90259 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
73e661a0a5
Rollup merge of #58595 - stjepang:make-duration-consts-associated, r=oli-obk
Turn duration consts into associated consts

As suggested in https://github.com/rust-lang/rust/issues/57391#issuecomment-459658236, I'm moving `Duration` constants (`SECOND`, `MILLISECOND` and so on; currently behind unstable `duration_constants` feature) into the `impl Duration` block.

cc @frewsxcv @SimonSapin
2019-02-23 09:25:29 +01:00
Mazdak Farrokhzad
18dd2d2fbe
Rollup merge of #58526 - pmccarter:master, r=estebank
Special suggestion for illegal unicode curly quote pairs

Fixes #58436

Did not end up expanding the error message span to include the full string literal since I figured the start of the token was the issue, while the help suggestion span would include up to the closing quotation mark.

The look ahead logic does not affect the reader position, not sure if that is an issue (if eg it should still continue to parse after the closing quote without erroring out).
2019-02-23 09:25:27 +01:00
Mazdak Farrokhzad
585d4d29d9
Rollup merge of #58476 - nnethercote:rm-LazyTokenStream, r=petrochenkov
Remove `LazyTokenStream`.

`LazyTokenStream` was added in #40939. Perhaps it was an effective optimization then, but no longer. This PR removes it, making the code both simpler and faster.

r? @alexcrichton
2019-02-23 09:25:26 +01:00
Mazdak Farrokhzad
4f99061874
Rollup merge of #58453 - jethrogb:jb/sgx-panic-abort, r=nagisa
SGX target: fix panic = abort

What is the difference between `no_mangle` and `rustc_std_internal_symbol`?
2019-02-23 09:25:24 +01:00
Mazdak Farrokhzad
3688643293
Rollup merge of #58353 - matthewjasper:typeck-pattern-constants, r=arielb1
Check the Self-type of inherent associated constants

r? @arielb1
2019-02-23 09:25:23 +01:00
Mazdak Farrokhzad
abd6f503fe
Rollup merge of #58227 - Aaronepower:master, r=Centril
Updated RELEASES.md for 1.33.0

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

r? @Mark-Simulacrum

cc @rust-lang/release
2019-02-23 09:25:19 +01:00
Mazdak Farrokhzad
1d6657dd0a
Rollup merge of #58199 - clintfred:partial-move-err-msg, r=estebank
Add better error message for partial move

closes #56657

r? @davidtwco
2019-02-23 09:25:17 +01:00
Mazdak Farrokhzad
f19bec89d7
Rollup merge of #58122 - matthieu-m:range_incl_perf, r=dtolnay
RangeInclusive internal iteration performance improvement.

Specialize `Iterator::try_fold` and `DoubleEndedIterator::try_rfold` to improve code generation in all internal iteration scenarios.

This changes brings the performance of internal iteration with `RangeInclusive` on par with the performance of iteration with `Range`:

 - Single conditional jump in hot loop,
 - Unrolling and vectorization,
 - And even Closed Form substitution.

Unfortunately, it only applies to internal iteration. Despite various attempts at stream-lining the implementation of `next` and `next_back`, LLVM has stubbornly refused to optimize external iteration appropriately, leaving me with a choice between:

 - The current implementation, for which Closed Form substitution is performed, but which uses 2 conditional jumps in the hot loop when optimization fail.
 - An implementation using a `is_done` boolean, which uses 1 conditional jump in the hot loop when optimization fail, allowing unrolling and vectorization, but for which Closed Form substitution fails.

In the absence of any conclusive evidence as to which usecase matters most, and with no assurance that the lack of Closed Form substitution is not indicative of other optimizations being foiled, there is no way
to pick one implementation over the other, and thus I defer to the statu quo as far as `next` and `next_back` are concerned.
2019-02-23 09:25:12 +01:00
Mazdak Farrokhzad
c49da5bfe5
Rollup merge of #58100 - h-michael:librustdoc-2018, r=Centril
Transition librustdoc to Rust 2018

#58099
2019-02-23 09:25:11 +01:00
Hirokazu Hata
1fe87df104 Fix tidy check errors 2019-02-23 17:02:57 +09:00
Hirokazu Hata
1932d7a52d Transition librustdoc to 2018 edition 2019-02-23 16:40:07 +09:00
kenta7777
42d5cf868c reduce an mir code repetition like (n << amt) >> amt 2019-02-23 10:07:09 +09:00
Hoàng Đức Hiếu
7cfddfb4e4 Improve parsing diagnostic for negative supertrait bounds 2019-02-23 07:58:16 +07:00
Patrick McCarter
d0c110f2c6 #58658 bless after line split for tidy 2019-02-22 19:23:03 -05:00
Patrick McCarter
5952c610a7 tidy line length override #58617 2019-02-22 17:07:13 -05:00
Eric Huss
d5484cffb5 Update cargo 2019-02-22 13:36:41 -08:00
Patrick McCarter
8ee1c0708a Change byte align message wording #58617 2019-02-22 16:36:39 -05:00
bors
082c86175f Auto merge of #58644 - Centril:rollup, r=Centril
Rollup of 17 pull requests

Successful merges:

 - #57656 (Deprecate the unstable Vec::resize_default)
 - #58059 (deprecate before_exec in favor of unsafe pre_exec)
 - #58064 (override `VecDeque::try_rfold`, also update iterator)
 - #58198 (Suggest removing parentheses surrounding lifetimes)
 - #58431 (fix overlapping references in BTree)
 - #58555 (Add a note about 2018e if someone uses `try {` in 2015e)
 - #58588 (remove a bit of dead code)
 - #58589 (cleanup macro after 2018 transition)
 - #58591 (Dedup a rustdoc diagnostic construction)
 - #58600 (fix small documentation typo)
 - #58601 (Search for target_triple.json only if builtin target not found)
 - #58606 (Docs: put Future trait into spotlight)
 - #58607 (Fixes #58586: Make E0505 erronous example fail for the 2018 edition)
 - #58615 (miri: explain why we use static alignment in ref-to-place conversion)
 - #58620 (introduce benchmarks of BTreeSet.intersection)
 - #58621 (Update miri links)
 - #58632 (Make std feature list sorted)

Failed merges:

r? @ghost
2019-02-22 21:32:15 +00:00
Patrick McCarter
5f27a25cf4 Invalid byte alignment expected/provided in message #58617 2019-02-22 15:49:07 -05:00
Esteban Küber
cc1cd83657 Do not underflow after resetting unmatched braces count
Fix #58638.
2019-02-22 11:52:03 -08:00
kennytm
ee07b15a3c
Added a connection timeout and speed threshold when downloading the Docker cache 2019-02-23 03:25:14 +08:00
Mazdak Farrokhzad
fda51c2fbd Update RELEASES.md 2019-02-22 17:50:18 +01:00
Felix S. Klock II
4f89846377 Fix #57979 by allowing a legitimate type error to take precedence over an ICE. 2019-02-22 16:21:44 +01:00
Felix S. Klock II
b72ba0559c Switch from error patterns to //~ ERROR markers.
AFAICT, we do not have the same const-eval issues that we used to when
rust-lang/rust#23926 was filed. (Probably because of the switch to
miri for const-evaluation.)
2019-02-22 16:07:15 +01:00
Felix S. Klock II
e555854f9d Make target pointer-width specific variants of (very old) huge-array-simple.rs test.
(and now unignore the test since it shouldn't break tests of
cross-compiles anymore.)
2019-02-22 15:13:07 +01:00
Mazdak Farrokhzad
a8a343a787
Rollup merge of #58632 - matklad:reduce-contention, r=Centril
Make std feature list sorted

This helps to avoid merge conflicts when concurrent PRs append features to the end of the list.
2019-02-22 14:58:16 +01:00
Mazdak Farrokhzad
40d40a3480
Rollup merge of #58621 - phansch:update_miri_links, r=oli-obk
Update miri links

Miri has been moved to `rust-lang` a couple of days ago.
2019-02-22 14:58:15 +01:00
Mazdak Farrokhzad
a2a2b7b749
Rollup merge of #58620 - ssomers:btreeset_intersection_benchmarks, r=KodrAus
introduce benchmarks of BTreeSet.intersection

16 tests combining 4 kinds of contents with different sizes exposing edge cases.
The ones with asymmetric sizes are addressed by https://github.com/rust-lang/rust/pull/58577.
The pos_vs_neg cases seems (are were meant to be) the same as the neg_vs_pos case (same thing, reverse order) but reality shows a surprsing 25% difference.
2019-02-22 14:58:14 +01:00
Mazdak Farrokhzad
9695b80647
Rollup merge of #58615 - RalfJung:ref-to-place-alignment, r=oli-obk
miri: explain why we use static alignment in ref-to-place conversion

@eddyb @oli-obk do you think this makes sense? Or should we use the run-time alignment (`align_of_val`)? I am a bit worried about custom DSTs, but that affects way more areas of Miri so I'd ignore them for now.

r? @oli-obk
2019-02-22 14:58:12 +01:00
Mazdak Farrokhzad
59f1a563d5
Rollup merge of #58607 - gurgalex:fail_E0505_for_2018_edition, r=matthewjasper
Fixes #58586: Make E0505 erronous example fail for the 2018 edition

The original example worked for 2015, but not the 2018 edition of Rust.

Borrowing the moved value after ownership is transferred seems required for 2018.

[this](https://github.com/rust-lang/rust/compare/rust-lang:f66e469...gurgalex:b2a02c8#diff-4ca866aea4a6efecd732f1975faaad88R1564) line though is correct for 2018, but not for the 2015 edition.

Fix #58586
2019-02-22 14:58:11 +01:00
Mazdak Farrokhzad
b28a32fba7
Rollup merge of #58606 - stjepang:put-future-into-spotlight, r=alexcrichton
Docs: put Future trait into spotlight

If a function returns a type that implements `Future`, there should be a small "i" symbol next to it indicating the return type implements an important trait.
2019-02-22 14:58:09 +01:00
Mazdak Farrokhzad
555df2bba1
Rollup merge of #58601 - gnzlbg:json_error, r=oli-obk
Search for target_triple.json only if builtin target not found

Before this commit, if the builtin target was found, but an error
happened when instantiating it (e.g. validating the target
specification file failed, etc.), then we ignored those errors
and proceeded to try to find a `target_triple.json` file, and if
that failed, reported that as an error.

With this commit, if rustc is supposed to provide the builtin target,
and something fails while instantiating it, that error will
get properly propagated.

r? @oli-obk
2019-02-22 14:58:08 +01:00
Mazdak Farrokhzad
575a209624
Rollup merge of #58600 - llogiq:documentation-tests-typo, r=frewsxcv
fix small documentation typo

Thanks to @stjepang for catching my mistake.
2019-02-22 14:58:07 +01:00
Mazdak Farrokhzad
1d0d94a650
Rollup merge of #58591 - dwijnand:dedup-a-rustdoc-diag-construction, r=GuillaumeGomez
Dedup a rustdoc diagnostic construction

None
2019-02-22 14:58:06 +01:00
Mazdak Farrokhzad
aa3779b4e9
Rollup merge of #58589 - matklad:remove-hack, r=petrochenkov
cleanup macro after 2018 transition

We can now use `?`
2019-02-22 14:58:04 +01:00
Mazdak Farrokhzad
94817aa87a
Rollup merge of #58588 - matklad:dead-code, r=petrochenkov
remove a bit of dead code

[Six years](5dc5efefd4) seem to be a long enough transition period 🤣
2019-02-22 14:58:03 +01:00
Mazdak Farrokhzad
bcb7dce75c
Rollup merge of #58555 - scottmcm:try-2015, r=Centril
Add a note about 2018e if someone uses `try {` in 2015e

Inspired by https://github.com/rust-lang/rust/issues/58491, where a `try_blocks` example was accidentally run in 2015, which of course produces a bunch of errors.

What's the philosophy about gating for this?  The keyword is stably a keyword in 2018, so I haven't gated it for now but am not mentioning what the keyword _does_.  Let me know if I should do differently.

Resolves #53672
2019-02-22 14:58:02 +01:00
Mazdak Farrokhzad
42b9a046d4
Rollup merge of #58431 - RalfJung:btree, r=Mark-Simulacrum
fix overlapping references in BTree

This fixes two kinds of overlapping references in BTree (both found by running the BTree test suite in Miri).

In `into_slices_mut`, we did `k.into_key_slice_mut()` followed by `self.into_val_slice_mut()` (where `k` is a copy of `self`). Calling `into_val_slice_mut` calls `self.len()`, which creates a shared reference to `NodeHeader`, which unfortunately (due to padding) overlaps with the mutable reference returned by `into_key_slice_mut`.  Hence the key slice got (partially) invalidated.  The fix is to avoid creating an `&NodeHeader` after the first slice got created.

In the iterators, we used to first create the references that will be returned, and then perform the walk on the tree.  Walking the tree creates references (such as `&mut InternalNode`) that overlap with all of the keys and values stored in a pointer; in particular, they overlap with the references the iterator will later return. This is fixed by reordering the operations of walking the tree and obtaining the inner references.

The test suite still passes (and it passes in Miri now!), but there is a lot of code here that I do not understand...
2019-02-22 14:58:00 +01:00
Mazdak Farrokhzad
894141b57d
Rollup merge of #58198 - igorsdv:suggest-removing-parentheses-surrounding-lifetimes, r=estebank
Suggest removing parentheses surrounding lifetimes

Fixes #57386.

r? @estebank
2019-02-22 14:57:59 +01:00
Mazdak Farrokhzad
70cc6c980c
Rollup merge of #58064 - llogiq:vec-deque-try-rfold, r=scottmcm
override `VecDeque::try_rfold`, also update iterator

This keeps the slice based iteration and updates the iterator state after each slice. It also uses a loop to reduce the amount of code.

This uses unsafe code, so some thorough review would be appreciated. Cc @RalfJung
2019-02-22 14:57:58 +01:00
Mazdak Farrokhzad
ec8ef1836a
Rollup merge of #58059 - RalfJung:before_exec, r=alexcrichton
deprecate before_exec in favor of unsafe pre_exec

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

As per the [lang team decision](https://github.com/rust-lang/rust/issues/39575#issuecomment-442993358):

> The language team agreed that before_exec should be unsafe, and leaves the details of a transition plan to the libs team.

Cc @alexcrichton @rust-lang/libs how would you like to proceed?
2019-02-22 14:57:56 +01:00
Mazdak Farrokhzad
0bcb66469c
Rollup merge of #57656 - scottmcm:deprecate-resize_default, r=SimonSapin
Deprecate the unstable Vec::resize_default

As a way to either get additional feedback to stabilize or help move nightly users off it.

Tracking issue: https://github.com/rust-lang/rust/issues/41758#issuecomment-449719961

r? @SimonSapin
2019-02-22 14:57:55 +01:00
bors
e1c6d00574 Auto merge of #57997 - nitnelave:master, r=RalfJung
Wrap write_bytes in a function. Move docs

This will allow us to add debug assertions.
See issue #53871.
2019-02-22 13:52:41 +00:00
Guillaume Gomez
b5ae4d5888 Don't generate minification variable if minification disabled 2019-02-22 13:50:17 +01:00
Bastien Orivel
a82f0ce54b Update parking_lot to 0.7
Unfortunately this'll dupe parking_lot until the data_structures crate
is published and be updated in rls in conjunction with crossbeam-channel
2019-02-22 13:49:19 +01:00
Aleksey Kladov
88d55f537d Make std feature list sorted
This helps to avoid merge conflicts when concurrent PRs append
features to the end of the list.
2019-02-22 11:04:10 +03:00
bors
1005f3bac7 Auto merge of #56113 - spastorino:erroneous-loop-diagnostic-in-nll, r=pnkfelix
Erroneous loop diagnostic in nll

Closes #53773

r? @nikomatsakis
2019-02-22 06:52:39 +00:00
bors
c6fd02772b Auto merge of #58574 - RalfJung:pin, r=Mark-Simulacrum
improve Pin documentation

Incorporates a bunch of the documentation-related comments that came up when discussing `Pin` stabilization.

Cc @alexcrichton @withoutboats @cramertj @jonhoo

Fixes https://github.com/rust-lang/rust/issues/58130
2019-02-22 04:11:23 +00:00
bors
d1f8970bd1 Auto merge of #58616 - vertexclique:destabilize-fixed-width-atomic-integers, r=dtolnay
Destabilize fixed-width const defined atomic integers

With this PR version 1.34.0 onwards const declarations of atomic integers will be unstable.

* Closes https://github.com/rust-lang/rust/issues/58089
* Reverts partially: https://github.com/rust-lang/rust/pull/57425
2019-02-22 01:29:34 +00:00
Ingvar Stepanyan
9f58c5fa7c Optimise vec![false; N] to zero-alloc
Nowadays booleans have a well-defined representation, so there is no reason not to optimise their allocation.
2019-02-21 23:02:34 +00:00