]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoMerge pull request #1 from rust-lang/master
Sayan Nandan [Fri, 9 Aug 2019 07:31:05 +0000 (13:01 +0530)]
Merge pull request #1 from rust-lang/master

Merge recent changes into master

4 years agoImprove tests for liballoc/btree/set
Sayan Nandan [Fri, 9 Aug 2019 07:23:14 +0000 (12:53 +0530)]
Improve tests for liballoc/btree/set

4 years agoImprove tests for libcore/slice
Sayan Nandan [Fri, 9 Aug 2019 07:21:34 +0000 (12:51 +0530)]
Improve tests for libcore/slice

4 years agoImprove test output for libcore/time
Sayan Nandan [Fri, 9 Aug 2019 07:17:27 +0000 (12:47 +0530)]
Improve test output for libcore/time

4 years agoAuto merge of #63395 - Centril:rollup-kt805cj, r=Centril
bors [Thu, 8 Aug 2019 23:39:01 +0000 (23:39 +0000)]
Auto merge of #63395 - Centril:rollup-kt805cj, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #63162 (Miri tests: use xargo to build separate libstd)
 - #63289 (Don't recommend `extern crate` syntax)
 - #63373 (gitignore: add comment explaining policy)
 - #63374 (move of packed fields might or might not occur when they actually are sufficiently aligned)
 - #63381 (reduce visibility)
 - #63387 (Test interaction between `async { ... }` and `?`, `return`, and `break`)

Failed merges:

r? @ghost

4 years agoRollup merge of #63387 - Centril:async-block-control-flow-tests, r=cramertj
Mazdak Farrokhzad [Thu, 8 Aug 2019 23:38:36 +0000 (01:38 +0200)]
Rollup merge of #63387 - Centril:async-block-control-flow-tests, r=cramertj

Test interaction between `async { ... }` and `?`, `return`, and `break`

Per the second checkbox in https://github.com/rust-lang/rust/issues/62121#issuecomment-506884048, test that `async { .. }` blocks:
1. do not allow `break` expressions.
2. get targeted by `return` and not the parent function.
3. get targeted by `?` and not the parent function.

Works towards resolving blockers in #63209.

r? @cramertj

4 years agoRollup merge of #63381 - matklad:reduce-visibility, r=Centril
Mazdak Farrokhzad [Thu, 8 Aug 2019 23:38:34 +0000 (01:38 +0200)]
Rollup merge of #63381 - matklad:reduce-visibility, r=Centril

reduce visibility

r? @petrochenkov

4 years agoRollup merge of #63374 - RalfJung:pin-packed, r=cramertj
Mazdak Farrokhzad [Thu, 8 Aug 2019 23:38:33 +0000 (01:38 +0200)]
Rollup merge of #63374 - RalfJung:pin-packed, r=cramertj

move of packed fields might or might not occur when they actually are sufficiently aligned

See https://github.com/taiki-e/pin-project/pull/34, where it was pointed out that we actually don't move fields of 1-aligned types when dropping a packed struct -- but e.g. in a `packed(2)` struct, we don't do something similar for 2-aligned types. The code for that is [here](https://github.com/rust-lang/rust/blob/db7c773a6be2f050d1d1504763819ea3916f5428/src/librustc_mir/util/alignment.rs#L7).

4 years agoRollup merge of #63373 - RalfJung:gitignore, r=alexcrichton
Mazdak Farrokhzad [Thu, 8 Aug 2019 23:38:32 +0000 (01:38 +0200)]
Rollup merge of #63373 - RalfJung:gitignore, r=alexcrichton

gitignore: add comment explaining policy

Based on https://github.com/rust-lang/rust/pull/63307#issuecomment-518539503, I added a comment what I think should be gitignored and what not. This is just a proposal, obviously.  Also see https://github.com/rust-lang/rust/pull/53768 for some more discussion.

The summary is that if there are junk files that you create locally and are fine leaving around (such as `mir_dump`), git has the option for you to add them to `.git/info/exclude`. Others might prefer to keep their working dir clean of those same junk files, so we shouldn't just ignore them for everyone.

I then also cleaned up a few more things, but there were many things that I had no idea where they came from so I didn't touch them.

4 years agoRollup merge of #63289 - kornelski:missingcrate, r=zackmdavis
Mazdak Farrokhzad [Thu, 8 Aug 2019 23:38:30 +0000 (01:38 +0200)]
Rollup merge of #63289 - kornelski:missingcrate, r=zackmdavis

Don't recommend `extern crate` syntax

`extern crate` syntax is not a good recommendation any more, so I've changed it to just print a suggested crate name.

4 years agoRollup merge of #63162 - RalfJung:miri-xargo, r=alexcrichton
Mazdak Farrokhzad [Thu, 8 Aug 2019 23:38:29 +0000 (01:38 +0200)]
Rollup merge of #63162 - RalfJung:miri-xargo, r=alexcrichton

Miri tests: use xargo to build separate libstd

This uses `cargo miri setup` to prepare the libstd that is used for testing Miri, instead of adjusting the entire bootstrap process to make sure the libstd that already gets built is fit for Miri.

The issue with our current approach is that with `test-miri = true`, libstd and the test suite get built with `--cfg miri`, which e.g. means hashbrown uses no SIMD, and not all things are tested. Such global side-effects seem like footguns waiting to go off.

On the other hand, the new approach means we install xargo as a side-effect of doing `./x.py test src/tools/miri`, which might be surprising, and we also both have to build xargo and another libstd which costs some extra time. Not sure if the tools builders have enough time budget for that. Maybe there is a way to cache xargo?

We have to first first land https://github.com/rust-lang/miri/pull/870 in Miri and then update this PR to include that change (also to get CI to test Miri before bors), but I wanted to get the review started here.

Cc @oli-obk (for Miri) @alexcrichton (for CI) @Mark-Simulacrum (for bootstrap)

Fixes https://github.com/rust-lang/rust/issues/61833, fixes https://github.com/rust-lang/rust/issues/63219

4 years agoTest interaction btw async blocks and ?, return, break.
Mazdak Farrokhzad [Thu, 8 Aug 2019 20:38:26 +0000 (22:38 +0200)]
Test interaction btw async blocks and ?, return, break.

4 years agoremove confusing remark
Ralf Jung [Thu, 8 Aug 2019 19:02:11 +0000 (21:02 +0200)]
remove confusing remark

4 years agomore alphabetical
Ralf Jung [Thu, 8 Aug 2019 17:43:44 +0000 (19:43 +0200)]
more alphabetical

4 years agotweak ignores
Ralf Jung [Thu, 8 Aug 2019 17:42:46 +0000 (19:42 +0200)]
tweak ignores

4 years agoupdate miri
Ralf Jung [Thu, 8 Aug 2019 17:32:33 +0000 (19:32 +0200)]
update miri

4 years agodon't set RUSTC_DEBUG_ASSERTIONS here; let cargo-miri do that
Ralf Jung [Sat, 3 Aug 2019 15:26:01 +0000 (17:26 +0200)]
don't set RUSTC_DEBUG_ASSERTIONS here; let cargo-miri do that

4 years agoinstall and use xargo inside the build dir
Ralf Jung [Sat, 3 Aug 2019 12:30:57 +0000 (14:30 +0200)]
install and use xargo inside the build dir

4 years agolet us try to find out where that panic is coming from
Ralf Jung [Fri, 2 Aug 2019 12:20:42 +0000 (14:20 +0200)]
let us try to find out where that panic is coming from

4 years agodont test Miri by default (also be more verbose when being verbose)
Ralf Jung [Fri, 2 Aug 2019 15:56:55 +0000 (17:56 +0200)]
dont test Miri by default (also be more verbose when being verbose)

4 years agoremove test-miri from config.toml.example
Ralf Jung [Thu, 1 Aug 2019 19:06:25 +0000 (21:06 +0200)]
remove test-miri from config.toml.example

4 years agomore comments
Ralf Jung [Wed, 31 Jul 2019 13:39:30 +0000 (15:39 +0200)]
more comments

4 years agoremove test-miri flag from bootstrap
Ralf Jung [Wed, 31 Jul 2019 13:26:56 +0000 (15:26 +0200)]
remove test-miri flag from bootstrap

4 years agoMiri test: call 'cargo miri test' and use the sysroot it has set up
Ralf Jung [Wed, 31 Jul 2019 13:24:09 +0000 (15:24 +0200)]
Miri test: call 'cargo miri test' and use the sysroot it has set up

4 years agosimplify a match
Ralf Jung [Wed, 31 Jul 2019 07:01:42 +0000 (09:01 +0200)]
simplify a match

4 years agobootstrap: get rid of TEST_MIRI env var
Ralf Jung [Tue, 30 Jul 2019 19:23:59 +0000 (21:23 +0200)]
bootstrap: get rid of TEST_MIRI env var

4 years agoAuto merge of #63380 - Centril:rollup-tzfhtnu, r=Centril
bors [Thu, 8 Aug 2019 17:19:22 +0000 (17:19 +0000)]
Auto merge of #63380 - Centril:rollup-tzfhtnu, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #63261 (bump rand in libcore/liballoc test suites)
 - #63316 (Update rustfmt to 1.4.4)
 - #63332 (Add an overflow check in truncate implementation for Unix.)
 - #63342 (Don't use remap-path-prefix in dep-info files.)
 - #63366 (doc: Fix typo in float from bytes methods)
 - #63370 (Fix ICE #63364)
 - #63377 (Improved documentation for compile_error!())
 - #63379 (Add test for issue 53096)

Failed merges:

r? @ghost

4 years agoreduce visibility
Aleksey Kladov [Thu, 8 Aug 2019 14:58:06 +0000 (16:58 +0200)]
reduce visibility

4 years agoRollup merge of #63379 - jackh726:issue-53096, r=Centril,oli-obk
Mazdak Farrokhzad [Thu, 8 Aug 2019 14:33:44 +0000 (16:33 +0200)]
Rollup merge of #63379 - jackh726:issue-53096, r=Centril,oli-obk

Add test for issue 53096

Closes #53096

r? @oli-obk

4 years agoRollup merge of #63377 - SOF3:issues/63375, r=Centril
Mazdak Farrokhzad [Thu, 8 Aug 2019 14:33:43 +0000 (16:33 +0200)]
Rollup merge of #63377 - SOF3:issues/63375, r=Centril

Improved documentation for compile_error!()

Fixes #63375

4 years agoRollup merge of #63370 - JohnTitor:fix-ice-63364, r=varkor
Mazdak Farrokhzad [Thu, 8 Aug 2019 14:33:41 +0000 (16:33 +0200)]
Rollup merge of #63370 - JohnTitor:fix-ice-63364, r=varkor

Fix ICE #63364

Fixes #63364

r? @estebank cc @varkor

4 years agoRollup merge of #63366 - lzutao:fix-float-to-le-bytes-typo, r=Centril
Mazdak Farrokhzad [Thu, 8 Aug 2019 14:33:40 +0000 (16:33 +0200)]
Rollup merge of #63366 - lzutao:fix-float-to-le-bytes-typo, r=Centril

doc: Fix typo in float from bytes methods

Thanks @That3Percent for pointing it out.
r? @Centril

4 years agoRollup merge of #63342 - ehuss:remap-path-dep-info, r=alexcrichton
Mazdak Farrokhzad [Thu, 8 Aug 2019 14:33:39 +0000 (16:33 +0200)]
Rollup merge of #63342 - ehuss:remap-path-dep-info, r=alexcrichton

Don't use remap-path-prefix in dep-info files.

This changes it so that dep-info files do not use remapped paths.

Having remapped paths causes problems with Cargo because if you remap to a nonexistent path (like `/rustc/$HASH` which rustc distributions do), then Cargo's change tracking thinks the files don't exist and will always rebuild.

I don't actually know if this is a good idea. I think it makes sense, but I do not know what the exact requirements are for reproducible builds. I consider these files separate from the binary artifacts generated, and as a build-system helper, so it seems reasonable to me.

I'm also not sure if this needs a test. I'll definitely add one on the cargo side if this is merged.

Closes #63329

4 years agoRollup merge of #63332 - marmistrz:truncate, r=alexcrichton
Mazdak Farrokhzad [Thu, 8 Aug 2019 14:33:37 +0000 (16:33 +0200)]
Rollup merge of #63332 - marmistrz:truncate, r=alexcrichton

Add an overflow check in truncate implementation for Unix.

Closes #63326.
cc @alexcrichton

4 years agoRollup merge of #63316 - topecongiro:rustfmt-1.4.4, r=Mark-Simulacrum
Mazdak Farrokhzad [Thu, 8 Aug 2019 14:33:36 +0000 (16:33 +0200)]
Rollup merge of #63316 - topecongiro:rustfmt-1.4.4, r=Mark-Simulacrum

Update rustfmt to 1.4.4

The update includes bug fixes.

4 years agoRollup merge of #63261 - RalfJung:rand, r=nikomatsakis
Mazdak Farrokhzad [Thu, 8 Aug 2019 14:33:34 +0000 (16:33 +0200)]
Rollup merge of #63261 - RalfJung:rand, r=nikomatsakis

bump rand in libcore/liballoc test suites

This pulls in the fix for https://github.com/rust-random/rand/issues/779, which trips Miri when running these test suites.

`SmallRng` (formerly used by libcore) is no longer built by default, it needs a feature gate. I opted to switch to `StdRng` instead. Or should I enable the feature gate?

4 years agoMove test
Jack [Thu, 8 Aug 2019 14:13:55 +0000 (10:13 -0400)]
Move test

4 years agoAdd test for issue 53096
Jack [Thu, 8 Aug 2019 13:41:39 +0000 (09:41 -0400)]
Add test for issue 53096

4 years agoImproved documentation for compile_error!()
SOFe [Thu, 8 Aug 2019 10:05:10 +0000 (18:05 +0800)]
Improved documentation for compile_error!()

Fixes #63375

4 years agoMove the TryInto import into the inner scope
Marcin Mielniczuk [Thu, 8 Aug 2019 09:44:59 +0000 (11:44 +0200)]
Move the TryInto import into the inner scope

4 years agofix typo in .gitignore
Ralf Jung [Thu, 8 Aug 2019 09:19:44 +0000 (11:19 +0200)]
fix typo in .gitignore

Co-Authored-By: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
4 years agoCargo.toml is at the root these days
Ralf Jung [Thu, 8 Aug 2019 09:19:09 +0000 (11:19 +0200)]
Cargo.toml is at the root these days

4 years agoAuto merge of #63371 - Centril:rollup-k0xtdcz, r=Centril
bors [Thu, 8 Aug 2019 09:06:45 +0000 (09:06 +0000)]
Auto merge of #63371 - Centril:rollup-k0xtdcz, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #62994 (Add test for #43398)
 - #63259 (Add tests for some issues)
 - #63327 (doc: Reword deprecation message of MetadataExt::as_raw_stat)
 - #63331 (Test conditional initialization validation in async fns)
 - #63334 (Update to rustc-guide that passes toolstate)
 - #63353 (Update books)
 - #63360 (Use consistent capitalization in -C/-Z help)

Failed merges:

r? @ghost

4 years agomove of packed fields might or might not occur when they actually are sufficiently...
Ralf Jung [Thu, 8 Aug 2019 08:01:41 +0000 (10:01 +0200)]
move of packed fields might or might not occur when they actually are sufficiently aligned

4 years agogitignore: remove some things that look ancient
Ralf Jung [Thu, 8 Aug 2019 07:11:32 +0000 (09:11 +0200)]
gitignore: remove some things that look ancient

4 years agowe don't clutter the src/ dir any more
Ralf Jung [Thu, 8 Aug 2019 07:04:37 +0000 (09:04 +0200)]
we don't clutter the src/ dir any more

4 years agoexplain what we want and what not in .gitignore
Ralf Jung [Thu, 8 Aug 2019 06:49:58 +0000 (08:49 +0200)]
explain what we want and what not in .gitignore

4 years agoRollup merge of #63360 - brson:cz-help, r=Mark-Simulacrum
Mazdak Farrokhzad [Thu, 8 Aug 2019 05:35:39 +0000 (07:35 +0200)]
Rollup merge of #63360 - brson:cz-help, r=Mark-Simulacrum

Use consistent capitalization in -C/-Z help

This code could also use a pass to consistify the grammar, but not by me atm.

4 years agoRollup merge of #63353 - ehuss:update-books, r=ehuss
Mazdak Farrokhzad [Thu, 8 Aug 2019 05:35:38 +0000 (07:35 +0200)]
Rollup merge of #63353 - ehuss:update-books, r=ehuss

Update books

## nomicon

1 commits in b7f0aba2f88a8feade70595efcfa3438e54e96c0..8a7d05615e5bc0a7fb961b4919c44f5221ee54da
2019-07-11 15:11:36 -0400 to 2019-08-07 07:46:59 -0500
- s/railguard/guardrail/ (rust-lang-nursery/nomicon#156)

## reference

5 commits in 8e7d614303b0dec7492e048e63855fcd3b944ec8..b4b3536839042a6743fc76f0d9ad2a812020aeaa
2019-07-16 21:02:33 +0100 to 2019-08-07 02:29:50 +0200
- Update partially initialized values in drop documentation. (rust-lang-nursery/reference#648)
- Define sound and unsound (rust-lang-nursery/reference#647)
- Fix a type in the modules section: functions =&gt; modules (rust-lang-nursery/reference#645)
- Fix some links. (rust-lang-nursery/reference#642)
- Update recursion_limit default limit (rust-lang-nursery/reference#633)

## rust-by-example

14 commits in e3679e214d8db44586aca9b20aa27517007d1923..f2c15ba5ee89ae9469a2cf60494977749901d764
2019-07-15 11:13:44 -0300 to 2019-08-07 10:14:25 -0300
- Remove redundant semicolons (rust-lang/rust-by-example#1239)
- Rename "Read Lines" chapter title (rust-lang/rust-by-example#1230)
- Added space between word and inline code block in unit_testing.md (rust-lang/rust-by-example#1237)
- [typo] fix unit_testing wrong output (rust-lang/rust-by-example#1210)
- flow_control/match/binding.md: `...' -&gt; `..=' (rust-lang/rust-by-example#1233)
- generics/impl.md: follow rustfmt style (rust-lang/rust-by-example#1236)
- freeze.md: Incorrect example (rust-lang/rust-by-example#1226)
- Make `point` consistent (rust-lang/rust-by-example#1229)
- Fix typo at error -&gt; panic (rust-lang/rust-by-example#1227)
- Snake didn't deserve to die 🐍 (rust-lang/rust-by-example#1228)
- Reorder links in destructuring.md (rust-lang/rust-by-example#1225)
- Rename variable names for consistent in iter_result.md (rust-lang/rust-by-example#1224)
- Fix several shell output and code highlights. (rust-lang/rust-by-example#1222)
- Add new example for Rc. (rust-lang/rust-by-example#1223)

## edition-guide

5 commits in f6c8b92d4e63edd28e862be952f33861f35956f8..e58bc4ca104e890ac56af846877c874c432a64b5
2019-07-06 22:10:32 +0200 to 2019-07-31 20:14:12 +0200
- Hide extraneous `use` in anonymous lifetime example. (rust-lang-nursery/edition-guide#190)
- Attempt to clarify "no more mod.rs". (rust-lang-nursery/edition-guide#187)
- Remove -preview for rustup components. (rust-lang-nursery/edition-guide#188)
- rust-lang-nursery/edition-guide#184 More clear explanation and Title. (rust-lang-nursery/edition-guide#185)
- More clear table headers (rust-lang-nursery/edition-guide#186)

## embedded-book

2 commits in ff334e74fdb9f197e621efa6d7c3105be892e888..c5da1e11915d3f28266168baaf55822f7e3fe999
2019-07-16 13:47:34 +0000 to 2019-08-05 23:02:10 +0000
- install/verify: fix next section link  (rust-embedded/book#202)
- Syst small fix  (rust-embedded/book#198)

4 years agoRollup merge of #63334 - mark-i-m:fix-guide, r=ehuss
Mazdak Farrokhzad [Thu, 8 Aug 2019 05:35:36 +0000 (07:35 +0200)]
Rollup merge of #63334 - mark-i-m:fix-guide, r=ehuss

Update to rustc-guide that passes toolstate

r? @ehuss

Sorry for the trouble. I've been somewhat hard to reach lately. Thanks for your help!

4 years agoRollup merge of #63331 - gorup:conditionalinit, r=cramertj
Mazdak Farrokhzad [Thu, 8 Aug 2019 05:35:35 +0000 (07:35 +0200)]
Rollup merge of #63331 - gorup:conditionalinit, r=cramertj

Test conditional initialization validation in async fns

r? @cramertj

Per [paper doc](https://paper.dropbox.com/doc/async.await-Call-for-Tests--AiWF2Nt8tgDiA70qFI~oiLOOAg-nMyZGrra7dz9KcFRMLKJy) calling for async/.await tests, tests are desired for conditionally initialized local variables. This PR hopes to provide tests for that.

#63294 seems to be tracking the items from the paper doc that this PR is related to
#62121 is an open issue asking for more async/.await tests that this relates to

---
:+1: executed 2 new tests
:+1: tidy

4 years agoRollup merge of #63327 - lzutao:fix-as_raw_stat-dep-msg, r=Mark-Simulacrum
Mazdak Farrokhzad [Thu, 8 Aug 2019 05:35:33 +0000 (07:35 +0200)]
Rollup merge of #63327 - lzutao:fix-as_raw_stat-dep-msg, r=Mark-Simulacrum

doc: Reword deprecation message of MetadataExt::as_raw_stat

Closes #62711
r? @Mark-Simulacrum

4 years agoRollup merge of #63259 - JohnTitor:add-tests-for-some-issues, r=Centril
Mazdak Farrokhzad [Thu, 8 Aug 2019 05:35:32 +0000 (07:35 +0200)]
Rollup merge of #63259 - JohnTitor:add-tests-for-some-issues, r=Centril

Add tests for some issues

Closes #29265
Closes #37433
Closes #49544

r? @Centril

4 years agoRollup merge of #62994 - iluuu1994:test-for-43398, r=nikomatsakis
Mazdak Farrokhzad [Thu, 8 Aug 2019 05:35:30 +0000 (07:35 +0200)]
Rollup merge of #62994 - iluuu1994:test-for-43398, r=nikomatsakis

Add test for #43398

Closes #43398

4 years agoAuto merge of #63282 - Xanewok:update-rls, r=nikomatsakis
bors [Thu, 8 Aug 2019 05:28:07 +0000 (05:28 +0000)]
Auto merge of #63282 - Xanewok:update-rls, r=nikomatsakis

Update RLS

Most importantly this includes:
* Collect file -> edition mapping after AST expansion ([#1513](https://github.com/rust-lang/rls/pull/1513)) (enabled by https://github.com/rust-lang/rust/pull/62679)
* Fix rustfmt during builds by reading edition from manifest ([#1533](https://github.com/rust-lang/rls/pull/1533))

Which fixes the annoying problem where users couldn't format via RLS while `cargo fmt` worked.

The beta cut-off is drawing near and I'd like to make sure this lands before then.

4 years agoReturn early to avoid failing assertion
Yuki Okushi [Thu, 8 Aug 2019 04:38:23 +0000 (13:38 +0900)]
Return early to avoid failing assertion

4 years agodoc: Fix typo in float from bytes methods
Lzu Tao [Thu, 8 Aug 2019 01:53:30 +0000 (01:53 +0000)]
doc: Fix typo in float from bytes methods

4 years agoAuto merge of #63363 - ehuss:update-cargo, r=alexcrichton
bors [Thu, 8 Aug 2019 01:48:31 +0000 (01:48 +0000)]
Auto merge of #63363 - ehuss:update-cargo, r=alexcrichton

Update cargo

9 commits in 26092da337b948719549cd5ed3d1051fd847afd7..42a8c0adf91323c01228268c651aef5366b25b69
2019-07-31 23:24:32 +0000 to 2019-08-07 20:41:07 +0000
- Add support for customizing JSON diagnostics from Cargo (rust-lang/cargo#7214)
- Bump rustfix (rust-lang/cargo#7221)
- Fix remap-path-prefix from failing. (rust-lang/cargo#7219)
- Clean up build script stuff and documentation. (rust-lang/cargo#7215)
- Remove debug panic in package-features. (rust-lang/cargo#7213)
- Fix an old test. (rust-lang/cargo#7208)
- Remove unused AstBuilder (rust-lang/cargo#7210)
- Revert "Release a jobserver token while locking a file" (rust-lang/cargo#7201)
- improve error message for unmatched prerelease dependencies (rust-lang/cargo#7191)

4 years agoUpdate cargo
Eric Huss [Thu, 8 Aug 2019 00:23:54 +0000 (17:23 -0700)]
Update cargo

4 years agoAuto merge of #62457 - zackmdavis:minimax_search_and_the_structure_of_cognition,...
bors [Wed, 7 Aug 2019 22:07:24 +0000 (22:07 +0000)]
Auto merge of #62457 - zackmdavis:minimax_search_and_the_structure_of_cognition, r=varkor

pretty-pretty extremal constants!

(A resurrection of the defunct #57073.)

While many programmers may intuitively appreciate the significance of "magic numbers" like −2147483648, Rust is about empowering everyone to build reliable and efficient software! It's a bit more legible to print the constant names (even noisy fully-qualified-paths thereof).

The bit-manipulation methods mirror those in `librustc_mir::hair::pattern::_match::all_constructors`; thanks to the immortal Varkor for guidance.

Resolves #56393.

r? @varkor

4 years agoUse consistent capitalization in -C/-Z help
Brian Anderson [Wed, 7 Aug 2019 21:51:49 +0000 (14:51 -0700)]
Use consistent capitalization in -C/-Z help

4 years agoAuto merge of #60547 - redox-os:redox-unix, r=alexcrichton
bors [Wed, 7 Aug 2019 16:56:46 +0000 (16:56 +0000)]
Auto merge of #60547 - redox-os:redox-unix, r=alexcrichton

redox: convert to target_family unix

This is the second step to supporting rust-lang/rust#60139.

In order to have a smooth transition, there will need to be a change made in liblibc at the same time, switching Redox over to the unix target family. See https://github.com/rust-lang/libc/pull/1332

4 years agoUpdate books
Eric Huss [Wed, 7 Aug 2019 16:44:12 +0000 (09:44 -0700)]
Update books

4 years agoAuto merge of #63280 - lzutao:update-clippy, r=Mark-Simulacrum
bors [Wed, 7 Aug 2019 13:15:53 +0000 (13:15 +0000)]
Auto merge of #63280 - lzutao:update-clippy, r=Mark-Simulacrum

submodules: Update clippy

r? @Manishearth
Fixes clippy toolstate in https://github.com/rust-lang/rust/pull/63228#issuecomment-517886963

4 years agoAuto merge of #61919 - alexreg:fix-atb-1, r=nikomatsakis
bors [Wed, 7 Aug 2019 09:33:34 +0000 (09:33 +0000)]
Auto merge of #61919 - alexreg:fix-atb-1, r=nikomatsakis

Fix for "ambiguous associated type" issue with ATBs

Fixes #61752.

r? @nikomatsakis

CC @Centril

4 years agosubmodules: Update clippy
Lzu Tao [Wed, 7 Aug 2019 08:59:36 +0000 (08:59 +0000)]
submodules: Update clippy

4 years agoAuto merge of #63152 - estebank:big-array, r=oli-obk
bors [Wed, 7 Aug 2019 04:28:08 +0000 (04:28 +0000)]
Auto merge of #63152 - estebank:big-array, r=oli-obk

Always error on `SizeOverflow` during mir evaluation

Fix #55878, fix #25116.

r? @oli-obk

4 years agopretty-pretty extremal constants!
Zack M. Davis [Sun, 7 Jul 2019 02:41:12 +0000 (19:41 -0700)]
pretty-pretty extremal constants!

While many programmers may intuitively appreciate the significance of
"magic numbers" like −2147483648, Rust is about empowering everyone to
build reliable and efficient software! It's a bit more legible to
print the constant names (even noisy fully-qualified-paths thereof).

The bit-manipulation methods mirror those in
`librustc_mir::hair::pattern::_match::all_constructors`; thanks to the
immortal Varkor for guidance.

Resolves #56393.

4 years agoFix cfg_if usage
Jeremy Soller [Wed, 7 Aug 2019 01:32:39 +0000 (19:32 -0600)]
Fix cfg_if usage

4 years agoAuto merge of #63341 - Centril:rollup-hkhxahb, r=Centril
bors [Wed, 7 Aug 2019 00:45:00 +0000 (00:45 +0000)]
Auto merge of #63341 - Centril:rollup-hkhxahb, r=Centril

Rollup of 9 pull requests

Successful merges:

 - #63034 (Fix generator size regressions due to optimization)
 - #63035 (Use MaybeUninit to produce more correct layouts)
 - #63163 (add a pair of whitespace after remove parentheses)
 - #63294 (tests for async/await drop order)
 - #63307 (don't ignore mir_dump folder)
 - #63308 (PlaceRef's base is already a reference)
 - #63310 (Tests around moving parts of structs and tuples across await points)
 - #63314 (doc: the content has since been moved to the guide)
 - #63333 (Remove unnecessary features from compiler error code list)

Failed merges:

r? @ghost

4 years agoDon't use remap-path-prefix in dep-info files.
Eric Huss [Wed, 7 Aug 2019 00:39:22 +0000 (17:39 -0700)]
Don't use remap-path-prefix in dep-info files.

4 years agoreview comment: reword test comment
Esteban Küber [Tue, 6 Aug 2019 23:51:17 +0000 (16:51 -0700)]
review comment: reword test comment

4 years agoTest conditional initialization validation in async fns
Ryan Gorup [Tue, 6 Aug 2019 16:54:30 +0000 (09:54 -0700)]
Test conditional initialization validation in async fns

4 years agoRollup merge of #63333 - jethrogb:jb/error-codes-features, r=Mark-Simulacrum
Mazdak Farrokhzad [Tue, 6 Aug 2019 23:39:38 +0000 (01:39 +0200)]
Rollup merge of #63333 - jethrogb:jb/error-codes-features, r=Mark-Simulacrum

Remove unnecessary features from compiler error code list

4 years agoRollup merge of #63314 - tshepang:update-src-readme, r=matthewjasper
Mazdak Farrokhzad [Tue, 6 Aug 2019 23:39:36 +0000 (01:39 +0200)]
Rollup merge of #63314 - tshepang:update-src-readme, r=matthewjasper

doc: the content has since been moved to the guide

4 years agoRollup merge of #63310 - gorup:partial-moves, r=cramertj
Mazdak Farrokhzad [Tue, 6 Aug 2019 23:39:35 +0000 (01:39 +0200)]
Rollup merge of #63310 - gorup:partial-moves, r=cramertj

Tests around moving parts of structs and tuples across await points

r? cramertj

Per the [dropbox paper](https://paper.dropbox.com/doc/async.await-Call-for-Tests--AiR3vlp1s_Kw0yzWZ1sWMnaIAQ-nMyZGrra7dz9KcFRMLKJy) about more tests, it appears there are some tests wanted around local variables (under the section ["Dynamic semantics"](https://paper.dropbox.com/doc/async.await-Call-for-Tests--AiR3vlp1s_Kw0yzWZ1sWMnaIAg-nMyZGrra7dz9KcFRMLKJy#:uid=122335511260129643493892&h2=Dynamic-semantics)). Here is one commit, and I can probably get code up for other scenarios listed there, although I may not have the full background to know what is being targeted by the tests. Please assist me if I'm off course, thanks!

---
- Executed all 4 new tests
- Executed `tidy` command

4 years agoRollup merge of #63308 - spastorino:place-ref-base-is-ref, r=oli-obk
Mazdak Farrokhzad [Tue, 6 Aug 2019 23:39:33 +0000 (01:39 +0200)]
Rollup merge of #63308 - spastorino:place-ref-base-is-ref, r=oli-obk

PlaceRef's base is already a reference

r? @oli-obk

4 years agoRollup merge of #63307 - RalfJung:gitignore, r=alexcrichton
Mazdak Farrokhzad [Tue, 6 Aug 2019 23:39:32 +0000 (01:39 +0200)]
Rollup merge of #63307 - RalfJung:gitignore, r=alexcrichton

don't ignore mir_dump folder

I dumped some MIR and wondered why `git status` wouldn't show the tree as dirty, reminding me to clean up after myself. Turns out this folder was explicitly gitignored. I don't think it should be.

If someone doesn't want to clean up that way, they can add it to `.git/info/exclude`.

(That file seems like it could need some general cleanup, honestly, but that's for another day.)

4 years agoRollup merge of #63294 - alsuren:async-tests, r=cramertj
Mazdak Farrokhzad [Tue, 6 Aug 2019 23:39:30 +0000 (01:39 +0200)]
Rollup merge of #63294 - alsuren:async-tests, r=cramertj

tests for async/await drop order

This is just me helping out with https://github.com/rust-lang/rust/issues/62121 where I can.

I'm also going to use this as a public place to collect my thoughts about what has already been done and what hasn't (adding comments to the dropbox paper doc was quickly getting spammy).

I've tried to keep my commit messages similar to the line items on https://paper.dropbox.com/doc/async.await-Call-for-Tests--AiKouT0L41mSnK1741s~TiiRAg-nMyZGrra7dz9KcFRMLKJy as possible.

A bunch of my tests are likely to be either redundant with other tests, or lower quality than other tests that people are writing. A reasonable approach might be to tell me which commits you want to keep and I'll throw away the rest of them.

The part from the dropbox paper doc that I'm concentrating on here is:
(items marked with `?` are ones that I can't immediately think of how to test, so I will leave for other people. Items with checkboxes are things that I have done or will try to do next)

### Dynamic semantics
- `async`/`await` with unusual locals:
    - ? partially uninhabited
    - ? conditionally initialized
    - ~drop impls~ already done in src/test/ui/async-await/drop-order/*
    - ? nested drop impls
    - ~partially moved (e.g., `let x = (vec![], vec![]); drop(x.0); foo.await; drop(x.1);`)~ see  https://github.com/rust-lang/rust/pull/63310
- Control flow:
    - basic
    - complex
- [x] `.await` while holding variables of different sizes
- (possibly) drop order
    - [x] including drop order for locals when a future is dropped part-way through execution
         - Parameters' drop order is covered in my commit f40190a
    - ~An async fn version of `dynamic-drop.rs`~
        - already done by matthewjasper in https://github.com/rust-lang/rust/pull/62193/files
- ? interaction with const eval, promoteds, and temporaries
- [x] drop the resulting future and check that local variables and parameters are dropped in the expected order (interaction with cancellation, in other words)
    - also in f40190a

Explanation of commits:

0a1bdd4 is the simplest place I could think of to explicitly test `.await` while holding variables of different sizes. I'm pretty sure that this will end up being redundant with something else, so I'm happy to drop it.
f40190a is a copy-paste from `drop-order-for-async-fn-parameters.rs` with `NeverReady.await` dumped on the end of each testcase.
    * Normally I don't like copy-paste-based tests, but `drop-order-for-async-fn-parameters-by-ref-binding.rs` is also copy-paste, so I thought it might be okay.
    * [x] I'm a bit sad that this doesn't cover non-parameter locals, but I think it should be easy enough to extend in that direction, so I might have a crack at that tomorrow.
c4940e0f90 makes a bunch of local variables and moves them into either `{}` blocks or `async move {}` blocks, checking for any surprising differences.
    * I have tried to give the test functions descriptive names
    * I have not duplicated the tests for methods with/without self.
    * I think that all of these tests could be rewritten to be clearer if I could write down the expected drop order next to each test.

4 years agoRollup merge of #63163 - bravomikekilo:master, r=cramertj
Mazdak Farrokhzad [Tue, 6 Aug 2019 23:39:28 +0000 (01:39 +0200)]
Rollup merge of #63163 - bravomikekilo:master, r=cramertj

add a pair of whitespace after remove parentheses

fix [issue-63156](https://github.com/rust-lang/rust/issues/63156).
add a pair of whitespace after remove parentheses.

4 years agoRollup merge of #63034 - tmandry:reduce-generator-size-regressions, r=cramertj
Mazdak Farrokhzad [Tue, 6 Aug 2019 23:39:25 +0000 (01:39 +0200)]
Rollup merge of #63034 - tmandry:reduce-generator-size-regressions, r=cramertj

Fix generator size regressions due to optimization

I tested the generator optimizations in #60187 and #61922 on the Fuchsia
build, and noticed that some small generators (about 8% of the async fns
in our build) increased in size slightly.

This is because in #60187 we split the fields into two groups, a
"prefix" non-overlap region and an overlap region, and lay them out
separately. This can introduce unnecessary padding bytes between the two
groups.

In every single case in the Fuchsia build, it was due to there being
only a single variant being used in the overlap region. This means that
we aren't doing any overlapping, period. So it's better to combine the
two regions into one and lay out all the fields at once, which is what
this change does.

r? @cramertj
cc @eddyb @Zoxc

4 years agopassify tidy
Mark Mansi [Tue, 6 Aug 2019 22:19:01 +0000 (17:19 -0500)]
passify tidy

4 years agoredox: convert to target_family unix
Jeremy Soller [Sun, 7 Apr 2019 14:39:54 +0000 (08:39 -0600)]
redox: convert to target_family unix

4 years agoFix generator size regressions due to optimization
Tyler Mandry [Sat, 27 Jul 2019 00:13:14 +0000 (17:13 -0700)]
Fix generator size regressions due to optimization

I tested the generator optimizations in #60187 and #61922 on the Fuchsia
build, and noticed that some small generators (about 8% of the async fns
in our build) increased in size slightly.

This is because in #60187 we split the fields into two groups, a
"prefix" non-overlap region and an overlap region, and lay them out
separately. This can introduce unnecessary padding bytes between the two
groups.

In every single case in the Fuchsia build, it was due to there being
only a single variant being used in the overlap region. This means that
we aren't doing any overlapping, period. So it's better to combine the
two regions into one and lay out all the fields at once, which is what
this change does.

4 years agoAuto merge of #63320 - RalfJung:miri, r=oli-obk
bors [Tue, 6 Aug 2019 21:05:10 +0000 (21:05 +0000)]
Auto merge of #63320 - RalfJung:miri, r=oli-obk

bump Miri

r? @oli-obk

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

4 years agoupdate to rustc-guide that passes toolstate
Mark Mansi [Tue, 6 Aug 2019 18:53:51 +0000 (13:53 -0500)]
update to rustc-guide that passes toolstate

4 years agoreview comments
Esteban Küber [Tue, 6 Aug 2019 18:23:32 +0000 (11:23 -0700)]
review comments

4 years agoRemove unnecessary features from compiler error code list
Jethro Beekman [Tue, 6 Aug 2019 17:49:45 +0000 (10:49 -0700)]
Remove unnecessary features from compiler error code list

4 years agoAdd an overflow check in truncate implementation for Unix.
Marcin Mielniczuk [Tue, 6 Aug 2019 17:34:10 +0000 (19:34 +0200)]
Add an overflow check in truncate implementation for Unix.

4 years agomove error with diverging output to compile-fail
Esteban Küber [Tue, 6 Aug 2019 17:28:09 +0000 (10:28 -0700)]
move error with diverging output to compile-fail

4 years agoAuto merge of #61515 - shepmaster:boxed-slice-to-array, r=cramertj
bors [Tue, 6 Aug 2019 17:19:05 +0000 (17:19 +0000)]
Auto merge of #61515 - shepmaster:boxed-slice-to-array, r=cramertj

Add implementations for converting boxed slices into boxed arrays

This mirrors the implementations of reference slices into arrays.

# Discussion

- [x] Should we use const generics? ([probably not](https://github.com/rust-lang/rust/pull/61515#issuecomment-498690649))
- [ ] [What's the safety rationale here](https://github.com/rust-lang/rust/pull/61515#discussion_r290296613)?
- [ ] [Should the errors return the original object](https://github.com/rust-lang/rust/pull/61515#discussion_r290336592)?

# Remaining

- [ ] Implement `Error`
- [ ] Create a tracking issue

4 years agotest drop order for locals when a future is dropped part-way through execution
David Laban [Tue, 6 Aug 2019 14:20:47 +0000 (15:20 +0100)]
test drop order for locals when a future is dropped part-way through execution

4 years agoAuto merge of #63328 - Centril:rollup-482ujaf, r=Centril
bors [Tue, 6 Aug 2019 13:37:22 +0000 (13:37 +0000)]
Auto merge of #63328 - Centril:rollup-482ujaf, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #62459 (Use internal iteration in the Sum and Product impls of Result and Option)
 - #62821 (Not listed methods)
 - #62837 (Fix theme picker blur handler: always hide instead of switching)
 - #63286 (Replace error callback with Result)
 - #63296 (Deduplicate rustc_demangle in librustc_codegen_llvm)
 - #63298 (assume_init: warn about valid != safe)

Failed merges:

r? @ghost

4 years agoRollup merge of #63298 - RalfJung:assume_init, r=Mark-Simulacrum,Centril
Mazdak Farrokhzad [Tue, 6 Aug 2019 13:36:35 +0000 (15:36 +0200)]
Rollup merge of #63298 - RalfJung:assume_init, r=Mark-Simulacrum,Centril

assume_init: warn about valid != safe

We have this warning in the type-level docs, but it seems worth repeating it on the function.

4 years agoRollup merge of #63296 - alexcrichton:deduplicate-demangle, r=Mark-Simulacrum
Mazdak Farrokhzad [Tue, 6 Aug 2019 13:36:34 +0000 (15:36 +0200)]
Rollup merge of #63296 - alexcrichton:deduplicate-demangle, r=Mark-Simulacrum

Deduplicate rustc_demangle in librustc_codegen_llvm

This commit removes the crates.io dependency of `rustc-demangle` from
`rustc_codegen_llvm`. This crate is actually already pulled in to part
of the `librustc_driver` build and with the upcoming pipelining
implementation in Cargo it causes build issues if `rustc-demangle` is
left to its own devices.

This is not currently required, but once pipelining is enabled for
rustc's own build it will be required to build correctly.

4 years agoRollup merge of #63286 - Mark-Simulacrum:resolve-no-cb, r=petrochenkov
Mazdak Farrokhzad [Tue, 6 Aug 2019 13:36:32 +0000 (15:36 +0200)]
Rollup merge of #63286 - Mark-Simulacrum:resolve-no-cb, r=petrochenkov

Replace error callback with Result

r? @petrochenkov

4 years agoRollup merge of #62837 - Kinrany:patch-1, r=GuillaumeGomez
Mazdak Farrokhzad [Tue, 6 Aug 2019 13:36:30 +0000 (15:36 +0200)]
Rollup merge of #62837 - Kinrany:patch-1, r=GuillaumeGomez

Fix theme picker blur handler: always hide instead of switching

Fixes a minor bug in UI generated by rustdoc.

For example, this page: https://doc.rust-lang.org/std/

Reproduction steps:
1. Click the theme picker twice
   * The list of themes will be shown and then hidden
2. Click anywhere else
   * The list of themes will be show again, which is unexpected

The bug was caused by blur event handler toggling the state of the element instead of always hiding it regardless of the current state.

4 years agoRollup merge of #62821 - GuillaumeGomez:not-listed-methods, r=Mark-Simulacrum
Mazdak Farrokhzad [Tue, 6 Aug 2019 13:36:28 +0000 (15:36 +0200)]
Rollup merge of #62821 - GuillaumeGomez:not-listed-methods, r=Mark-Simulacrum

Not listed methods

Fixes #60326.

cc @rust-lang/rustdoc
r? @QuietMisdreavus

4 years agoRollup merge of #62459 - timvermeulen:result_sum_internal_iteration, r=scottmcm
Mazdak Farrokhzad [Tue, 6 Aug 2019 13:36:27 +0000 (15:36 +0200)]
Rollup merge of #62459 - timvermeulen:result_sum_internal_iteration, r=scottmcm

Use internal iteration in the Sum and Product impls of Result and Option

This PR adds internal iteration to the `ResultShunt` iterator type underlying the `Sum` and `Product` impls of `Result`. I had to change `ResultShunt` to hold a mutable reference to an error instead, similar to `itertools::ProcessResults`, in order to be able to pass the `ResultShunt` itself by value (which is necessary for internal iteration).

`ResultShunt::process` can unfortunately no longer be an associated function because that would make it generic over the lifetime of the error reference, which wouldn't work, so I turned it into the free function `process_results`.

I removed the `OptionShunt` type and forwarded the `Sum` and `Product` impls of `Option` to their respective impls of `Result` instead, to avoid having to repeat the internal iteration logic.

4 years agodoc: Reword deprecation message of MetadataExt::as_raw_stat
Lzu Tao [Tue, 6 Aug 2019 13:32:08 +0000 (13:32 +0000)]
doc: Reword deprecation message of MetadataExt::as_raw_stat