]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoAuto merge of #71577 - tmiasko:backtrace-sys, r=Dylan-DPC
bors [Wed, 29 Apr 2020 07:32:52 +0000 (07:32 +0000)]
Auto merge of #71577 - tmiasko:backtrace-sys, r=Dylan-DPC

Update backtrace-sys crate to 0.1.36

* Fix an off-by-one error in backtrace-sys
* Only explicitly configure debuginfo in rustc-dep-of-std

https://github.com/rust-lang/backtrace-rs/compare/0.3.46...backtrace-sys-0.1.36

Fixes #71397.

4 years agoAuto merge of #71518 - felix91gr:const_prop_bugfix_just_block_prop, r=wesleywiser
bors [Wed, 29 Apr 2020 03:04:46 +0000 (03:04 +0000)]
Auto merge of #71518 - felix91gr:const_prop_bugfix_just_block_prop, r=wesleywiser

Const-prop bugfix: only add propagation inside own block for user variables

A testing spinoff of #71298. This one only adds the const-prop for locals that are user variables.

4 years agoAuto merge of #71486 - alexcrichton:arm64-lld, r=Mark-Simulacrum
bors [Tue, 28 Apr 2020 22:18:03 +0000 (22:18 +0000)]
Auto merge of #71486 - alexcrichton:arm64-lld, r=Mark-Simulacrum

Enable "full tools" option on ARM dist builders

This commit switches the `--enable-extended` option on the arm-related
dist builders to `--enable-full-tools`. This alias in `config.py`
corresponds to enabling a few more options:

* `rust.lld = true` - this is the main purpose of this PR, to enable LLD
  on ARM-related platforms. This means it will effectively unlock
  compilation of wasm programs from an arm host.

* `rust.llvm-tools = true` - it turns out that this option is largely
  ignored in rustbuild today. This is only read in one location to set
  some flags for the `llvm-tools` package, but the `llvm-tools` package
  is already produced on all of these builders. It's predicted that this
  will have no effect on build times.

* `rust.codegen-backends = ['llvm']` - historically this also enabled
  the emscripten backend, but that has long since been removed.

This brings the ARM dist builders in line with the x86_64 dist builders
using this flag. The hope is that the extra time spent on CI building
LLD will acceptable because it's cached by `sccache`, LLD is a
relatively small C++ project, and the dist builders are all clocking
well under 3 hours (the slowest of all builders) around 2 hours.

There's likely some possible cleanup that can happen with these
configure options since it doesn't look like they've aged too too well,
but I'm hopeful that possible refactorings, if necessary, could be
deferred to future PRs.

4 years agoAuto merge of #71642 - ehuss:update-cargo, r=ehuss
bors [Tue, 28 Apr 2020 19:05:00 +0000 (19:05 +0000)]
Auto merge of #71642 - ehuss:update-cargo, r=ehuss

Update cargo

11 commits in 8751eb3010d4cdb5329b5a6bd2b6d765c95b0dca..90931d9b31e8b854522fed00916504a3ac6d8619
2020-04-21 18:04:35 +0000 to 2020-04-28 01:56:59 +0000
- Use associated constants directly on primitive types instead of modules (rust-lang/cargo#8077)
- Clear `RUSTDOCFLAGS` before running tests (rust-lang/cargo#8168)
- Fix warning for `resolve` mismatch in workspace. (rust-lang/cargo#8169)
- Fix flaky linking_interrupted test. (rust-lang/cargo#8162)
- Fixed some unnecessary borrows and clones. (rust-lang/cargo#8146)
- Added warning when using restricted names in Windows. (rust-lang/cargo#8136)
- Add changelog about dylib uplift. (rust-lang/cargo#8161)
- Mention that cargo_metadata can parse json messages (rust-lang/cargo#8158)
- Re-enable rustc-info-cache test again (rust-lang/cargo#8155)
- Updates to path source walking. (rust-lang/cargo#8095)
- Bump to 0.46.0, update changelog (rust-lang/cargo#8153)

4 years agoAuto merge of #71644 - Dylan-DPC:rollup-cq7plwa, r=Dylan-DPC
bors [Tue, 28 Apr 2020 15:56:45 +0000 (15:56 +0000)]
Auto merge of #71644 - Dylan-DPC:rollup-cq7plwa, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #71340 (Moving more build-pass tests to check-pass)
 - #71456 (Use lib crate type for SGX in `fn build_auxiliary`)
 - #71615 (share some common code for compile-time miri instances)
 - #71637 (Minor formatting changes in `cfg-sanitize.md`)
 - #71641 (Update books)

Failed merges:

r? @ghost

4 years agoRollup merge of #71641 - ehuss:update-books, r=ehuss
Dylan DPC [Tue, 28 Apr 2020 15:55:50 +0000 (17:55 +0200)]
Rollup merge of #71641 - ehuss:update-books, r=ehuss

Update books

## nomicon

5 commits in 6eb24d6e9c0773d4aee68ed5fca121ce3cdf676a..4d2d275997746d35eabfc4d992dfbdcce2f626ed
2020-04-06 02:21:15 +0200 to 2020-04-27 10:24:52 -0400
- Fix example in FFI, section NPO
- Update implementation code of `split_at_mut`
- Use rust-lang/rust linkchecker on CI.
- Use just `std::_` instead of `::std::_`
- Remove illegal space.

## reference

2 commits in 3ce94caed4cf967106c51ae86be5e098f7875f11..ed22e6fbfcb6ce436e9ea3b4bb4a55b2fb50a57e
2020-04-11 17:00:27 +0200 to 2020-04-24 12:46:22 -0700
- Fix grammer for tuple patterns and tuple struct patterns (rust-lang-nursery/reference#794)
- Document drop scopes (rust-lang-nursery/reference#514)

## book

2 commits in f5db319e0b19c22964398d56bc63103d669e1bba..e37c0e84e2ef73d3a4ebffda8011db6814a3b02d
2020-04-13 08:06:03 -0500 to 2020-04-26 09:31:36 -0500
- Mention short-circuiting in Appendix 02 (rust-lang/book#2318)
- Increase HTTP buffer size and add 'Content-Length' header (rust-lang/book#2246)

## rust-by-example

8 commits in c106d1683c3a2b0960f0f0fb01728cbb19807332..ffc99581689fe2455908aaef5f5cf50dd03bb8f5
2020-04-09 09:14:39 -0300 to 2020-04-24 15:05:04 -0300
- Fix Example -> Examples (rust-lang/rust-by-example#1340)
- Make unsuffixed literal plural (rust-lang/rust-by-example#1335)
- Ensure example error matches the comment (rust-lang/rust-by-example#1336)
- Add missing triple backticks (rust-lang/rust-by-example#1339)
- Clarify conditional compilation (rust-lang/rust-by-example#1338)
- Clarifies how to customize lib crate name (rust-lang/rust-by-example#1337)
- Fix bytes of youkoso in shiftjis (rust-lang/rust-by-example#1333)
- Fix possible typo (rust-lang/rust-by-example#1334)

## embedded-book

4 commits in 668fb07b6160b9c468f598e839c1e044db65de30..40beccdf1bb8eb9184a2e3b42db8b8c6e394247f
2020-04-13 12:38:16 +0000 to 2020-04-26 17:44:14 +0000
- Add hint on memory config to GDB debugging section  (rust-embedded/book#215)
- Adds cargo-generate to installation instructions  (rust-embedded/book#213)
- collections: Fix example allocator  (rust-embedded/book#206)
- Flip111/patch 8  (rust-embedded/book#233)

4 years agoRollup merge of #71637 - mibac138:cfg-sanitize, r=petrochenkov
Dylan DPC [Tue, 28 Apr 2020 15:55:48 +0000 (17:55 +0200)]
Rollup merge of #71637 - mibac138:cfg-sanitize, r=petrochenkov

Minor formatting changes in `cfg-sanitize.md`

4 years agoRollup merge of #71615 - RalfJung:share-machine-code, r=oli-obk
Dylan DPC [Tue, 28 Apr 2020 15:55:46 +0000 (17:55 +0200)]
Rollup merge of #71615 - RalfJung:share-machine-code, r=oli-obk

share some common code for compile-time miri instances

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

r? @oli-obk

4 years agoRollup merge of #71456 - mzohreva:mz/sgx-no-dylib, r=nikomatsakis
Dylan DPC [Tue, 28 Apr 2020 15:55:44 +0000 (17:55 +0200)]
Rollup merge of #71456 - mzohreva:mz/sgx-no-dylib, r=nikomatsakis

Use lib crate type for SGX in `fn build_auxiliary`

since SGX does not support `dylib`

cc @Goirad

4 years agoRollup merge of #71340 - Valloric:more-check-pass, r=nikomatsakis
Dylan DPC [Tue, 28 Apr 2020 15:55:43 +0000 (17:55 +0200)]
Rollup merge of #71340 - Valloric:more-check-pass, r=nikomatsakis

Moving more build-pass tests to check-pass

One or two tests became build-pass without the FIXME because they really
needed build-pass (were failing without it).

Helps with #62277

---
<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/rust-lang/rust/71340)
<!-- Reviewable:end -->

4 years agoUpdate cargo
Eric Huss [Tue, 28 Apr 2020 15:34:58 +0000 (08:34 -0700)]
Update cargo

4 years agoUpdate books
Eric Huss [Tue, 28 Apr 2020 14:46:36 +0000 (07:46 -0700)]
Update books

4 years agoAuto merge of #71636 - Dylan-DPC:rollup-9gc24ak, r=Dylan-DPC
bors [Tue, 28 Apr 2020 12:28:24 +0000 (12:28 +0000)]
Auto merge of #71636 - Dylan-DPC:rollup-9gc24ak, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #71311 (On `FnDef` type annotation suggestion, use fn-pointer output)
 - #71488 (normalize field projection ty to fix broken MIR issue)
 - #71489 (Fix off by one in treat err as bug)
 - #71585 (remove obsolete comment)
 - #71634 (Revert #71372 ("Fix #! (shebang) stripping account space issue").)

Failed merges:

r? @ghost

4 years agoRollup merge of #71634 - eddyb:revert-71372, r=petrochenkov
Dylan DPC [Tue, 28 Apr 2020 11:12:17 +0000 (13:12 +0200)]
Rollup merge of #71634 - eddyb:revert-71372, r=petrochenkov

Revert #71372 ("Fix #! (shebang) stripping account space issue").

While #71372 fixed some of the problems `#!`-stripping had, it introduced others:
* inefficient implementation (`.chars().filter(...).collect()` on the entire input file)
  * this also means the length returned isn't always correct, leading to e.g. #71471
* it ignores whitespace anywhere, stripping ` # ! ...` which isn't a valid shebang
  * the definition of "whitespace" it uses includes newlines, which means even `\n#\n!\n...` is stripped as a shebang (and anything matching the regex `\s*#\s*!\s*`, and not followed by `[`, really)
* it's backward-incompatible but didn't go through Crater

Now, #71487 is already open and will solve all of these issues. But for running Crater, and just in case #71487 takes a bit longer, I decided it's safer to just revert #71372.

This will also make #71372's diff clearer, as it will start again from the original whitespace-unaware version.

r? @petrochenkov

4 years agoRollup merge of #71585 - tshepang:obsolete-comment, r=Dylan-DPC
Dylan DPC [Tue, 28 Apr 2020 11:12:15 +0000 (13:12 +0200)]
Rollup merge of #71585 - tshepang:obsolete-comment, r=Dylan-DPC

remove obsolete comment

Not sure if it's better to have an outdated comment or no comment at all (made obsolete by 2b9fea1300b515e0f8929bb3a09d4fb6fef3f0ea).

4 years agoRollup merge of #71489 - spastorino:fix-treat-err-as-bug-handling, r=eddyb
Dylan DPC [Tue, 28 Apr 2020 11:12:14 +0000 (13:12 +0200)]
Rollup merge of #71489 - spastorino:fix-treat-err-as-bug-handling, r=eddyb

Fix off by one in treat err as bug

`-Ztreat-err-as-bug` doesn't work properly with delay_span_bug.

r? @eddyb

4 years agoRollup merge of #71488 - spastorino:normalize-ty-to-fix-broken-mir, r=eddyb
Dylan DPC [Tue, 28 Apr 2020 11:12:12 +0000 (13:12 +0200)]
Rollup merge of #71488 - spastorino:normalize-ty-to-fix-broken-mir, r=eddyb

normalize field projection ty to fix broken MIR issue

Fixes #71344

r? @eddyb

4 years agoRollup merge of #71311 - estebank:fn-type-param, r=varkor
Dylan DPC [Tue, 28 Apr 2020 11:12:09 +0000 (13:12 +0200)]
Rollup merge of #71311 - estebank:fn-type-param, r=varkor

On `FnDef` type annotation suggestion, use fn-pointer output

Address the last point in #71209.

4 years agoRevert "Rollup merge of #71372 - ayushmishra2005:shebang_stripping, r=estebank"
Eduard-Mihai Burtescu [Tue, 28 Apr 2020 10:02:58 +0000 (13:02 +0300)]
Revert "Rollup merge of #71372 - ayushmishra2005:shebang_stripping, r=estebank"

This reverts commit 46a8dcef5c9e4de0d412c6ac3c4765cb4aef4f7f, reversing
changes made to f28e3873c55eb4bdcfc496e1f300b97aeb0d189c.

4 years agoAuto merge of #71444 - RalfJung:test-async-no-opt, r=jonas-schievink
bors [Tue, 28 Apr 2020 09:06:55 +0000 (09:06 +0000)]
Auto merge of #71444 - RalfJung:test-async-no-opt, r=jonas-schievink

smoke-test for async fn with mir-opt-level=0

MIR opt levels heavily influence which MIR transformations run, and we barely test non-default opt levels. I am particularly worried about `async fn` lowering and how it might (not) work when the set of preceding MIR passes changes -- see https://github.com/rust-lang/rust/pull/70073.

This adds some basic smoke testing, where at least a few `async fn` `run-pass` test are ensured to also work with mir-opt-level=0.

4 years agoalso run some generator tests without MIR optimizations
Ralf Jung [Tue, 28 Apr 2020 06:22:08 +0000 (08:22 +0200)]
also run some generator tests without MIR optimizations

4 years agoAuto merge of #71292 - marmeladema:queries-local-def-id, r=eddyb
bors [Tue, 28 Apr 2020 05:01:27 +0000 (05:01 +0000)]
Auto merge of #71292 - marmeladema:queries-local-def-id, r=eddyb

Convert more queries to use `LocalDefId`

This PR is based on commits in https://github.com/rust-lang/rust/pull/71215 and should partially solve #70853

4 years agoPolished documentation, removed not-so-useful-anymore traces, and added some doc...
Félix Fischer [Thu, 23 Apr 2020 02:43:52 +0000 (22:43 -0400)]
Polished documentation, removed not-so-useful-anymore traces, and added some doc comments in `mir/transform/const_prop.rs`

4 years agoChanged `simplify_match` output query because it had become outdated
Félix Fischer [Mon, 27 Apr 2020 23:05:44 +0000 (19:05 -0400)]
Changed `simplify_match` output query because it had become outdated

4 years agoAdded MIR const-prop diff tests to show why some assertions now fail at compile-time
Félix Fischer [Mon, 27 Apr 2020 22:57:58 +0000 (18:57 -0400)]
Added MIR const-prop diff tests to show why some assertions now fail at compile-time

4 years agoAdded new ui tests to show what errors MIR can now find at compile time
Félix Fischer [Mon, 27 Apr 2020 22:43:18 +0000 (18:43 -0400)]
Added new ui tests to show what errors MIR can now find at compile time

4 years agoAllow Locals to be propagated into and from, but restricted to their own block
Félix Fischer [Thu, 23 Apr 2020 16:25:28 +0000 (12:25 -0400)]
Allow Locals to be propagated into and from, but restricted to their own block

4 years agoAuto merge of #71606 - Xanewok:update-rls, r=Xanewok
bors [Tue, 28 Apr 2020 01:46:47 +0000 (01:46 +0000)]
Auto merge of #71606 - Xanewok:update-rls, r=Xanewok

Update RLS to unbreak toolstate

Breakage caused by https://github.com/rust-lang/rust/pull/71263.

r? @ghost

4 years agoBlocked `MutatingUseContext::Projection` for all locals of kind `LocalKind::Temp...
Félix Fischer [Thu, 23 Apr 2020 01:53:51 +0000 (21:53 -0400)]
Blocked `MutatingUseContext::Projection` for all locals of kind `LocalKind::Temp`. Added a cache of `LocalKind`s to `CanConstProp`

4 years agoAdded regression test for literal propagation and for scalar pair propagation
Félix Fischer [Thu, 23 Apr 2020 01:39:47 +0000 (21:39 -0400)]
Added regression test for literal propagation and for scalar pair propagation

4 years agoAccept `LocalDefId` as key for `check_impl_item_well_formed` query
marmeladema [Sat, 18 Apr 2020 16:12:02 +0000 (17:12 +0100)]
Accept `LocalDefId` as key for `check_impl_item_well_formed` query

4 years agoAccept `LocalDefId` as key for `check_trait_item_well_formed` query
marmeladema [Sat, 18 Apr 2020 16:10:50 +0000 (17:10 +0100)]
Accept `LocalDefId` as key for `check_trait_item_well_formed` query

4 years agoAccept `LocalDefId` as key for `check_item_well_formed` query
marmeladema [Sat, 18 Apr 2020 16:08:30 +0000 (17:08 +0100)]
Accept `LocalDefId` as key for `check_item_well_formed` query

4 years agoChange return type of `entry_fn` query to return a `LocalDefId`
marmeladema [Sat, 18 Apr 2020 15:34:41 +0000 (16:34 +0100)]
Change return type of `entry_fn` query to return a `LocalDefId`

4 years agoDeclare `body_owner` and `subject_def_id` as `LocalDefId` in `RegionCtxt`
marmeladema [Sat, 18 Apr 2020 15:12:51 +0000 (16:12 +0100)]
Declare `body_owner` and `subject_def_id` as `LocalDefId` in `RegionCtxt`

4 years agoDeclare `body_owner` as `LocalDefId` in `MemCategorizationContext`
marmeladema [Sat, 18 Apr 2020 15:06:06 +0000 (16:06 +0100)]
Declare `body_owner` as `LocalDefId` in `MemCategorizationContext`

4 years agoAccept `LocalDefId` as key for `check_mod_privacy` query
marmeladema [Sat, 18 Apr 2020 14:25:53 +0000 (15:25 +0100)]
Accept `LocalDefId` as key for `check_mod_privacy` query

4 years agoAccept `LocalDefId` as key for `lint_mod` query
marmeladema [Sat, 18 Apr 2020 14:19:56 +0000 (15:19 +0100)]
Accept `LocalDefId` as key for `lint_mod` query

4 years agoAccept `LocalDefId` as argument for `mir_build::lint::check`
marmeladema [Sat, 18 Apr 2020 14:16:01 +0000 (15:16 +0100)]
Accept `LocalDefId` as argument for `mir_build::lint::check`

4 years agoAccept `LocalDefId` as key for `mir_validated` query
marmeladema [Sat, 18 Apr 2020 12:41:52 +0000 (13:41 +0100)]
Accept `LocalDefId` as key for `mir_validated` query

4 years agoAuto merge of #71620 - Dylan-DPC:rollup-9wgtisb, r=Dylan-DPC
bors [Mon, 27 Apr 2020 22:49:05 +0000 (22:49 +0000)]
Auto merge of #71620 - Dylan-DPC:rollup-9wgtisb, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #67841 (Add Read/Write::can_read/write_vectored)
 - #71524 (Minimize parameter of coerce_borrowed_pointer())
 - #71558 (Cleanup and document `-Z tls-model` )
 - #71578 (linkchecker: fix typo in main.rs)
 - #71596 (Fix broken link in `QPath` documentation)
 - #71604 (make recursive-zst test unleashed)
 - #71605 (No need to whitelist E0750 anymore)

Failed merges:

r? @ghost

4 years agoAccept `LocalDefId` as key for `mir_borrowck` query
marmeladema [Sat, 18 Apr 2020 12:13:06 +0000 (13:13 +0100)]
Accept `LocalDefId` as key for `mir_borrowck` query

4 years agoReturn a `FxHashSet<LocalDefId>` from `mir_keys` query
marmeladema [Sat, 18 Apr 2020 11:58:53 +0000 (12:58 +0100)]
Return a `FxHashSet<LocalDefId>` from `mir_keys` query

4 years agoAccept `LocalDefId` as keyt for `names_imported_by_glob_use`
marmeladema [Sat, 18 Apr 2020 00:10:15 +0000 (01:10 +0100)]
Accept `LocalDefId` as keyt for `names_imported_by_glob_use`

and `maybe_unused_trait_import` queries

4 years agoUse `LocalDefId` for `type_param_predicates` query
marmeladema [Fri, 17 Apr 2020 20:58:04 +0000 (21:58 +0100)]
Use `LocalDefId` for `type_param_predicates` query

4 years agoUse `LocalDefId` in `mir_built` query
marmeladema [Fri, 17 Apr 2020 14:53:37 +0000 (15:53 +0100)]
Use `LocalDefId` in `mir_built` query

4 years agoUse `LocalDefId` in `unsafety_check_result` query
marmeladema [Fri, 17 Apr 2020 14:25:44 +0000 (15:25 +0100)]
Use `LocalDefId` in `unsafety_check_result` query

4 years agoUse `LocalDefId` in `typeck_tables_of` and `used_trait_imports` queries
marmeladema [Fri, 17 Apr 2020 14:17:01 +0000 (15:17 +0100)]
Use `LocalDefId` in `typeck_tables_of` and `used_trait_imports` queries

4 years agoRollup merge of #71605 - GuillaumeGomez:remove-e0750-from-whitelist, r=Dylan-DPC
Dylan DPC [Mon, 27 Apr 2020 20:15:11 +0000 (22:15 +0200)]
Rollup merge of #71605 - GuillaumeGomez:remove-e0750-from-whitelist, r=Dylan-DPC

No need to whitelist E0750 anymore

Since #71304 has been fixed, no need to whitelist it anymore.

r? @Dylan-DPC

4 years agoRollup merge of #71604 - RalfJung:unleash-recursive-zst, r=oli-obk
Dylan DPC [Mon, 27 Apr 2020 20:15:09 +0000 (22:15 +0200)]
Rollup merge of #71604 - RalfJung:unleash-recursive-zst, r=oli-obk

make recursive-zst test unleashed

Make sure we find this issue even without const qualification.

r? @oli-obk @ecstatic-morse

4 years agoRollup merge of #71596 - LeSeulArtichaut:patch-1, r=Dylan-DPC
Dylan DPC [Mon, 27 Apr 2020 20:15:07 +0000 (22:15 +0200)]
Rollup merge of #71596 - LeSeulArtichaut:patch-1, r=Dylan-DPC

Fix broken link in `QPath` documentation

r? @Dylan-DPC

4 years agoRollup merge of #71578 - ryzokuken:linkchecker, r=Dylan-DPC
Dylan DPC [Mon, 27 Apr 2020 20:15:06 +0000 (22:15 +0200)]
Rollup merge of #71578 - ryzokuken:linkchecker, r=Dylan-DPC

linkchecker: fix typo in main.rs

Came across this while reading the file.

4 years agoRollup merge of #71558 - petrochenkov:tlsm, r=Amanieu
Dylan DPC [Mon, 27 Apr 2020 20:15:04 +0000 (22:15 +0200)]
Rollup merge of #71558 - petrochenkov:tlsm, r=Amanieu

Cleanup and document `-Z tls-model`

r? @Amanieu

4 years agoRollup merge of #71524 - ldm0:ptrparam, r=matthewjasper
Dylan DPC [Mon, 27 Apr 2020 20:15:01 +0000 (22:15 +0200)]
Rollup merge of #71524 - ldm0:ptrparam, r=matthewjasper

Minimize parameter of coerce_borrowed_pointer()

Change last parameter of `coerce_borrowed_pointer()` from `TypeAndMut` to `Mutability` (similar to `coerce_unsafe_ptr()`), since the `TypeAndMut::ty` is never used directly in this function.

4 years agoRollup merge of #67841 - sfackler:can-vector, r=Amaneiu
Dylan DPC [Mon, 27 Apr 2020 20:14:55 +0000 (22:14 +0200)]
Rollup merge of #67841 - sfackler:can-vector, r=Amaneiu

Add Read/Write::can_read/write_vectored

When working with an arbitrary reader or writer, code that uses vectored
operations may end up being slower than code that copies into a single
buffer when the underlying reader or writer doesn't actually support
vectored operations. These new methods allow you to ask the reader or
witer up front if vectored operations are efficiently supported.

Currently, you have to use some heuristics to guess by e.g. checking if
the read or write only accessed the first buffer. Hyper is one concrete
example of a library that has to do this dynamically:
https://github.com/hyperium/hyper/blob/0eaf304644a396895a4ce1f0146e596640bb666a/src/proto/h1/io.rs#L582-L594

4 years agoAuto merge of #71200 - oli-obk:mir_bless, r=eddyb
bors [Mon, 27 Apr 2020 19:36:46 +0000 (19:36 +0000)]
Auto merge of #71200 - oli-obk:mir_bless, r=eddyb

Emit basic block info for stmts and terminators in MIR dumps only with -Zverbose

r? @eddyb

as per https://github.com/rust-lang/rust/pull/70755#discussion_r403419476

4 years agofix typo
Esteban Kuber [Mon, 27 Apr 2020 17:59:44 +0000 (10:59 -0700)]
fix typo

Co-Authored-By: varkor <github@varkor.com>
4 years agoshare some common code for compile-time miri instances
Ralf Jung [Mon, 27 Apr 2020 17:01:30 +0000 (19:01 +0200)]
share some common code for compile-time miri instances

4 years agoAdd test for delay_span_bug and -Ztrear-err-as-bug
Santiago Pastorino [Fri, 24 Apr 2020 19:08:22 +0000 (16:08 -0300)]
Add test for delay_span_bug and -Ztrear-err-as-bug

4 years agoEmit basic block ids for statements and terminators in MIR only in -Zverbose mode
Oliver Scherer [Sat, 25 Apr 2020 09:01:43 +0000 (11:01 +0200)]
Emit basic block ids for statements and terminators in MIR only in -Zverbose mode

4 years agoFix off by one error for delay_span_bug
Santiago Pastorino [Fri, 24 Apr 2020 04:03:20 +0000 (01:03 -0300)]
Fix off by one error for delay_span_bug

delay_span_bug bumps error_count after checking treat_err_as_bug

4 years agoUpdate RLS to unbreak toolstate
Igor Matuszewski [Mon, 27 Apr 2020 12:14:06 +0000 (14:14 +0200)]
Update RLS to unbreak toolstate

Breakage caused by https://github.com/rust-lang/rust/pull/71263.

4 years agofix wasi
Steven Fackler [Mon, 27 Apr 2020 11:50:03 +0000 (04:50 -0700)]
fix wasi

4 years agomake recursive-zst test unleashed
Ralf Jung [Mon, 27 Apr 2020 11:08:02 +0000 (13:08 +0200)]
make recursive-zst test unleashed

4 years agoNo need to whitelist E0750 anymore
Guillaume Gomez [Mon, 27 Apr 2020 11:36:45 +0000 (13:36 +0200)]
No need to whitelist E0750 anymore

4 years agoAuto merge of #71268 - estebank:devectorize, r=eddyb
bors [Mon, 27 Apr 2020 10:00:05 +0000 (10:00 +0000)]
Auto merge of #71268 - estebank:devectorize, r=eddyb

Remove some `Vec` allocations to improve performance

This claws back most of the performance lost in https://github.com/rust-lang/rust/pull/69745.
r? @eddyb

4 years agoAuto merge of #70073 - wesleywiser:mir_opt_level_0, r=oli-obk
bors [Mon, 27 Apr 2020 07:04:46 +0000 (07:04 +0000)]
Auto merge of #70073 - wesleywiser:mir_opt_level_0, r=oli-obk

Don't run various MIR optimizations at mir-opt-level=0

Add missing checks for mir-opt-level to non-essential MIR passes.

I verified that this can still bootstrap even with these passes disabled.

r? @oli-obk cc @RalfJung

4 years agoAuto merge of #71600 - Dylan-DPC:rollup-7tvzi9n, r=Dylan-DPC
bors [Mon, 27 Apr 2020 02:38:50 +0000 (02:38 +0000)]
Auto merge of #71600 - Dylan-DPC:rollup-7tvzi9n, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #68716 (Stabilize `Span::mixed_site`)
 - #71263 (Remove unused abs_path method from rustc_span::source_map::FileLoader)
 - #71409 (Point at the return type on `.into()` failure caused by `?`)
 - #71419 (add message for resolution failure because wrong namespace)
 - #71438 (Tweak some suggestions in `rustc_resolve`)
 - #71589 (remove Unique::from for shared pointer types)

Failed merges:

r? @ghost

4 years agoRollup merge of #71589 - RalfJung:unique-no-shr, r=SimonSapin
Dylan DPC [Mon, 27 Apr 2020 01:26:18 +0000 (03:26 +0200)]
Rollup merge of #71589 - RalfJung:unique-no-shr, r=SimonSapin

remove Unique::from for shared pointer types

r? @SimonSapin

4 years agoRollup merge of #71438 - estebank:resolve-sugg-tiny, r=petrochenkov
Dylan DPC [Mon, 27 Apr 2020 01:26:17 +0000 (03:26 +0200)]
Rollup merge of #71438 - estebank:resolve-sugg-tiny, r=petrochenkov

Tweak some suggestions in `rustc_resolve`

4 years agoRollup merge of #71419 - contrun:wrong-namespace-rustc-resolve, r=petrochenkov
Dylan DPC [Mon, 27 Apr 2020 01:26:15 +0000 (03:26 +0200)]
Rollup merge of #71419 - contrun:wrong-namespace-rustc-resolve, r=petrochenkov

add message for resolution failure because wrong namespace

closes https://github.com/rust-lang/rust/issues/71406

4 years agoRollup merge of #71409 - estebank:point-at-ret-question-mark-op, r=petrochenkov
Dylan DPC [Mon, 27 Apr 2020 01:26:13 +0000 (03:26 +0200)]
Rollup merge of #71409 - estebank:point-at-ret-question-mark-op, r=petrochenkov

Point at the return type on `.into()` failure caused by `?`

Fix #35946.

4 years agoRollup merge of #71263 - shlevy:FileLoader-remove-abs_path, r=Xanewok
Dylan DPC [Mon, 27 Apr 2020 01:26:11 +0000 (03:26 +0200)]
Rollup merge of #71263 - shlevy:FileLoader-remove-abs_path, r=Xanewok

Remove unused abs_path method from rustc_span::source_map::FileLoader

4 years agoRollup merge of #68716 - petrochenkov:stabmixed, r=dtolnay
Dylan DPC [Mon, 27 Apr 2020 01:26:05 +0000 (03:26 +0200)]
Rollup merge of #68716 - petrochenkov:stabmixed, r=dtolnay

Stabilize `Span::mixed_site`

Closes https://github.com/rust-lang/rust/issues/65049.
cc https://github.com/rust-lang/rust/issues/54727#issuecomment-580647446

Pre-requisite for https://github.com/rust-lang/rust/pull/68717 ("Stabilize fn-like proc macros in expression, pattern and statement positions").

Stabilization report: https://github.com/rust-lang/rust/pull/68716#issuecomment-581076337.

4 years agofix wasm build
Steven Fackler [Sun, 26 Apr 2020 23:34:14 +0000 (16:34 -0700)]
fix wasm build

4 years agoAuto merge of #71468 - matthiaskrgr:submodule_upd, r=Dylan-DPC
bors [Sun, 26 Apr 2020 23:31:54 +0000 (23:31 +0000)]
Auto merge of #71468 - matthiaskrgr:submodule_upd, r=Dylan-DPC

submodules: update clippy from 891e1a85 to d01a4981

Changes:
````
`predecessors_for` will be removed soon
Rustup "Remove `BodyAndCache`"
span_lint_and_note now takes an Option<Span> for the note_span instead of just a span
Make lint also capture blocks and closures, adjust language to mention other mutex types
don't test the code in the lint docs
Switch to matching against full paths instead of just the last element of the path
Lint for holding locks across await points
fix crash on issue-69020-assoc-const-arith-overflow.rs
update stderr file
util/fetch_prs_between.sh: Add Markdown formatted Link
factor ifs into function, add differing mutex test
Update the changelog update documentation
Apply suggestions from PR review
update span_lint_and_help call to six args
test for mutex eq, add another test case
use if chain
cargo dev fmt
fix map import to rustc_middle
dev update_lints
fix internal clippy warnings
change visitor name to OppVisitor
use Visitor api to find Mutex::lock calls
add note about update-all-refs script, revert redundant pat to master
move closures to seperate fns, remove known problems
use span_lint_and_help, cargo dev fmt
creating suggestion
progress work on suggestion for auto fix
Implement unsafe_derive_deserialize lint
Update empty_enum.stderr
Formatting and naming
Formatting and naming
Cleanup: `node_id` -> `hir_id`
Fix issue #2907.
Don't trigger toplevel_ref_arg for `for` loops
Cleanup: future_not_send: use `return_ty` method
Remove badge FIXME from Cargo.toml
Change note_span argument for span_lint_and_note.
Add an Option<Span> argument to span_lint_and_help.
Fixes internal lint warning in code base.
Implement collapsible_span_lint_calls lint.
````

Fixes #71453

r? @Dylan-DPC

4 years agounstable-book: Document `-Z tls-model`
Vadim Petrochenkov [Sun, 26 Apr 2020 08:52:21 +0000 (11:52 +0300)]
unstable-book: Document `-Z tls-model`

4 years agorustc_target: Stop using "string typing" for TLS models
Vadim Petrochenkov [Sat, 25 Apr 2020 18:45:21 +0000 (21:45 +0300)]
rustc_target: Stop using "string typing" for TLS models

Introduce `enum TlsModel` instead.

4 years agoFix broken link in `QPath` documentation
LeSeulArtichaut [Sun, 26 Apr 2020 20:32:14 +0000 (22:32 +0200)]
Fix broken link in `QPath` documentation

4 years agoAuto merge of #71593 - Dylan-DPC:rollup-ms7j94u, r=Dylan-DPC
bors [Sun, 26 Apr 2020 20:12:48 +0000 (20:12 +0000)]
Auto merge of #71593 - Dylan-DPC:rollup-ms7j94u, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #71421 (Add a function to turn Box<T> into Box<[T]>)
 - #71537 (Remove support for self-opening)
 - #71551 (Minor refactoring around IndexVec usage in generator transformation)
 - #71569 ([miri] Throw UB if target size and data size don't match)
 - #71576 (check that `AsRef` and `AsMut` are inlined)

Failed merges:

 - #71558 (Cleanup and document `-Z tls-model` )

r? @ghost

4 years agoRollup merge of #71576 - lcnr:inline-as_mut, r=oli-obk
Dylan DPC [Sun, 26 Apr 2020 19:02:40 +0000 (21:02 +0200)]
Rollup merge of #71576 - lcnr:inline-as_mut, r=oli-obk

check that `AsRef` and `AsMut` are inlined

Adds a regression test for #58867

r? @Dylan-DPC

4 years agoRollup merge of #71569 - samrat:miri-ub-on-size-mismatch, r=RalfJung
Dylan DPC [Sun, 26 Apr 2020 19:02:39 +0000 (21:02 +0200)]
Rollup merge of #71569 - samrat:miri-ub-on-size-mismatch, r=RalfJung

[miri] Throw UB if target size and data size don't match

Issue: https://github.com/rust-lang/miri/issues/1355

If an extern C function is defined as

```
extern "C" {
    fn malloc(size: u32) -> *mut std::ffi::c_void;
}
```

on a 64-bit machine(ie. pointer sizes don't match), return undefined behaviour from Miri when [converting the argument into machine_usize](https://github.com/rust-lang/miri/blob/master/src/shims/foreign_items.rs#L200)

4 years agoRollup merge of #71551 - gizmondo:gen-index-vec, r=jonas-schievink
Dylan DPC [Sun, 26 Apr 2020 19:02:36 +0000 (21:02 +0200)]
Rollup merge of #71551 - gizmondo:gen-index-vec, r=jonas-schievink

Minor refactoring around IndexVec usage in generator transformation

Replace hash map with IndexVec for liveness data.
Utilize IndexVec::push return value to avoid redundant object creation.

r? @eddyb

4 years agoRollup merge of #71537 - Mark-Simulacrum:no-self-open, r=davidtwco
Dylan DPC [Sun, 26 Apr 2020 19:02:35 +0000 (21:02 +0200)]
Rollup merge of #71537 - Mark-Simulacrum:no-self-open, r=davidtwco

Remove support for self-opening

This was only used for linkage test cases, which is already covered by
the [run-make-fulldeps/symbol-visibility test](https://github.com/rust-lang/rust/blob/master/src/test/run-make-fulldeps/symbol-visibility/Makefile) -- which fairly extensively makes
sure we're correctly exporting the right symbols at the right visibility (for
various Rust crate types).

This fixes #10379 and resolves #10356 by removing the test case (and underlying support in the compiler). AFAICT, the better way to test visibility is via nm, like the symbol visibility test. It seems like that's sufficient; I suspect that given that we don't use this we should just drop it (android is tier 2 anyway). But happy to hear otherwise.

4 years agoRollup merge of #71421 - elichai:2020-04-boxed-slice, r=sfackler
Dylan DPC [Sun, 26 Apr 2020 19:02:32 +0000 (21:02 +0200)]
Rollup merge of #71421 - elichai:2020-04-boxed-slice, r=sfackler

Add a function to turn Box<T> into Box<[T]>

Hi,
I think this is very useful, as currently it's not possible in safe rust to do this without re-allocating.
an alternative implementation of the same function can be:
```rust
pub fn into_boxed_slice<T>(boxed: Box<T>) -> Box<[T]> {
    unsafe {
        let slice = slice::from_raw_parts_mut(Box::into_raw(boxed), 1);
        Box::from_raw(slice)
    }
}
```

The only thing that makes me a little uncomfortable is this line :
> The alignment of array types is greater or equal to the alignment of its element type

from https://rust-lang.github.io/unsafe-code-guidelines/layout/arrays-and-slices.html

But then I see:
> The alignment of &T, &mut T, *const T and *mut T are the same, and are at least the word size.
> The alignment of &[T] is the word size.

from https://rust-lang.github.io/unsafe-code-guidelines/layout/pointers.html#representation

So I do believe this is valid(FWIW it also passes in miri https://play.rust-lang.org/?gist=c002b99364ee6b29862aeb3565a91c19)

4 years agoPoint at the return type on `.into()` failure caused by `?`
Esteban Küber [Wed, 22 Apr 2020 00:20:12 +0000 (17:20 -0700)]
Point at the return type on `.into()` failure caused by `?`

Fix #35946.

4 years agoTweak some suggestions in `rustc_resolve`
Esteban Küber [Wed, 22 Apr 2020 18:58:21 +0000 (11:58 -0700)]
Tweak some suggestions in `rustc_resolve`

4 years agoremove Unique::from for shared pointer types
Ralf Jung [Sun, 26 Apr 2020 17:00:57 +0000 (19:00 +0200)]
remove Unique::from for shared pointer types

4 years agoAdjust style
Ralf Jung [Sun, 26 Apr 2020 16:44:38 +0000 (18:44 +0200)]
Adjust style

4 years agoAuto merge of #71579 - Dylan-DPC:rollup-h9om2g3, r=Dylan-DPC
bors [Sun, 26 Apr 2020 15:48:58 +0000 (15:48 +0000)]
Auto merge of #71579 - Dylan-DPC:rollup-h9om2g3, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #71490 (Cleanup and document `-C relocation-model`)
 - #71562 (fix more clippy warnings)
 - #71571 (Fix since attribute for nonzero_bitor impl's)
 - #71574 (proc_macro: Fix since attributes for new Span methods)
 - #71575 (Fix stable(since) attribute for BTreeMap::remove_entry)

Failed merges:

r? @ghost

4 years agoStabilize `Span::mixed_site`
Vadim Petrochenkov [Fri, 31 Jan 2020 21:18:14 +0000 (00:18 +0300)]
Stabilize `Span::mixed_site`

4 years agoRename ArgumentSizeMismatch to ScalarSizeMismatch
Samrat Man Singh [Sun, 26 Apr 2020 14:41:14 +0000 (20:11 +0530)]
Rename ArgumentSizeMismatch to ScalarSizeMismatch

4 years agoremove obsolete comment
Tshepang Lekhonkhobe [Sun, 26 Apr 2020 13:57:38 +0000 (15:57 +0200)]
remove obsolete comment

4 years agoAdd success and fail tests for into_boxed_slice
Elichai Turkel [Wed, 22 Apr 2020 14:23:20 +0000 (17:23 +0300)]
Add success and fail tests for into_boxed_slice

4 years agoAdd a function to turn Box<T> into Box<[T]> (into_boxed_slice)
Elichai Turkel [Wed, 22 Apr 2020 09:39:29 +0000 (12:39 +0300)]
Add a function to turn Box<T> into Box<[T]> (into_boxed_slice)

4 years agosubmodules: update clippy from 891e1a85 to b7c802b5
Matthias Krüger [Sun, 26 Apr 2020 12:33:18 +0000 (14:33 +0200)]
submodules: update clippy from 891e1a85 to b7c802b5

Changes:
````
rustup to https://github.com/rust-lang/rust/pull/70043
map_clone: avoid suggesting `copied()` for &mut
fix redundant_pattern_matching lint
Add tests for #1654
Don't trigger while_let_on_iterator when the iterator is recreated every iteration
Update issue_2356.stderr reference file
Update while_let_on_iterator tests
Fix while_let_on_iterator suggestion and make it MachineApplicable
Add lifetime test case for `new_ret_no_self`
rustup https://github.com/rust-lang/rust/pull/71215/
Downgrade match_bool to pedantic
Run fetch before testing if master contains beta
The beta branch update should not require a force push
Add a note to the beta sections of release.md
Remove apt-get upgrade again
Always use the deploy script and templates of the master branch
README: fix lit count line
clippy_dev: make it fatal when the regex for updating lint count does not match
`predecessors_for` will be removed soon
Rustup "Remove `BodyAndCache`"
Only run (late) internal lints, when they are warn/deny/forbid
Only run cargo lints, when they are warn/deny/forbid
span_lint_and_note now takes an Option<Span> for the note_span instead of just a span
Make lint also capture blocks and closures, adjust language to mention other mutex types
don't test the code in the lint docs
Switch to matching against full paths instead of just the last element of the path
Lint for holding locks across await points
Also mention `--fix` for nightly users
fix crash on issue-69020-assoc-const-arith-overflow.rs
Address review comments
remark fixes
Update CHANGELOG.md for Rust 1.43 and 1.44
update stderr file
util/fetch_prs_between.sh: Add Markdown formatted Link
factor ifs into function, add differing mutex test
Update the changelog update documentation
Apply suggestions from PR review
update span_lint_and_help call to six args
test for mutex eq, add another test case
use if chain
cargo dev fmt
fix map import to rustc_middle
dev update_lints
fix internal clippy warnings
change visitor name to OppVisitor
use Visitor api to find Mutex::lock calls
add note about update-all-refs script, revert redundant pat to master
move closures to seperate fns, remove known problems
use span_lint_and_help, cargo dev fmt
creating suggestion
progress work on suggestion for auto fix
Implement unsafe_derive_deserialize lint
Update empty_enum.stderr
Formatting and naming
Formatting and naming
Cleanup: `node_id` -> `hir_id`
Fix issue #2907.
Don't trigger toplevel_ref_arg for `for` loops
Cleanup: future_not_send: use `return_ty` method
Remove badge FIXME from Cargo.toml
Change note_span argument for span_lint_and_note.
Add an Option<Span> argument to span_lint_and_help.
Fixes internal lint warning in code base.
Implement collapsible_span_lint_calls lint.
````

Fixes #71453

4 years agoSuppress file length check temporarily
Steven Fackler [Sun, 26 Apr 2020 11:48:51 +0000 (04:48 -0700)]
Suppress file length check temporarily

Will clean up in a separate PR

4 years agoRollup merge of #71575 - jplatte:patch-4, r=Mark-Simulacrum
Dylan DPC [Sun, 26 Apr 2020 11:42:35 +0000 (13:42 +0200)]
Rollup merge of #71575 - jplatte:patch-4, r=Mark-Simulacrum

Fix stable(since) attribute for BTreeMap::remove_entry

Stabilized in #70712.

Maybe checking that the since attributes are added correctly should be automated through tidy? This is the third PR I'm opening that fixes a stable(since) attribute for something meant to be stabilized in 1.43 / 1.44 initially but then only stabilized in 1.45. (the other two are #71571, #71574)

4 years agoRollup merge of #71574 - jplatte:patch-2, r=petrochenkov
Dylan DPC [Sun, 26 Apr 2020 11:42:33 +0000 (13:42 +0200)]
Rollup merge of #71574 - jplatte:patch-2, r=petrochenkov

proc_macro: Fix since attributes for new Span methods

Added in #69041, took a while to merge so the since attributes went out of date.

4 years agoRollup merge of #71571 - jplatte:patch-1, r=jonas-schievink
Dylan DPC [Sun, 26 Apr 2020 11:42:32 +0000 (13:42 +0200)]
Rollup merge of #71571 - jplatte:patch-1, r=jonas-schievink

Fix since attribute for nonzero_bitor impl's

Added in #69813, took a while to merge so the since attributes went out of date.