]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #65689 - RalfJung:miri-debug, r=Centril
Yuki Okushi [Wed, 23 Oct 2019 08:14:44 +0000 (17:14 +0900)]
Rollup merge of #65689 - RalfJung:miri-debug, r=Centril

bring back some Debug instances for Miri

These were erroneously removed in https://github.com/rust-lang/rust/pull/65647, but Miri needs them.

r? @Centril Cc @nnethercote @oli-obk

4 years agoRollup merge of #65688 - JohnTitor:add-some-tests, r=Dylan-DPC
Yuki Okushi [Wed, 23 Oct 2019 08:14:43 +0000 (17:14 +0900)]
Rollup merge of #65688 - JohnTitor:add-some-tests, r=Dylan-DPC

Add some tests for fixed ICEs

Fixes #41366 from 1.35.0
Fixes #51431 from 1.31.0-nightly (77af31408 2018-10-11) (on my local)
Fixes #52437 from nightly
Fixes #63496 from nightly

r? @Centril

4 years agoRollup merge of #65686 - yjhmelody:yjhmelody-patch-1, r=Centril
Yuki Okushi [Wed, 23 Oct 2019 08:14:42 +0000 (17:14 +0900)]
Rollup merge of #65686 - yjhmelody:yjhmelody-patch-1, r=Centril

refactor and move `maybe_append`

4 years agoRollup merge of #65681 - sunfishcode:followup, r=Centril
Yuki Okushi [Wed, 23 Oct 2019 08:14:40 +0000 (17:14 +0900)]
Rollup merge of #65681 - sunfishcode:followup, r=Centril

Code cleanups following up on #65576.

This makes a few code cleanups to follow up on the review comments in
https://github.com/rust-lang/rust/pull/65576.

r? @Centril

4 years agoRollup merge of #65678 - JohnTitor:add-e0728-explanation, r=GuilliaumeGomez
Yuki Okushi [Wed, 23 Oct 2019 08:14:39 +0000 (17:14 +0900)]
Rollup merge of #65678 - JohnTitor:add-e0728-explanation, r=GuilliaumeGomez

Add long error explanation for E0728

Part of #61137

r? @GuillaumeGomez

4 years agoRollup merge of #65656 - GuillaumeGomez:option-disable-shortcut, r=Dylan-DPC
Yuki Okushi [Wed, 23 Oct 2019 08:14:37 +0000 (17:14 +0900)]
Rollup merge of #65656 - GuillaumeGomez:option-disable-shortcut, r=Dylan-DPC

Add option to disable keyboard shortcuts in docs

Fixes #65211.

r? @Manishearth

4 years agoRollup merge of #65617 - newpavlov:patch-2, r=alexcrichton
Yuki Okushi [Wed, 23 Oct 2019 08:14:36 +0000 (17:14 +0900)]
Rollup merge of #65617 - newpavlov:patch-2, r=alexcrichton

Fix WASI sleep impl

Closes #65607

@sunfishcode
Is it fine to use 0 for the `identifier` field? What is this field used for?

4 years agoRollup merge of #65591 - GuillaumeGomez:long-err-explanation-E0588, r=Dylan-DPC
Yuki Okushi [Wed, 23 Oct 2019 08:14:34 +0000 (17:14 +0900)]
Rollup merge of #65591 - GuillaumeGomez:long-err-explanation-E0588, r=Dylan-DPC

Add long error explanation for E0588

Part of #61137.

r? @kinnison

4 years agoRollup merge of #65507 - polyedre:master, r=nikomatsakis
Yuki Okushi [Wed, 23 Oct 2019 08:14:33 +0000 (17:14 +0900)]
Rollup merge of #65507 - polyedre:master, r=nikomatsakis

Fix test style in unused parentheses lint test

I think this fixes #63237
I'm not sure if I had to add text after the `//~ ERROR` comments.
This is my first pull request, so I'm open to feedback.
This issues already received one pull request [here](https://github.com/rust-lang/rust/pull/63257) but it was marked as closed for inactivity.

r?  @nikomatsakis

4 years agoRollup merge of #65417 - weiznich:more_coherence_tests, r=nikomatsakis
Yuki Okushi [Wed, 23 Oct 2019 08:14:31 +0000 (17:14 +0900)]
Rollup merge of #65417 - weiznich:more_coherence_tests, r=nikomatsakis

Add more coherence tests

I've wrote the missing test cases listed in [this google doc](https://docs.google.com/spreadsheets/d/1WlroTEXE6qxxGvEOhICkUpqguYZP9YOZEvnmEtSNtM0/edit#gid=0)

> The other thing that might be useful is to rename the existing tests so they all fit the new naming scheme we were using.

I'm not entirely sure how to do this. If everything from the google sheet is covered could I just remove the remaining tests in `src/test/ui/coherence` or is there something in there that should remain?

cc #63599

r? @nikomatsakis

4 years agoRollup merge of #65007 - BO41:keywords, r=nikomatsakis
Yuki Okushi [Wed, 23 Oct 2019 08:14:29 +0000 (17:14 +0900)]
Rollup merge of #65007 - BO41:keywords, r=nikomatsakis

Mention keyword closing policy

closes #59233 / https://github.com/rust-lang/rust/issues/59233#issuecomment-478362693

rewording suggestions welcome

> Also in the referenced issue, the commit number of the new commit
> that could close that issue is not really informative. The PR number itself appeared in the issue
> is more informative and concise.

@lzutao what do you mean with that? Is this fixed by the new "May be fixed by #XXXXX"?

4 years agoRollup merge of #64145 - togiberlin:feature/target-features-doc, r=ehuss
Yuki Okushi [Wed, 23 Oct 2019 08:14:27 +0000 (17:14 +0900)]
Rollup merge of #64145 - togiberlin:feature/target-features-doc, r=ehuss

Target-feature documented as unsafe

@nikomatsakis asked me to help out on the docs on this issue: https://github.com/rust-lang/rust/issues/63597

The following docs have been modified
- ```rustc -C help``` text for `target-feature`
- RustC book:

## Preview of src/doc/rustc/src/targets/index.md
![Screenshot 2019-09-17 at 12 22 45](https://user-images.githubusercontent.com/13764830/65033746-f7826700-d945-11e9-9dd2-d8f9b08f45de.png)

## Preview of src/doc/rustc/src/targets/known-issues.md
![Screenshot 2019-09-17 at 12 22 25](https://user-images.githubusercontent.com/13764830/65033774-00733880-d946-11e9-9398-90f01f3938d5.png)

Fixes #63597

4 years agoTarget-feature documented as unsafe. rustc book and rustc -C help have been modified.
togiberlin [Wed, 4 Sep 2019 12:53:47 +0000 (14:53 +0200)]
Target-feature documented as unsafe. rustc book and rustc -C help have been modified.

4 years agoAdd link to async/await
Yuki Okushi [Tue, 22 Oct 2019 12:10:51 +0000 (21:10 +0900)]
Add link to async/await

4 years agoAuto merge of #65503 - popzxc:refactor-libtest, r=wesleywiser
bors [Tue, 22 Oct 2019 12:01:41 +0000 (12:01 +0000)]
Auto merge of #65503 - popzxc:refactor-libtest, r=wesleywiser

Refactor libtest

## Short overview

`libtest` got refactored and splitted into smaller modules

## Description

`libtest` module is already pretty big and hard to understand. Everything is mixed up: CLI, console output, test execution, etc.

This PR splits `libtest` into smaller logically-consistent modules, makes big functions smaller and more readable, and adds more comments, so `libtest` will be easier to understand and maintain.

Although there are a lot of changes, all the refactoring is "soft", meaning that no public interfaces were affected and nothing should be broken.

Thus this PR (at least should be) completely backward-compatible.

r? @wesleywiser
cc @Centril

4 years agoUpdate error_codes.rs
Dylan DPC [Tue, 22 Oct 2019 10:07:07 +0000 (12:07 +0200)]
Update error_codes.rs

4 years agoAdd test for issue-63496
Yuki Okushi [Tue, 22 Oct 2019 08:01:49 +0000 (17:01 +0900)]
Add test for issue-63496

4 years agoadd comments
Ralf Jung [Tue, 22 Oct 2019 08:18:38 +0000 (10:18 +0200)]
add comments

4 years agobring back some Debug instances for Miri
Ralf Jung [Tue, 22 Oct 2019 08:15:56 +0000 (10:15 +0200)]
bring back some Debug instances for Miri

4 years agoAdd test for issue-52437
Yuki Okushi [Tue, 22 Oct 2019 08:01:32 +0000 (17:01 +0900)]
Add test for issue-52437

4 years agoAdd test for issue-51431
Yuki Okushi [Tue, 22 Oct 2019 08:01:06 +0000 (17:01 +0900)]
Add test for issue-51431

4 years agoAdd test for issue-41366
Yuki Okushi [Tue, 22 Oct 2019 08:00:47 +0000 (17:00 +0900)]
Add test for issue-41366

4 years agorefactor maybe_append
yjhmelody [Tue, 22 Oct 2019 04:25:14 +0000 (12:25 +0800)]
refactor maybe_append

4 years agoAuto merge of #65501 - alexcrichton:remove-emscripten-backend, r=Mark-Simulacrum
bors [Tue, 22 Oct 2019 04:09:28 +0000 (04:09 +0000)]
Auto merge of #65501 - alexcrichton:remove-emscripten-backend, r=Mark-Simulacrum

Remove `src/llvm-emscripten` submodule

With #65251 landed there's no need to build two LLVM backends and ship
them with rustc, every target we have now uses the same LLVM backend!

This removes the `src/llvm-emscripten` submodule and additionally
removes all support from rustbuild for building the emscripten LLVM
backend. Multiple codegen backend support is left in place for now, and
this is intended to be an easy 10-15 minute win on CI times by avoiding
having to build LLVM twice.

4 years agoCode cleanups following up on #65576.
Dan Gohman [Tue, 22 Oct 2019 00:29:40 +0000 (17:29 -0700)]
Code cleanups following up on #65576.

This makes a few code cleanups to follow up on the review comments in
https://github.com/rust-lang/rust/pull/65576.

4 years agoAuto merge of #65671 - Centril:rollup-00glhmb, r=Centril
bors [Tue, 22 Oct 2019 00:20:12 +0000 (00:20 +0000)]
Auto merge of #65671 - Centril:rollup-00glhmb, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #62330 (Change untagged_unions to not allow union fields with drop)
 - #65092 (make is_power_of_two a const function)
 - #65621 (miri: add write_bytes method to Memory doing bounds-checks and supporting iterators)
 - #65647 (Remove unnecessary trait bounds and derivations)
 - #65653 (keep the root dir clean from debugging)
 - #65660 (Rename `ConstValue::Infer(InferConst::Canonical(..))` to `ConstValue::Bound(..)`)
 - #65663 (Fix typo from #65214)

Failed merges:

r? @ghost

4 years agoApply suggestions
Yuki Okushi [Tue, 22 Oct 2019 00:00:01 +0000 (09:00 +0900)]
Apply suggestions

4 years agoAdd long error explanation for E0728
Yuki Okushi [Mon, 21 Oct 2019 23:48:01 +0000 (08:48 +0900)]
Add long error explanation for E0728

4 years agoRemove `src/llvm-emscripten` submodule
Alex Crichton [Thu, 17 Oct 2019 14:04:39 +0000 (07:04 -0700)]
Remove `src/llvm-emscripten` submodule

With #65251 landed there's no need to build two LLVM backends and ship
them with rustc, every target we have now uses the same LLVM backend!

This removes the `src/llvm-emscripten` submodule and additionally
removes all support from rustbuild for building the emscripten LLVM
backend. Multiple codegen backend support is left in place for now, and
this is intended to be an easy 10-15 minute win on CI times by avoiding
having to build LLVM twice.

4 years agoRollup merge of #65663 - Amanieu:typo, r=varkor
Mazdak Farrokhzad [Mon, 21 Oct 2019 20:00:54 +0000 (22:00 +0200)]
Rollup merge of #65663 - Amanieu:typo, r=varkor

Fix typo from #65214

4 years agoRollup merge of #65660 - varkor:canonical-const-to-bound-const, r=eddyb
Mazdak Farrokhzad [Mon, 21 Oct 2019 20:00:53 +0000 (22:00 +0200)]
Rollup merge of #65660 - varkor:canonical-const-to-bound-const, r=eddyb

Rename `ConstValue::Infer(InferConst::Canonical(..))` to `ConstValue::Bound(..)`

It already has the right form, so this is just a renaming. Fixes https://github.com/rust-lang/rust/issues/65655.

r? @eddyb

4 years agoRollup merge of #65653 - RalfJung:gitignore, r=Mark-Simulacrum,Centril
Mazdak Farrokhzad [Mon, 21 Oct 2019 20:00:51 +0000 (22:00 +0200)]
Rollup merge of #65653 - RalfJung:gitignore, r=Mark-Simulacrum,Centril

keep the root dir clean from debugging

We landed this before with https://github.com/rust-lang/rust/pull/63307 but recently in https://github.com/rust-lang/rust/pull/65630 the IMO bad ignore crept back in.

If you regularly do graphviz-based debugging and you are fine leaving junk in the rustc root dir, please configure your local `.git/info/exclude`. But most people working on rustc don't work with graphciz all that often (I for once never did), and not everyone likes to have stray generated files in their source dirs.

Also Cc https://github.com/rust-lang/rust/pull/63373 https://github.com/rust-lang/rust/pull/53768 @ecstatic-morse @Mark-Simulacrum

4 years agoRollup merge of #65647 - nnethercote:rm-unnecessary-traits, r=Centril
Mazdak Farrokhzad [Mon, 21 Oct 2019 20:00:50 +0000 (22:00 +0200)]
Rollup merge of #65647 - nnethercote:rm-unnecessary-traits, r=Centril

Remove unnecessary trait bounds and derivations

This PR removes unnecessary trait bounds and derivations from many types.

r? @nikomatsakis

4 years agoRollup merge of #65621 - RalfJung:write_bytes, r=oli-obk
Mazdak Farrokhzad [Mon, 21 Oct 2019 20:00:49 +0000 (22:00 +0200)]
Rollup merge of #65621 - RalfJung:write_bytes, r=oli-obk

miri: add write_bytes method to Memory doing bounds-checks and supporting iterators

This lets us avoid some direct `Allocation` accesses in Miri.

4 years agoRollup merge of #65092 - tspiteri:const-is-pow2, r=oli-obk
Mazdak Farrokhzad [Mon, 21 Oct 2019 20:00:47 +0000 (22:00 +0200)]
Rollup merge of #65092 - tspiteri:const-is-pow2, r=oli-obk

make is_power_of_two a const function

This makes `is_power_of_two` a const function by using `&` instead of short-circuiting `&&`; Rust supports bitwise `&` for `bool` and short-circuiting is not required in the existing expression.

I don't think this needs a const-hack label as I don't find the changed code less readable, if anything I prefer that it is clearer that short circuiting is not used.

@oli-obk

4 years agoRollup merge of #62330 - SimonSapin:no-drop-in-union-fields, r=RalfJung
Mazdak Farrokhzad [Mon, 21 Oct 2019 20:00:45 +0000 (22:00 +0200)]
Rollup merge of #62330 - SimonSapin:no-drop-in-union-fields, r=RalfJung

Change untagged_unions to not allow union fields with drop

This is a rebase of #56440, massaged to solve merge conflicts and make the test suite pass.

Change untagged_unions to not allow union fields with drop

Union fields may now never have a type with attached destructor. This for example allows unions to use arbitrary field types only by wrapping them in `ManuallyDrop` (or similar).

The stable rule remains, that union fields must be `Copy`. We use the new rule for the `untagged_union` feature.

Tracking issue: https://github.com/rust-lang/rust/issues/55149

4 years agoRename `ConstValue::Infer(InferConst::Canonical(..))` to `ConstValue::Bound(..)`
varkor [Mon, 21 Oct 2019 10:22:45 +0000 (11:22 +0100)]
Rename `ConstValue::Infer(InferConst::Canonical(..))` to `ConstValue::Bound(..)`

4 years agoexpand comment
Ralf Jung [Mon, 21 Oct 2019 08:36:49 +0000 (10:36 +0200)]
expand comment

4 years agoAuto merge of #65661 - JohnTitor:rollup-68la1fq, r=JohnTitor
bors [Mon, 21 Oct 2019 15:50:37 +0000 (15:50 +0000)]
Auto merge of #65661 - JohnTitor:rollup-68la1fq, r=JohnTitor

Rollup of 5 pull requests

Successful merges:

 - #65544 (Added doc on keyword break)
 - #65620 (Correctly note code as Ok not error for E0573)
 - #65624 ([mir-opt] Improve SimplifyLocals pass so it can remove unused consts)
 - #65650 (use unwrap_or in lint code)
 - #65652 (Fix `canonicalize_const_var` leaking inference variables)

Failed merges:

r? @ghost

4 years agoimprove readability of is_power_of_two
Trevor Spiteri [Mon, 21 Oct 2019 13:35:54 +0000 (15:35 +0200)]
improve readability of is_power_of_two

4 years agoFix typo from #65214
Amanieu d'Antras [Mon, 21 Oct 2019 12:13:43 +0000 (13:13 +0100)]
Fix typo from #65214

4 years agoRollup merge of #65652 - skinny121:const_infer_leak, r=eddyb
Yuki Okushi [Mon, 21 Oct 2019 10:53:06 +0000 (19:53 +0900)]
Rollup merge of #65652 - skinny121:const_infer_leak, r=eddyb

Fix `canonicalize_const_var` leaking inference variables

Fixes #61338
Fixes #61516
Fixes #62536
Fixes #64087
Fixes #64863
Fixes #65623

I added regression tests for all these issues apart from #64863, which is very similar to #61338.

r? @varkor

4 years agoRollup merge of #65650 - guanqun:use-unwrap-or, r=eddyb
Yuki Okushi [Mon, 21 Oct 2019 10:53:05 +0000 (19:53 +0900)]
Rollup merge of #65650 - guanqun:use-unwrap-or, r=eddyb

use unwrap_or in lint code

4 years agoRollup merge of #65624 - wesleywiser:improve_simplify_locals, r=oli-obk
Yuki Okushi [Mon, 21 Oct 2019 10:53:04 +0000 (19:53 +0900)]
Rollup merge of #65624 - wesleywiser:improve_simplify_locals, r=oli-obk

[mir-opt] Improve SimplifyLocals pass so it can remove unused consts

The `ConstProp` can cause many locals to be initialized to a constant
value and then never read from. `ConstProp` can also evaluate ZSTs into
constant values. Previously, many of these would be removed by other
parts of the MIR optimization pipeline. However, evaluating ZSTs
(especially `()`) into constant values defeated those parts of the
optimizer and so in a2e3ed5, I added a
hack to `ConstProp` that skips evaluating ZSTs to avoid that regression.

This commit changes `SimplifyLocals` so that it doesn't consider writes
of const values to a local to be a use of that local. In doing so,
`SimplifyLocals` is able to remove otherwise unused locals left behind
by other optimization passes (`ConstProp` in particular).

r? @oli-obk

4 years agoRollup merge of #65620 - ryoqun:remove-unneeded-comment, r=varkor
Yuki Okushi [Mon, 21 Oct 2019 10:53:02 +0000 (19:53 +0900)]
Rollup merge of #65620 - ryoqun:remove-unneeded-comment, r=varkor

Correctly note code as Ok not error for E0573

Hi, this is my first pull request to the Rust project.

The fix is very small one just to fix an oversight in a comment.

Namely, [this documentation PR](https://github.com/rust-lang/rust/pull/65234) added a longer explanation for E0573. It illustrated the error using erroneous/corrected contrasting examples. But it accidentally forgot to remove `// error` from the corrected example.

Sadly, I found the error after the PR got merged. [As suggested by the original author](https://github.com/rust-lang/rust/pull/65234/files#r336518549) of the PR, I created an PR to fix this.

Part of #61137.

4 years agoRollup merge of #65544 - dorfsmay:doc_keyword_break, r=Dylan-DPC
Yuki Okushi [Mon, 21 Oct 2019 10:53:01 +0000 (19:53 +0900)]
Rollup merge of #65544 - dorfsmay:doc_keyword_break, r=Dylan-DPC

Added doc on keyword break

RE: #34601

4 years agoRemove many unnecessary trait derivations.
Nicholas Nethercote [Sun, 20 Oct 2019 04:54:53 +0000 (15:54 +1100)]
Remove many unnecessary trait derivations.

4 years agoAdd option to disable keyboard shortcuts in docs
Guillaume Gomez [Mon, 21 Oct 2019 09:36:52 +0000 (11:36 +0200)]
Add option to disable keyboard shortcuts in docs

4 years agoremove write_repeat; it is subsumed by the new write_bytes
Ralf Jung [Mon, 21 Oct 2019 09:08:37 +0000 (11:08 +0200)]
remove write_repeat; it is subsumed by the new write_bytes

4 years agopoints the user away from the Allocation type and towards the Memory type
Ralf Jung [Sun, 20 Oct 2019 12:57:21 +0000 (14:57 +0200)]
points the user away from the Allocation type and towards the Memory type

4 years agokeep the root dir clean from debugging
Ralf Jung [Mon, 21 Oct 2019 08:30:35 +0000 (10:30 +0200)]
keep the root dir clean from debugging

4 years agoReport even duplilcate errors in case the feature gat is not active
Oliver Scherer [Mon, 21 Oct 2019 08:12:09 +0000 (10:12 +0200)]
Report even duplilcate errors in case the feature gat is not active

4 years agoAuto merge of #65594 - RalfJung:miri, r=oli-obk
bors [Mon, 21 Oct 2019 07:50:52 +0000 (07:50 +0000)]
Auto merge of #65594 - RalfJung:miri, r=oli-obk

bump miri

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

4 years agoDon't silently do nothing on mis_use of `check_union_fields`
Oliver Scherer [Mon, 21 Oct 2019 07:08:05 +0000 (09:08 +0200)]
Don't silently do nothing on mis_use of `check_union_fields`

4 years agoFix `canonicalize_const_var` from leaking inference variables through
ben [Mon, 21 Oct 2019 01:42:54 +0000 (14:42 +1300)]
Fix `canonicalize_const_var` from leaking inference variables through
it's type.

4 years agouse unwrap_or in lint code
Guanqun Lu [Mon, 21 Oct 2019 06:18:09 +0000 (14:18 +0800)]
use unwrap_or in lint code

4 years agoRemove unneccessary use under cfg(unix)
Igor Aleksanov [Mon, 21 Oct 2019 06:05:40 +0000 (09:05 +0300)]
Remove unneccessary use under cfg(unix)

4 years agoAuto merge of #65630 - ecstatic-morse:graphviz-tidy, r=Mark-Simulacrum
bors [Mon, 21 Oct 2019 04:01:37 +0000 (04:01 +0000)]
Auto merge of #65630 - ecstatic-morse:graphviz-tidy, r=Mark-Simulacrum

Check all files in `src/test` for `borrowck_graphviz_postflow`

This attribute causes DOT files to be generated in the top-level directory. It is intended to be used only temporarily and should never appear on master. This also tells git to ignore DOT files in the root or the  `mir_dump` directory, which `-Z dump-mir` uses by default.

This will prevent #65071 from occurring again. It needs to be merged after #65629, otherwise `tidy` will start failing.

r? @Mark-Simulacrum

4 years agoImprove SimplifyLocals pass so it can remove unused consts
Wesley Wiser [Thu, 17 Oct 2019 10:46:51 +0000 (06:46 -0400)]
Improve SimplifyLocals pass so it can remove unused consts

The `ConstProp` can cause many locals to be initialized to a constant
value and then never read from. `ConstProp` can also evaluate ZSTs into
constant values. Previously, many of these would be removed by other
parts of the MIR optimization pipeline. However, evaluating ZSTs
(especially `()`) into constant values defeated those parts of the
optimizer and so in a2e3ed5c054b544df6ceeb9e612d39af819f4aae, I added a
hack to `ConstProp` that skips evaluating ZSTs to avoid that regression.

This commit changes `SimplifyLocals` so that it doesn't consider writes
of const values to a local to be a use of that local. In doing so,
`SimplifyLocals` is able to remove otherwise unused locals left behind
by other optimization passes (`ConstProp` in particular).

4 years agoCleanup `ConstProp::visit_statement()`
Wesley Wiser [Sat, 12 Oct 2019 12:21:51 +0000 (08:21 -0400)]
Cleanup `ConstProp::visit_statement()`

4 years agoRemove unnecessary `Hash` bounds from various types.
Nicholas Nethercote [Sat, 19 Oct 2019 23:29:11 +0000 (10:29 +1100)]
Remove unnecessary `Hash` bounds from various types.

4 years agoRemove unnecessary trait bounds from `keys::Keys`.
Nicholas Nethercote [Sat, 19 Oct 2019 23:35:51 +0000 (10:35 +1100)]
Remove unnecessary trait bounds from `keys::Keys`.

4 years agoCorrectly note code as Ok not error for E0573
Ryo Onodera [Sun, 20 Oct 2019 06:40:44 +0000 (15:40 +0900)]
Correctly note code as Ok not error for E0573

4 years agoAuto merge of #65644 - Centril:rollup-gez1xhe, r=Centril
bors [Sun, 20 Oct 2019 23:40:12 +0000 (23:40 +0000)]
Auto merge of #65644 - Centril:rollup-gez1xhe, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #65314 (rustdoc: forward -Z options to rustc)
 - #65592 (clarify const_prop ICE protection comment)
 - #65603 (Avoid ICE when include! is used by stdin crate)
 - #65614 (Improve error message for APIT with explicit generic arguments)
 - #65629 (Remove `borrowck_graphviz_postflow` from test)
 - #65633 (Remove leading :: from paths in doc examples)
 - #65638 (Rename the default argument 'def' to 'default')
 - #65639 (Fix parameter name in documentation)

Failed merges:

r? @ghost

4 years agoRollup merge of #65639 - adrianheine:patch-2, r=jonas-schievink
Mazdak Farrokhzad [Sun, 20 Oct 2019 23:39:21 +0000 (01:39 +0200)]
Rollup merge of #65639 - adrianheine:patch-2, r=jonas-schievink

Fix parameter name in documentation

4 years agoRollup merge of #65638 - dsincl12:master, r=Centril
Mazdak Farrokhzad [Sun, 20 Oct 2019 23:39:20 +0000 (01:39 +0200)]
Rollup merge of #65638 - dsincl12:master, r=Centril

Rename the default argument 'def' to 'default'

Fixes: #65492
4 years agoRollup merge of #65633 - Rantanen:doc-example-paths, r=Centril
Mazdak Farrokhzad [Sun, 20 Oct 2019 23:39:18 +0000 (01:39 +0200)]
Rollup merge of #65633 - Rantanen:doc-example-paths, r=Centril

Remove leading :: from paths in doc examples

Noted some pre-2018 path syntax in the doc examples, for example:
https://doc.rust-lang.org/std/process/fn.exit.html

```rust
fn main() {
    ::std::process::exit(match run_app() {
       Ok(_) => 0,
       ...
```

Couldn't find an existing issue on this (then again, "::" makes for an annoying thing to search for) so if there is already something fixing this and/or there's a reason to not fix it, just close this PR.

(Also fixed indentation in the `process::exit()` docs)

4 years agoRollup merge of #65629 - ecstatic-morse:remove-graphviz, r=Mark-Simulacrum
Mazdak Farrokhzad [Sun, 20 Oct 2019 23:39:17 +0000 (01:39 +0200)]
Rollup merge of #65629 - ecstatic-morse:remove-graphviz, r=Mark-Simulacrum

Remove `borrowck_graphviz_postflow` from test

Resolves #65071 (again).

Sorry. I've added a commit hook to prevent this from happening in the future.

r? @petrochenkov

4 years agoRollup merge of #65614 - varkor:apit-explicit-generics, r=matthewjasper
Mazdak Farrokhzad [Sun, 20 Oct 2019 23:39:16 +0000 (01:39 +0200)]
Rollup merge of #65614 - varkor:apit-explicit-generics, r=matthewjasper

Improve error message for APIT with explicit generic arguments

This is disallowed with type or const generics. cc https://github.com/rust-lang/rust/issues/61410.

4 years agoRollup merge of #65603 - mystor:resolve_path_ice, r=petrochenkov
Mazdak Farrokhzad [Sun, 20 Oct 2019 23:39:14 +0000 (01:39 +0200)]
Rollup merge of #65603 - mystor:resolve_path_ice, r=petrochenkov

Avoid ICE when include! is used by stdin crate

This should hopefully also eliminate the ICE when using `include_bytes!`, `include_str!` and `#[doc(include = "...")]` with a stdio input.

I couldn't see a clear way to write a compile-fail test using compiletest with a stdio input, so I haven't written any tests for this change.

Fixes #63900

4 years agoRollup merge of #65592 - RalfJung:const-prop-comment, r=wesleywiser
Mazdak Farrokhzad [Sun, 20 Oct 2019 23:39:13 +0000 (01:39 +0200)]
Rollup merge of #65592 - RalfJung:const-prop-comment, r=wesleywiser

clarify const_prop ICE protection comment

This is based on discussion at https://github.com/rust-lang/rust/pull/64890/files#r334555787.

That said, why are function arguments the only unsized locals that could remain uninitialized? Couldn't we also fail to initialize some local but still go on with const_prop, and then hit a line that takes a reference to that? Cc @wesleywiser @oli-obk ; I don't know enough about const-prop to understand why this can happen only for function arguments.

~~The PR includes https://github.com/rust-lang/rust/pull/64890; the only new commit is 05e4e6ba0d5.~~

4 years agoRollup merge of #65314 - tmiasko:rustdoc-z, r=ollie27
Mazdak Farrokhzad [Sun, 20 Oct 2019 23:39:11 +0000 (01:39 +0200)]
Rollup merge of #65314 - tmiasko:rustdoc-z, r=ollie27

rustdoc: forward -Z options to rustc

Currently rustdoc does not forward `-Z` options to rustc when building
test executables. This makes impossible to use rustdoc to run test
samples when crate under test is instrumented with one of sanitizers
`-Zsanitizer=...`, since the final linking step will not include
sanitizer runtime library.

Forward `-Z` options to rustc to solve the issue.

Helps with #43031.

4 years agoFix parameter name in documentation
Adrian Heine né Lang [Sun, 20 Oct 2019 21:13:41 +0000 (23:13 +0200)]
Fix parameter name in documentation

4 years agoRename the default argument 'def' to 'default'
David Sinclair [Sun, 20 Oct 2019 20:22:33 +0000 (22:22 +0200)]
Rename the default argument 'def' to 'default'

Fixes: #65492
4 years agoAuto merge of #65632 - JohnTitor:rollup-adb16gb, r=JohnTitor
bors [Sun, 20 Oct 2019 19:45:09 +0000 (19:45 +0000)]
Auto merge of #65632 - JohnTitor:rollup-adb16gb, r=JohnTitor

Rollup of 5 pull requests

Successful merges:

 - #65460 (Clean up `contains()` `insert()` chains on HashSet)
 - #65463 (Avoid unnecessary arena allocations in `expand_pattern()`.)
 - #65579 (Changed `resolve_type_vars_with_obligations` to also resolve const inference variables)
 - #65605 (Remove unreachable unit tuple compare binop codegen)
 - #65626 (trivial typo fix)

Failed merges:

r? @ghost

4 years agoRemove leading :: from paths in doc examples
Mikko Rantanen [Sun, 20 Oct 2019 18:13:47 +0000 (21:13 +0300)]
Remove leading :: from paths in doc examples

4 years agoRollup merge of #65626 - guanqun:patch-1, r=varkor
Yuki Okushi [Sun, 20 Oct 2019 18:10:59 +0000 (03:10 +0900)]
Rollup merge of #65626 - guanqun:patch-1, r=varkor

trivial typo fix

4 years agoRollup merge of #65605 - bjorn3:fix_63906, r=eddyb
Yuki Okushi [Sun, 20 Oct 2019 18:10:58 +0000 (03:10 +0900)]
Rollup merge of #65605 - bjorn3:fix_63906, r=eddyb

Remove unreachable unit tuple compare binop codegen

Closes #63906
Fixes #63551

This is based on #63906 by @luigishat, who had trouble with rebasing his PR.

4 years agoRollup merge of #65579 - skinny121:resolve_const_vars, r=varkor
Yuki Okushi [Sun, 20 Oct 2019 18:10:57 +0000 (03:10 +0900)]
Rollup merge of #65579 - skinny121:resolve_const_vars, r=varkor

Changed `resolve_type_vars_with_obligations` to also resolve const inference variables

Fixes #65380
r? @varkor

4 years agoRollup merge of #65463 - nnethercote:rm-arena-allocation-from-expand_pattern, r=varkor
Yuki Okushi [Sun, 20 Oct 2019 18:10:55 +0000 (03:10 +0900)]
Rollup merge of #65463 - nnethercote:rm-arena-allocation-from-expand_pattern, r=varkor

Avoid unnecessary arena allocations in `expand_pattern()`.

`expand_pattern()` has two callsites. One of them needs arena
allocation, but the other does not.

This commit moves the arena allocation out of the function. This avoids
the allocation of many 4 KiB page arena chunks that only hold a single
small allocation. It reduces the number of bytes allocated by up to 2%
for various benchmarks, albeit without only a very small improvement in
runtime.

4 years agoRollup merge of #65460 - sinkuu:contains_insert, r=varkor
Yuki Okushi [Sun, 20 Oct 2019 18:10:54 +0000 (03:10 +0900)]
Rollup merge of #65460 - sinkuu:contains_insert, r=varkor

Clean up `contains()` `insert()` chains on HashSet

They can be merged to a single `insert()` call, which may avoid double-hashing/lookup of the value.

4 years agoIgnore DOT files in .gitignore
Dylan MacKenzie [Sun, 20 Oct 2019 18:03:13 +0000 (11:03 -0700)]
Ignore DOT files in .gitignore

4 years agoCheck all files in `src/test` for `borrowck_graphviz_postflow`
Dylan MacKenzie [Sun, 20 Oct 2019 17:46:49 +0000 (10:46 -0700)]
Check all files in `src/test` for `borrowck_graphviz_postflow`

This attribute causes DOT files to be generated in the top-level
directory. It is intended to be used only temporarily and should never
appear on master.

This will prevent #65071 from occurring again.

4 years agoRemove `borrowck_graphviz_postflow` from test
Dylan MacKenzie [Sun, 20 Oct 2019 16:36:04 +0000 (09:36 -0700)]
Remove `borrowck_graphviz_postflow` from test

4 years agotypo fix
guanqun [Sun, 20 Oct 2019 15:03:33 +0000 (23:03 +0800)]
typo fix

4 years agoAuto merge of #65622 - Centril:rollup-l8orba7, r=Centril
bors [Sun, 20 Oct 2019 14:07:46 +0000 (14:07 +0000)]
Auto merge of #65622 - Centril:rollup-l8orba7, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #64996 (Inline `ptr::null(_mut)` even in debug builds)
 - #65551 (Avoid realloc in `CString::new`)
 - #65593 (add test for calling non-const fn)
 - #65595 (move `parse_cfgspecs` to `rustc_interface`)
 - #65600 (Remove unneeded `ref` from docs)
 - #65602 (Fix plural mistake in emitter.rs)

Failed merges:

r? @ghost

4 years agoUpdate ui tests
Guillaume Gomez [Sat, 19 Oct 2019 09:22:17 +0000 (11:22 +0200)]
Update ui tests

4 years agoAdd long error explanation for E0588
Guillaume Gomez [Sat, 19 Oct 2019 09:21:52 +0000 (11:21 +0200)]
Add long error explanation for E0588

4 years agoRollup merge of #65602 - varkor:other-candidates, r=Centril
Mazdak Farrokhzad [Sun, 20 Oct 2019 10:40:22 +0000 (12:40 +0200)]
Rollup merge of #65602 - varkor:other-candidates, r=Centril

Fix plural mistake in emitter.rs

4 years agoRollup merge of #65600 - integer32llc:bye-bye-ref, r=Centril
Mazdak Farrokhzad [Sun, 20 Oct 2019 10:40:20 +0000 (12:40 +0200)]
Rollup merge of #65600 - integer32llc:bye-bye-ref, r=Centril

Remove unneeded `ref` from docs

Will reduce confusion like in https://users.rust-lang.org/t/help-understanding-the-ref-t-syntax/33779 since match ergonomics means you (almost) never have to say `ref` anymore!

There might be more like this, but I don't have a checkout on my computer right this second and I'm on slow wifi and GitHub search isn't powerful enough and that's my story.

4 years agoRollup merge of #65595 - Centril:cfgspecs, r=Mark-Simulacrum
Mazdak Farrokhzad [Sun, 20 Oct 2019 10:40:19 +0000 (12:40 +0200)]
Rollup merge of #65595 - Centril:cfgspecs, r=Mark-Simulacrum

move `parse_cfgspecs` to `rustc_interface`

Part of https://github.com/rust-lang/rust/pull/65324.

r? @Mark-Simulacrum

4 years agoRollup merge of #65593 - RalfJung:non-const-fn, r=oli-obk
Mazdak Farrokhzad [Sun, 20 Oct 2019 10:40:18 +0000 (12:40 +0200)]
Rollup merge of #65593 - RalfJung:non-const-fn, r=oli-obk

add test for calling non-const fn

The good news is that there is an error. But I expected to see [this error](https://github.com/rust-lang/rust/blob/9578272d681c8691ca2ff3f5c4230b491bc1c694/src/librustc_mir/const_eval.rs#L346) surface. @oli-obk any idea why that message is not shown anywhere?

r? @oli-obk

4 years agoRollup merge of #65551 - sinkuu:cstring_spec, r=sfackler
Mazdak Farrokhzad [Sun, 20 Oct 2019 10:40:16 +0000 (12:40 +0200)]
Rollup merge of #65551 - sinkuu:cstring_spec, r=sfackler

Avoid realloc in `CString::new`

If `&[u8]` or `&str` is given, `CString::new` allocates a new `Vec` with the exact capacity, and then `CString::from_vec_unchecked` calls `.reserve_exact(1)` for nul byte. This PR avoids the reallocation by allocationg `len + 1` bytes beforehand. In microbenchmark this PR speeds up `CString::new(&[u8])` by 30%.

4 years agoRollup merge of #64996 - lzutao:inline-ptr-null, r=oli-obk
Mazdak Farrokhzad [Sun, 20 Oct 2019 10:40:15 +0000 (12:40 +0200)]
Rollup merge of #64996 - lzutao:inline-ptr-null, r=oli-obk

Inline `ptr::null(_mut)` even in debug builds

I think we should treat `ptr::null(_mut)` as a constant. As It may help reduce code size
in debug build.
link: https://godbolt.org/z/b9YMtD
4 years agoAuto merge of #65497 - choller:master, r=tmiasko
bors [Sun, 20 Oct 2019 10:11:10 +0000 (10:11 +0000)]
Auto merge of #65497 - choller:master, r=tmiasko

Avoid injecting sanitizer runtimes into staticlibs (#64629).

This fixes the remaining issue in `creader.rs` and also fixes the expected test failure. I have explicitly turned the `$(CC)` call into a negative check with the `!` to ensure that this command is really failing (if it is not, then either the runtime is attached to the lib or the lib has not been instrumented and both would be an error).

I've also borrowed `program.rs` and the additional `rustc` invocation from @tmiasko 's PR since he pointed out that using `-fsanitize=address` with `$(CC)` for linking could fail if the sanitizer runtimes on the system are incompatible.

With this toolchain I was able to compile Firefox locally without any linker errors. I am still seeing races with Rust in TSan but I assume that is because I did not build with `-Z build-std`.

4 years agoalso check the iterator is not too long
Ralf Jung [Sun, 20 Oct 2019 10:06:03 +0000 (12:06 +0200)]
also check the iterator is not too long

4 years agomiri add write_bytes method to Memory doing bounds-checks and supporting iterators
Ralf Jung [Sun, 20 Oct 2019 10:02:35 +0000 (12:02 +0200)]
miri add write_bytes method to Memory doing bounds-checks and supporting iterators

4 years agoskip all refs-to-uninit-local, not just arguments
Ralf Jung [Sat, 19 Oct 2019 16:16:22 +0000 (18:16 +0200)]
skip all refs-to-uninit-local, not just arguments

4 years agofix WASI sleep impl
Artyom Pavlov [Sun, 20 Oct 2019 06:31:27 +0000 (06:31 +0000)]
fix WASI sleep impl

4 years agoAuto merge of #65469 - mati865:libc, r=alexcrichton
bors [Sun, 20 Oct 2019 06:10:51 +0000 (06:10 +0000)]
Auto merge of #65469 - mati865:libc, r=alexcrichton

Update libc to 0.2.64

Passed local tests.

cc potentially interested people: @gnzlbg @tlively