bors [Mon, 10 Jun 2019 11:15:07 +0000 (11:15 +0000)]
Auto merge of #61716 - Centril:rollup-nxwf5ol, r=Centril
Rollup of 5 pull requests
Successful merges:
- #59600 (Replaced linear token counting macros with optimized implementation)
- #61501 (get rid of real_intrinsics module)
- #61570 (Fix issues with const argument inference)
- #61683 (Haiku: the maximum stack size is 16 MB)
- #61697 (submodules: update clippy from 71be6f62 to c0dbd34b)
Rollup merge of #61683 - nielx:haiku-stack-limit, r=nagisa
Haiku: the maximum stack size is 16 MB
This keeps the compiler from crashing every time it is invoked. No functional change on other platforms.
This patch is similar to the limitation that is in the [librustdoc/lib.rs](https://github.com/rust-lang/rust/blob/57e13e0325c1d41161a31de1f8520538ec2c575c/src/librustdoc/lib.rs#L89).
Replaced linear token counting macros with optimized implementation
There are currently two distinct token-counting macros in the source. Both implement the trivial algorithm, with linear complexity. They may or may not be adequate for their use case, but considering that other people are probably going to copy and paste them whenever they need a token-counting macro, I replaced them with an optimized implementation with logarithmic complexity.
When one tries to create a thread with a requested stack size larger
than 16 MB, the call will fail and the compiler will bail out. Therefore
we should limit the size of the thread stack to 16 MB on Haiku.
bors [Mon, 10 Jun 2019 02:35:29 +0000 (02:35 +0000)]
Auto merge of #61706 - petrhosek:bootstrap-cp-r, r=Mark-Simulacrum
Use Build::read_dir instead of fs::read_dir in Build::cp_r
Build::read_dir does better error handling when the directory doesn't
exist; it actually prints the name of the directory rather than just
printing the underlying error "No such file or directory" which on
its own isn't very useful.
Petr Hosek [Sun, 9 Jun 2019 23:57:17 +0000 (16:57 -0700)]
Use Build::read_dir instead of fs::read_dir in Build::cp_r
Build::read_dir does better error handling when the directory doesn't
exist; it actually prints the name of the directory rather than just
printing the underlying error "No such file or directory" which on
its own isn't very useful.
Crater will be needed (done in https://github.com/rust-lang/rust/pull/60932#issuecomment-494188577, zero regressions) and then, if all goes well, FCP (in https://github.com/rust-lang/rust/pull/60932#issuecomment-494189802).
bors [Sun, 9 Jun 2019 02:07:44 +0000 (02:07 +0000)]
Auto merge of #61653 - oli-obk:visit_place_recursion, r=spastorino
get rid of visit_place recursion
r? @spastorino
this is groundwork for https://github.com/rust-lang/rust/pull/60913, since after that PR we won't be able to implement `visit_place` in a recursive manner without heavy cloning everywhere.
Rollup merge of #61670 - Xanewok:update-rls, r=oli-obk
Update RLS
This bumps the version to 1.37 and also doesn't build clippy by default (should reduce toolstate breakages, see https://github.com/rust-lang/rust/issues/59761#issuecomment-498616465 for more details)
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.
bors [Sat, 8 Jun 2019 17:44:12 +0000 (17:44 +0000)]
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.
bors [Sat, 8 Jun 2019 07:20:57 +0000 (07:20 +0000)]
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.~~
bors [Sat, 8 Jun 2019 01:34:53 +0000 (01:34 +0000)]
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)
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`.
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
bors [Fri, 7 Jun 2019 18:26:15 +0000 (18:26 +0000)]
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`.
bors [Fri, 7 Jun 2019 14:50:22 +0000 (14:50 +0000)]
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)
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.
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.
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.
bors [Fri, 7 Jun 2019 09:41:06 +0000 (09:41 +0000)]
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.