Commit Graph

94529 Commits

Author SHA1 Message Date
Napen123
1b6b7597ed Add examples for make_ascii_{uppercase, lowercase} 2019-06-08 18:28:29 -06:00
bors
991c719a1d Auto merge of #61529 - ehuss:update-books, r=GuillaumeGomez
Update books

## reference

2 commits in 862b669c395822bb0938781d74f860e5762ad4fb..f8ae436d936f6f4891d3c1bbb1af5865eb8aeadb
2019-05-04 23:41:35 -0700 to 2019-05-31 14:59:12 +0200
- Document that literals with any suffixes are valid as tokens (rust-lang-nursery/reference#612)
- Fix example code of derive macro (rust-lang-nursery/reference#611)

## book

2 commits in 29fe982990e43b9367be0ff47abc82fb2123fd03..62a8c6f25fbd981c80a046f3b04be9684749af3b
2019-05-15 17:48:40 -0400 to 2019-05-28 15:48:23 -0400
- Remove snapshots checked in layout
- Remove snapshots that I've approved in layout

## rust-by-example

5 commits in 811c697b232c611ed754d279ed20643a0c4096f6..18566f4dedc3ef5bf61f5f85685d5966db99cc11
2019-04-28 18:56:42 -0300 to 2019-05-30 19:23:24 -0300
- Fixed wording in the `Seconds` struct description. (rust-lang/rust-by-example#1195)
- Fix usage of the word "elision" (rust-lang/rust-by-example#1191)
- Reword "Flow Control" to "Flow of Control" (rust-lang/rust-by-example#1190)
- Copy edits to chapter 1 (rust-lang/rust-by-example#1189)
- Fix typo in a mod/visibility.md (rust-lang/rust-by-example#1188)

## rustc-guide

9 commits in 3cb727b62b953d59b4360d39aa68b6dc8f157655..3ac9cfc9c9ab2e366feebf18718112737f572352
2019-05-07 09:53:32 -0500 to 2019-06-02 19:36:58 -0500
- Update information about debuginfo configuration
- fix long line
- Fixed misspelling
- Add more info subsection with links to forge and rustc api docs (rust-lang/rustc-guide#324)
- Renamed the file and title of the diagnostics chapter.
- Added rustc phases diagram and explanation
- Mention running tests for subdirectories
- Fixed links broken by merging chalks rules and solve
- Add documentation about profile-guided optimization.

## embedded-book

1 commits in 9858872bd1b7dbba5ec27dc30d34eba00acd7ef9..f0c75b75f9c18537b78f5d17c1015247e9a49c86
2019-05-02 18:56:54 +0000 to 2019-06-03 10:49:02 +0000
- Qemu md changes  (rust-embedded/book#193)
2019-06-08 20:25:09 +00:00
bors
5c6f6b810c Auto merge of #61655 - RalfJung:checktools, r=kennytm
checktools: unify grepping the TOOLSTATE file

The file was grepped twice but in a different way. This unifies the code to make sure it is consistent. Or were these deliberately not doing the same thing? That seems strange though.

I wouldn't know how to test these changes.
2019-06-08 17:44:12 +00:00
bors
5c45343f11 Auto merge of #61625 - RalfJung:eval-interp, r=oli-obk
Rename remaining "Eval" to "Interp"

Renaming done by sed.

r? @oli-obk

Fixes https://github.com/rust-lang/rust/issues/54395.
2019-06-08 13:02:49 +00:00
bors
fb7cca33f8 Auto merge of #61620 - SimonSapin:as_cell, r=RalfJung
Stabilize Cell::from_mut and as_slice_of_cells

FCP: https://github.com/rust-lang/rust/issues/43038#issuecomment-499900463
2019-06-08 10:15:31 +00:00
Ralf Jung
b86c050f64 fix rebase fallout 2019-06-08 11:40:55 +02:00
Ralf Jung
059e7c0c80 rename EvalSnapshot -> InterpSnapshot 2019-06-08 11:39:48 +02:00
Ralf Jung
8f05ff3e33 rename EvalResult -> InterpResult and EvalError -> InterpErrorInfo 2019-06-08 11:39:48 +02:00
Ralf Jung
fea10c435d checktools: unify grepping the TOOLSTATE file 2019-06-08 11:32:25 +02:00
bors
7f90abe3aa Auto merge of #61635 - ecstatic-morse:const-signum, r=oli-obk
Make `i*::signum` a `const fn`.

Ticks a box in #53718.

This uses a well-known branchless implementation of `signum`: `(n > 0) as i32 - (n < 0) as i32`.

Here's a [playground](https://play.rust-lang.org/?version=nightly&mode=release&edition=2018&gist=747cf191c4974bf66c9d75e509ae6e6e) comparing the two techniques. On x86 in release mode, the branchless implementation is able to replace a `mov` and `cmov` with a `sar` and `add`, so this should be a bit faster as well.

~~This is marked as a draft since I think I'll need to add `#[rustc_const_unstable]` somewhere. Perhaps the reviewer can point me in the right direction.~~
2019-06-08 07:20:57 +00:00
bors
6312b89fda Auto merge of #61649 - Centril:rollup-b4nx9k9, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #61223 (Document tuple's Ord behavior as sequential)
 - #61615 (syntax: Treat error literals in more principled way)
 - #61616 (parser: Remove `Deref` impl from `Parser`)
 - #61621 (Clarify when we run steps with ONLY_HOSTS)
 - #61627 (Add regression test for #61452.)
 - #61641 (Revert "Make LocalAnalizer visitor iterate instead of recurse")
 - #61647 (Use stable wrappers in f32/f64::signum)

Failed merges:

r? @ghost
2019-06-08 01:34:53 +00:00
Mazdak Farrokhzad
b3bdc24a89
Rollup merge of #61647 - JohnTitor:use-stable-func, r=Centril
Use stable wrappers in f32/f64::signum

Fixes #61638

r? @Centril
2019-06-08 03:34:02 +02:00
Mazdak Farrokhzad
96a80502a0
Rollup merge of #61641 - spastorino:revert-to-recursion-on-local-analyzer, r=oli-obk
Revert "Make LocalAnalizer visitor iterate instead of recurse"

This reverts commit 0cfaa28bc5.

r? @oli-obk
2019-06-08 03:34:00 +02:00
Mazdak Farrokhzad
6d25bcdb75
Rollup merge of #61627 - davidtwco:ice-async-fn-lint, r=alexcrichton
Add regression test for #61452.

Fixes #61452.

Turns out this ICE had already been fixed, so this PR only adds a regression test.
2019-06-08 03:33:59 +02:00
Mazdak Farrokhzad
9f314fe2f3
Rollup merge of #61621 - Mark-Simulacrum:bootstrap-run-only-hosts, r=alexcrichton
Clarify when we run steps with ONLY_HOSTS

Just some simple cleanup, no behavior changes.

r? @alexcrichton
2019-06-08 03:33:58 +02:00
Mazdak Farrokhzad
ae487e04c8
Rollup merge of #61616 - petrochenkov:parsderef, r=oli-obk
parser: Remove `Deref` impl from `Parser`

Follow up to https://github.com/rust-lang/rust/pull/61541

You have to write `self.token.span` instead of `self.span` in the parser now, which is not nice, but not too bad either, I guess.
Not sure.
Probably still better than people using both and being confused about the definition point of `span`.

r? @oli-obk @estebank
2019-06-08 03:33:57 +02:00
Mazdak Farrokhzad
5062ad3c60
Rollup merge of #61615 - petrochenkov:errlit, r=matklad
syntax: Treat error literals in more principled way

Free them from their character literal origins.

I actually tried to remove `LitKind::Err` entirely (by converting it into `ExprKind::Err` immediately), and it caused no diagnostic regressions in the test suite.
However, I'd still want to use error literals as general purpose error tokens some day, so I kept them.

The downside of having `LitKind::Err` in addition to `ExprKind::Err` is that every time you want to do something with `ExprKind::Err` you need to make sure that `ExprKind::Lit(LitKind::Err)` is treated in the same way.
Fortunately, this usually happens automatically because both literals and errors are "leaf" expressions, however this PR does fix a couple of inconsistencies between them.

Addresses https://github.com/rust-lang/rust/pull/60679#discussion_r282640663 in a way
2019-06-08 03:33:55 +02:00
Mazdak Farrokhzad
2a9bcbf9a9
Rollup merge of #61223 - czipperz:tuple-ord-document-ordering, r=oli-obk
Document tuple's Ord behavior as sequential

Partially closing #50727
2019-06-08 03:33:54 +02:00
Dylan MacKenzie
f6611db1d5 Add const-ness tests for i32::signum 2019-06-07 17:54:50 -07:00
Yuki Okushi
43ab14e2f4 Use stable wrappers 2019-06-08 09:36:46 +09:00
Dylan MacKenzie
bd899d02e9 Make i*::signum a const fn.
This uses a well-known branchless implementation of `signum`.
Its `const`-ness is unstable and requires `#![feature(const_int_sign)]`.
2019-06-07 15:37:03 -07:00
Santiago Pastorino
4c326174d2 Revert "Make LocalAnalizer visitor iterate instead of recurse"
This reverts commit 0cfaa28bc5.
2019-06-07 23:43:19 +02:00
bors
d132f544f9 Auto merge of #61130 - jonhoo:mem-take, r=SimonSapin
Add std::mem::take as suggested in #61129

This PR implements #61129 by adding `std::mem::take`.

The added function is equivalent to:
```rust
std::mem::replace(dest, Default::default())
```

This particular pattern is fairly common, especially when implementing `Future::poll`, where you often need to yield an owned value in `Async::Ready`. This change allows you to write
```rust
return Async::Ready(std::mem::take(self.result));
```
instead of
```rust
return Async::Ready(std::mem::replace(self.result, Vec::new()));
```

EDIT: Changed name from `take` to `swap_default`.
EDIT: Changed name back to `take`.
2019-06-07 18:26:15 +00:00
David Wood
5604d9a93f
tests: Add regression test for #61452. 2019-06-07 18:35:06 +01:00
Vadim Petrochenkov
2af47facc3 syntax: Treat error literals in more principled way 2019-06-07 18:01:50 +03:00
bors
c8865d8e19 Auto merge of #61622 - Centril:rollup-6ivvmul, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #61332 (Remove asterisk suggestion for move errors in borrowck)
 - #61532 ([const-prop] Support Rvalue::{Ref,Len} and Deref)
 - #61586 (ci: Disable LLVM/debug assertions for asmjs builder)
 - #61599 (libcore/pin: Minor grammar corrections for module documentation)
 - #61603 (Increases heap size available during testing for SGX)
 - #61605 (Fix slice const generic length display)
 - #61618 (make the backtrace field of EvalError private)

Failed merges:

r? @ghost
2019-06-07 14:50:22 +00:00
Mazdak Farrokhzad
b9c752b550
Rollup merge of #61618 - RalfJung:error, r=oli-obk
make the backtrace field of EvalError private

This also makes sure people don't contruct these the wrong way (i.e., not through the `From` instance).

r? @oli-obk
2019-06-07 16:48:10 +02:00
Mazdak Farrokhzad
9bbdc40334
Rollup merge of #61605 - GuillaumeGomez:const-generic-display, r=varkor
Fix slice const generic length display

Fixes #61487.

r? @varkor
2019-06-07 16:48:09 +02:00
Mazdak Farrokhzad
06a1df4954
Rollup merge of #61603 - Goirad:increase-sgx-heapsize, r=alexcrichton
Increases heap size available during testing for SGX

PR [61540](https://github.com/rust-lang/rust/pull/61540) causes at least one test to fail when run for the SGX platform due to lack of memory. This PR increases the heapsize available during tests, which is a good thing regardless of the status of that PR.
2019-06-07 16:48:08 +02:00
Mazdak Farrokhzad
5557bd0b1e
Rollup merge of #61599 - laumann:pin-docs-minor-edits, r=Centril
libcore/pin: Minor grammar corrections for module documentation

This is by no means exhaustive, but I noticed a few grammatical errors
when reading the documentation, and decided just to push these.

Some standard rules/guidelines I followed:

 * Do not split infinitives, ie "not to move" instead of "to not move"

 * Do not use "since" when you want to say "because" or "as" - the word
   "since" has a temporal meaning

In addition:

 * Fix a small typo: "Similarily" should be "Similarly"

 * Delete double-spaces after full stop
2019-06-07 16:48:06 +02:00
Mazdak Farrokhzad
b4c6c6f9d0
Rollup merge of #61586 - alexcrichton:asmjs-no-assertions, r=pietroalbini
ci: Disable LLVM/debug assertions for asmjs builder

This shaves of 50 minutes of cycle time on Azure and will likely also
save a significant chunk of time on Travis. The assertions here aren't
really buying us much over other builders with assertions already
enabled, so let's disable them for this builder.

cc #61185
2019-06-07 16:48:05 +02:00
Mazdak Farrokhzad
de6bc12868
Rollup merge of #61532 - wesleywiser:const_prop_more, r=oli-obk
[const-prop] Support Rvalue::{Ref,Len} and Deref

Also fixes an ICE I found in testing.

r? @oli-obk

~~The final commit is just for a perf run. I'll remove it after that is completed.~~
2019-06-07 16:48:03 +02:00
Mazdak Farrokhzad
9ab654c53e
Rollup merge of #61332 - kennethbgoodin:borrowck-remove-asterisk-suggestion, r=matthewjasper
Remove asterisk suggestion for move errors in borrowck

As per the decision in #54985 completely removes the suggestion to add an asterisk when checking move errors. I believe I've preserved the correct behavior with the "consider borrowing here" branch of the original match arm, but I'm not positive on that.

This is my first PR to rustc so any feedback is greatly appreciated. Thanks.
2019-06-07 16:48:02 +02:00
Mark Rousskov
367b031d88 Clarify when we run steps with ONLY_HOSTS 2019-06-07 08:40:30 -06:00
Simon Sapin
2ce9440368 Stabilize Cell::from_mut and as_slice_of_cells
FCP: https://github.com/rust-lang/rust/issues/43038#issuecomment-499900463
2019-06-07 16:25:41 +02:00
Guillaume Gomez
8f3753703c Fix slice const generic length display 2019-06-07 15:54:16 +02:00
Ralf Jung
524f1463cd add doc comment for EvalError 2019-06-07 15:51:29 +02:00
Ralf Jung
625763fddd make the backtrace field of EvalError private
This also makes sure people don't contruct these the wrong way
2019-06-07 13:48:51 +02:00
Vadim Petrochenkov
3dbee57dae parser: Remove look_ahead_span 2019-06-07 13:57:57 +03:00
Vadim Petrochenkov
6eae6b0fe9 parser: Remove Deref impl from Parser 2019-06-07 13:52:03 +03:00
Vadim Petrochenkov
3da094319c parser: self.span -> self.token.span 2019-06-07 13:51:23 +03:00
bors
c1c60d292e Auto merge of #61209 - matthewjasper:const-tuple-constructors, r=oli-obk
Make tuple constructors real const fns

Mir construction special cases `Ctor(...)` to be lowered as `Ctor { 0: ... }`, which means this doesn't come up much in practice, but it seems inconsistent not to allow this.

r? @oli-obk
2019-06-07 09:41:06 +00:00
Thomas Bracht Laumann Jespersen
fb61b851ef libcore/pin: Minor grammar corrections for module documentation
This is by no means exhaustive, but I noticed a few grammatical errors
when reading the documentation, and decided just to push these.

Some standard rules/guidelines I followed:

 * Do not split infinitives, ie "not to move" instead of "to not move"

 * Do not use "since" when you want to say "because" or "as" - the word
   "since" has a temporal meaning

In addition:

 * Fix a small typo: "Similarily" should be "Similarly"

 * Delete double-spaces after full stop
2019-06-07 11:03:01 +02:00
bors
ca1bcfdde3 Auto merge of #61541 - petrochenkov:tsp, r=oli-obk
syntax: Keep token span as a part of `Token`

In the world with proc macros and edition hygiene `Token` without a span is not self-contained.
In practice this means that tokens and spans are always stored and passed somewhere along with each other.
This PR combines them into a single struct by doing the next renaming/replacement:

- `Token` -> `TokenKind`
- `TokenAndSpan` -> `Token`
- `(Token, Span)` -> `Token`

Some later commits (fb6e2fe8fd and 1cdee86940) remove duplicate spans in `token::Ident` and `token::Lifetime`.
Those spans were supposed to be identical to token spans, but could easily go out of sync, as was noticed in https://github.com/rust-lang/rust/pull/60965#discussion_r285398523.
The `(Token, Span)` -> `Token` change is a soft pre-requisite for this de-duplication since it allows to avoid some larger churn (passing spans to most of functions classifying identifiers).
2019-06-07 06:52:09 +00:00
bors
c5295ac64a Auto merge of #61408 - varkor:fmin-fmax-llvm-intrinsics, r=alexcrichton
Use LLVM intrinsics for floating-point min/max

Resurrection of https://github.com/rust-lang/rust/pull/46926, now that the optimisation issues are fixed. I've confirmed locally that https://github.com/rust-lang/rust/pull/61384 solves the issues.

I'm not sure if we're allowed to move the `min`/`max` methods from libcore to libstd: I can't quite tell what the status is from https://github.com/rust-lang/rust/issues/50145. However, this is necessary to use the intrinsics.

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

r? @SimonSapin
cc @rkruppe @nikic
2019-06-07 01:42:15 +00:00
Wesley Wiser
459e37b304 Bless test output 2019-06-06 17:52:17 -04:00
Dario Gonzalez
9a49841961 increase max heapsize available during sgx tests 2019-06-06 14:13:16 -07:00
bors
5eeb567a27 Auto merge of #61601 - Centril:rollup-uegbsns, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #61376 (Add Bound::cloned())
 - #61554 (Change visit api)
 - #61559 (Make visitors iterate)
 - #61585 (Update .mailmap with my name)
 - #61591 (Update .mailmap)

Failed merges:

r? @ghost
2019-06-06 20:46:15 +00:00
Mazdak Farrokhzad
9e97970fe2
Rollup merge of #61591 - christianpoveda:patch-1, r=jonas-schievink
Update .mailmap
2019-06-06 22:39:14 +02:00
Mazdak Farrokhzad
61f5042633
Rollup merge of #61585 - lnicola:mailmap, r=Mark-Simulacrum
Update .mailmap with my name
2019-06-06 22:39:13 +02:00