Commit Graph

94774 Commits

Author SHA1 Message Date
Vadim Petrochenkov
8049e6199b Remove unused #![feature(custom_attribute)]s 2019-06-08 23:55:24 +03:00
Adrian Friedli
26d4c8f01c
implement nth_back for Range 2019-06-08 22:30:45 +02: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
Igor Matuszewski
31dc27da91 Update RLS 2019-06-08 22:17:01 +02:00
Vadim Petrochenkov
9aaa7c770c syntax: Move some Token methods around 2019-06-08 22:38:39 +03:00
Vadim Petrochenkov
25b05147b3 syntax: Remove Deref impl from Token 2019-06-08 22:38:23 +03:00
Vadim Petrochenkov
0ca3c2f881 syntax: Move most of the TokenKind methods to Token 2019-06-08 22:38:12 +03:00
Cedric
0a4504d400 fix libsyntax test 2019-06-08 20:43:24 +02:00
Ralf Jung
3f99ad175a extra paranoid mode 2019-06-08 20:35:59 +02:00
Igor Matuszewski
08ede49dcb Remove redundant, commented out code
It was commented out as part of
8a8e497ae7.
Done probably by accident, since the code in question was moved to a
match arm, along with newly introduced logic to detect bare CRs in raw
strings.
2019-06-08 20:05:02 +02:00
Igor Matuszewski
b8e3533b73 Separate a scan_raw_string (similar raw_byte variant) 2019-06-08 20:05:02 +02:00
Igor Matuszewski
5b17a5e30a Clean up minor bits 2019-06-08 20:05:02 +02:00
Yuki Okushi
d69d0d7aa7 Add test for ICE 2019-06-09 03:04:56 +09: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
Vadim Petrochenkov
ffe23475cb syntax: Keep full Tokens for macro_rules separators 2019-06-08 20:36:20 +03:00
Ralf Jung
a733b876f7 black-box the fn ptr, not the result 2019-06-08 18:13:16 +02:00
Cedric
4c242a948c cast vec to slices 2019-06-08 16:21:15 +02: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
Cedric
dd442a1fcf use default binding mode in match clauses 2019-06-08 13:29:43 +02:00
Ralf Jung
4567f22578 remove useless ident() functions in const tests and replace the useful ones by black_box (with a comment) 2019-06-08 12:30:52 +02:00
Cedric
4123b5d796 fix bad style for structs 2019-06-08 12:18:13 +02: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
Cedric
ad91a8e59a improve style 2019-06-08 11:38:15 +02:00
Ralf Jung
fea10c435d checktools: unify grepping the TOOLSTATE file 2019-06-08 11:32:25 +02:00
Cedric
5fb099dc78 use pattern matching for slices destructuring 2019-06-08 10:49:46 +02:00
Oliver Scherer
bafda927c3 Do not recursively visit visit_place 2019-06-08 10:24:53 +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
Yuki Okushi
1a32a68f38 Mention slice patterns 2019-06-08 16:13:15 +09: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
L117
7a74f33f90 Remove useless allocations in macro_rules follow logic. 2019-06-08 09:39:52 +10: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
Sunreal
3d6070db77
Neutralize link 2019-06-08 00:14:52 +08: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