]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoAdd ignore to doc code
Masaki Hara [Mon, 11 Feb 2019 07:32:42 +0000 (16:32 +0900)]
Add ignore to doc code

5 years agoSimplify fnbox docs.
Masaki Hara [Mon, 11 Feb 2019 02:09:41 +0000 (11:09 +0900)]
Simplify fnbox docs.

5 years agoStabilize boxed_closure_impls in 1.35.0.
Charles Lew [Mon, 11 Feb 2019 02:09:26 +0000 (11:09 +0900)]
Stabilize boxed_closure_impls in 1.35.0.

5 years agoRemove FnBox specialization of impl FnOnce for Box<impl FnOnce>.
Masaki Hara [Mon, 11 Feb 2019 01:34:24 +0000 (10:34 +0900)]
Remove FnBox specialization of impl FnOnce for Box<impl FnOnce>.

5 years agoWe already have unsized_locals in stage0.
Masaki Hara [Sun, 10 Feb 2019 10:25:56 +0000 (19:25 +0900)]
We already have unsized_locals in stage0.

5 years agoFix failing tests.
Masaki Hara [Sun, 3 Feb 2019 13:08:34 +0000 (22:08 +0900)]
Fix failing tests.

5 years agoFix expectations on some ui tests involving FnOnce.
Masaki Hara [Sun, 28 Oct 2018 08:53:43 +0000 (17:53 +0900)]
Fix expectations on some ui tests involving FnOnce.

5 years agoAdd unstable-book articles on fnbox and boxed_closure_impls.
Masaki Hara [Sun, 28 Oct 2018 06:36:58 +0000 (15:36 +0900)]
Add unstable-book articles on fnbox and boxed_closure_impls.

5 years agoAdd tests for boxed_closure_impls.
Masaki Hara [Sun, 28 Oct 2018 06:28:47 +0000 (15:28 +0900)]
Add tests for boxed_closure_impls.

5 years agoAdd Fn* blanket impls for Box.
Masaki Hara [Sun, 28 Oct 2018 06:28:15 +0000 (15:28 +0900)]
Add Fn* blanket impls for Box.

5 years agoMake FnBox a subtrait of FnOnce.
Masaki Hara [Sun, 28 Oct 2018 06:27:29 +0000 (15:27 +0900)]
Make FnBox a subtrait of FnOnce.

5 years agoAuto merge of #59695 - Centril:rollup-88qffc2, r=Centril
bors [Thu, 4 Apr 2019 15:36:17 +0000 (15:36 +0000)]
Auto merge of #59695 - Centril:rollup-88qffc2, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #59470 (Document std::fs::File close behavior ignoring errors)
 - #59555 (update miri)
 - #59556 (update stdsimd)
 - #59596 (Forward formatter settings to bounds of `Range<T>` in `fmt::Debug` impl)
 - #59639 (Never return uninhabited values at all)
 - #59671 (Make some of lexer's API private)
 - #59685 (Add description for -Os and -Oz in rustc.1)
 - #59686 (Temporarily disable stack probing for gnux32.)

Failed merges:

r? @ghost

5 years agoRollup merge of #59686 - crlf0710:disable_gnux32_stackprobe, r=luqmana
Mazdak Farrokhzad [Thu, 4 Apr 2019 13:09:08 +0000 (15:09 +0200)]
Rollup merge of #59686 - crlf0710:disable_gnux32_stackprobe, r=luqmana

Temporarily disable stack probing for gnux32.

5 years agoRollup merge of #59685 - lzutao:patch-1, r=GuillaumeGomez
Mazdak Farrokhzad [Thu, 4 Apr 2019 13:09:07 +0000 (15:09 +0200)]
Rollup merge of #59685 - lzutao:patch-1, r=GuillaumeGomez

Add description for -Os and -Oz in rustc.1

5 years agoRollup merge of #59671 - matklad:lexer, r=eddyb
Mazdak Farrokhzad [Thu, 4 Apr 2019 13:09:06 +0000 (15:09 +0200)]
Rollup merge of #59671 - matklad:lexer, r=eddyb

Make some of lexer's API private

Lexer is a `pub` type, so it feels wrong that its fields are just pub (I guess it wasn't exported initially), so let's minimize visibility.

Context: I am looking into extracting rust-lexer into a library, which can be shared by rust-analyzer and rustc. I hope that a simple interface like `fn next_token(src: &str) -> (TokenKind, usize)` would work, but to try this out I need to understand what is the current API of the lexer.

5 years agoRollup merge of #59639 - cuviper:ignore-uninhabited, r=eddyb
Mazdak Farrokhzad [Thu, 4 Apr 2019 13:09:04 +0000 (15:09 +0200)]
Rollup merge of #59639 - cuviper:ignore-uninhabited, r=eddyb

Never return uninhabited values at all

Functions with uninhabited return values are already marked `noreturn`,
but we were still generating return instructions for this. When running
with `-C passes=lint`, LLVM prints:

    Unusual: Return statement in function with noreturn attribute

The LLVM manual makes a stronger statement about `noreturn` though:

> This produces undefined behavior at runtime if the function ever does
dynamically return.

We now emit an `abort` anywhere that would have tried to return an
uninhabited value.

Fixes #48227
cc #7463 #48229

r? @eddyb

5 years agoRollup merge of #59596 - LukasKalbertodt:fix-range-fmt, r=Kimundi
Mazdak Farrokhzad [Thu, 4 Apr 2019 13:09:03 +0000 (15:09 +0200)]
Rollup merge of #59596 - LukasKalbertodt:fix-range-fmt, r=Kimundi

Forward formatter settings to bounds of `Range<T>` in `fmt::Debug` impl

Before this change, formatter settings were lost when printing a `Range`. For example, printing a `Range<f32>` with `{:.2?}` would not apply the precision modifier when printing the floats. Now the `Debug` impls look a bit more verbose, but modifier are not lost.

---

I assume the exact output of `Debug` impls in `std` cannot be relied on by users and thus can change, right?

5 years agoRollup merge of #59556 - RalfJung:stdsimd, r=gnzlbg
Mazdak Farrokhzad [Thu, 4 Apr 2019 13:09:02 +0000 (15:09 +0200)]
Rollup merge of #59556 - RalfJung:stdsimd, r=gnzlbg

update stdsimd

Cc @gnzlbg

5 years agoRollup merge of #59555 - RalfJung:miri, r=oli-obk
Mazdak Farrokhzad [Thu, 4 Apr 2019 13:09:00 +0000 (15:09 +0200)]
Rollup merge of #59555 - RalfJung:miri, r=oli-obk

update miri

r? @oli-obk

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

5 years agoRollup merge of #59470 - czipperz:document-fs-file-close, r=dtolnay
Mazdak Farrokhzad [Thu, 4 Apr 2019 13:08:59 +0000 (15:08 +0200)]
Rollup merge of #59470 - czipperz:document-fs-file-close, r=dtolnay

Document std::fs::File close behavior ignoring errors

Resolves #52685

5 years agoAuto merge of #59619 - alexcrichton:wasi-fs, r=fitzgen
bors [Thu, 4 Apr 2019 12:46:20 +0000 (12:46 +0000)]
Auto merge of #59619 - alexcrichton:wasi-fs, r=fitzgen

wasi: Implement more of the standard library

This commit fills out more of the `wasm32-unknown-wasi` target's standard library, notably the `std::fs` module and all of its internals. A few tweaks were made along the way to non-`fs` modules, but the last commit contains the bulk of the work which is to wire up all APIs to their equivalent on WASI targets instead of unconditionally returning "unsupported". After this some basic filesystem operations and such should all be working in WASI!

5 years agoAuto merge of #59517 - Zoxc:new-queries, r=oli-obk
bors [Thu, 4 Apr 2019 08:26:18 +0000 (08:26 +0000)]
Auto merge of #59517 - Zoxc:new-queries, r=oli-obk

Move query definitions over to the proc macro

r? @oli-obk

5 years agoDisable stack probing for gnux32.
CrLF0710 [Thu, 4 Apr 2019 06:15:51 +0000 (14:15 +0800)]
Disable stack probing for gnux32.

5 years agoAuto merge of #59089 - petrhosek:llvm-unwind, r=petrhosek
bors [Thu, 4 Apr 2019 05:24:54 +0000 (05:24 +0000)]
Auto merge of #59089 - petrhosek:llvm-unwind, r=petrhosek

Support using LLVM's libunwind as the unwinder implementation

This avoids the dependency on host libraries such as libgcc_s which
may be undesirable in some deployment environments where these aren't
available.

5 years agoAdd description for -Os and -Oz in rustc.1
lzutao [Thu, 4 Apr 2019 05:20:53 +0000 (12:20 +0700)]
Add description for -Os and -Oz in rustc.1

5 years agoFile: Add documentation about dropping to sync_all
Chris Gregory [Thu, 4 Apr 2019 03:21:10 +0000 (23:21 -0400)]
File: Add documentation about dropping to sync_all

5 years agoAuto merge of #59684 - Centril:rollup-n7pnare, r=Centril
bors [Thu, 4 Apr 2019 02:31:46 +0000 (02:31 +0000)]
Auto merge of #59684 - Centril:rollup-n7pnare, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #59316 (Internal lints take 2)
 - #59663 (Be more direct about borrow contract)
 - #59664 (Updated the documentation of spin_loop and spin_loop_hint)
 - #59666 (Updated the environment description in rustc.)
 - #59669 (Reduce repetition in librustc(_lint) wrt. impl LintPass by using macros)
 - #59677 (rustfix coverage: Skip UI tests with non-json error-format)

Failed merges:

r? @ghost

5 years agoRollup merge of #59677 - phansch:rustfix_coverage_handle_other_error_formats, r=oli-obk
Mazdak Farrokhzad [Wed, 3 Apr 2019 23:49:13 +0000 (01:49 +0200)]
Rollup merge of #59677 - phansch:rustfix_coverage_handle_other_error_formats, r=oli-obk

rustfix coverage: Skip UI tests with non-json error-format

When using the `rustfix-coverage` flag, some tests currently fail
because they define a different error-format than `json`.

The current implementation crashes when encountering those tests. Since
we don't care about non-json test output when collecting the coverage
data, we handle those tests by returning an empty `Vec` instead.

r? @oli-obk

5 years agoRollup merge of #59669 - Centril:lint-pass-macro, r=oli-obk
Mazdak Farrokhzad [Wed, 3 Apr 2019 23:49:12 +0000 (01:49 +0200)]
Rollup merge of #59669 - Centril:lint-pass-macro, r=oli-obk

Reduce repetition in librustc(_lint) wrt. impl LintPass by using macros

r? @oli-obk
cc @Zoxc

5 years agoRollup merge of #59666 - DevQps:update-rustc-environment-descriptions, r=GuillaumeGomez
Mazdak Farrokhzad [Wed, 3 Apr 2019 23:49:11 +0000 (01:49 +0200)]
Rollup merge of #59666 - DevQps:update-rustc-environment-descriptions, r=GuillaumeGomez

Updated the environment description in rustc.

# Description

- Updated the "environment" description in the `rustc` man pages

The old wording suggested that all the mentioned flags influenced the output of the compiler,
where this was not the case.

closes #59504

5 years agoRollup merge of #59664 - DevQps:improve-yield-spinlock-docs, r=alexcrichton
Mazdak Farrokhzad [Wed, 3 Apr 2019 23:49:09 +0000 (01:49 +0200)]
Rollup merge of #59664 - DevQps:improve-yield-spinlock-docs, r=alexcrichton

Updated the documentation of spin_loop and spin_loop_hint

# Description

- Updated the description of `core::hints::spin_loop`
- Updated the description of `core::async::spin_loop_hint`

Both documentation is rewritten to better reflect when one should prefer using a busy-wait spin-loop (and the `spin_loop` and `spin_loop_hint` functions) over `yield_now`. It also dives a little bit deeper on what the function actually does.

closes #55418

5 years agoRollup merge of #59663 - matklad:borrow, r=dtolnay
Mazdak Farrokhzad [Wed, 3 Apr 2019 23:49:08 +0000 (01:49 +0200)]
Rollup merge of #59663 - matklad:borrow, r=dtolnay

Be more direct about borrow contract

I always was confused by the difference between Borrow and AsRef, despite the fact that I've read all available docs at least a dozen of times.

I finally grokked the difference between the two when I realized the Borrow invariant:

> If you implement Borrow, you **must** make sure that Eq, Ord and Hash implementations are equivalent for borrowed and owned data

My problem was that this invariant is not stated explicitly in documentation, and instead some  vague and philosophical notions are used.

So I suggest to mention the requirements of `Borrow` very explicitly: instead of "use Borrow when X and use AsRef when Y", let's phrase this as `Borrow` differs from `AsRef` in `W`, so that's why `Borrow` is for `X` and `AsRef` is for `Y`.

Note that this change could be seen as tightening contract of the Borrow. Let's say Alice has written the following code:

```rust
#[derive(PartialEq, Eq, Hash, PartialOrd, Ord)]
struct Person {
    first_name: String,
    last_name: String,
}

impl Borrow<str> for Person {
      fn borrow(&self) -> &str { self.first_name.as_str() }
}
```

Now Bob uses this `Person` struct, puts it into `HashMap` and tries to look it up using `&str` for the first name. Bob's code naturally fails.

The question is, who is to blame: Alice, who has written the impl, or Bob, who uses the HashMap. If I read the current docs literally, I would say that `Bob` is to blame: `Eq` and `Hash` bounds appear on HashMap, so it is the HashMap which requires that they are consistent. By using a type for which the `Borrow` impl does not yield well-behaved `Eq`, Bob is violating contract of HashMap.

If, as this PR proposes, we unconditionally require that Eq & friends for borrow should be valid, then the blame shifts to Alice, which I think is more reasonable.

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

5 years agoRollup merge of #59316 - flip1995:internal_lints_take_2, r=oli-obk
Mazdak Farrokhzad [Wed, 3 Apr 2019 23:49:07 +0000 (01:49 +0200)]
Rollup merge of #59316 - flip1995:internal_lints_take_2, r=oli-obk

Internal lints take 2

cc #58701
cc #49509

TODO: Add `#![warn(internal)]` to crates (and fix violations)

Crates depending on `rustc_data_structures`

- [x] librustc_resolve
- [x] librustc_driver
- [x] librustc_passes
- [x] librustc_metadata
- [x] librustc_interface
- [x] librustc_save_analysis
- [x] librustc_lint
- [x] librustc
- [x] librustc_incremental
- [x] librustc_codegen_utils
- [x] libarena
- [x] librustc_target
- [x] librustc_allocator
- [x] librustc_privacy
- [x] librustc_traits
- [x] librustc_borrowck
- [x] libsyntax
- [x] librustc_codegen_ssa
- [x] libsyntax_ext
- [x] librustc_errors
- [x] librustc_mir
- [x] libsyntax_pos
- [x] librustc_typeck

Crates with `feature(rustc_private)`
Excluding crates, which are already in the list above. Also excluding tools and tests.

- [ ] ~~libstd~~
- [x] libfmt_macros
- [x] librustdoc

r? @oli-obk

5 years agoAuto merge of #59672 - o01eg:fix-59661, r=oli-obk
bors [Wed, 3 Apr 2019 23:42:23 +0000 (23:42 +0000)]
Auto merge of #59672 - o01eg:fix-59661, r=oli-obk

Revert rust-lld place changes

Fixes #59661.

Instead of https://github.com/rust-lang/rust/pull/59668 it reverts only failed part.

5 years agoNever return uninhabited values at all
Josh Stone [Wed, 3 Apr 2019 22:44:49 +0000 (15:44 -0700)]
Never return uninhabited values at all

Functions with uninhabited return values are already marked `noreturn`,
but we were still generating return instructions for this. When running
with `-C passes=lint`, LLVM prints:

    Unusual: Return statement in function with noreturn attribute

The LLVM manual makes a stronger statement about `noreturn` though:

> This produces undefined behavior at runtime if the function ever does
dynamically return.

We now emit an `abort` anywhere that would have tried to return an
uninhabited value.

5 years agoreduce repetition in librustc(_lint) wrt. impl LintPass
Mazdak Farrokhzad [Wed, 3 Apr 2019 14:05:40 +0000 (16:05 +0200)]
reduce repetition in librustc(_lint) wrt. impl LintPass

5 years agorustfix coverage: Skip UI tests with non-json error-format
Philipp Hansch [Wed, 3 Apr 2019 19:30:57 +0000 (21:30 +0200)]
rustfix coverage: Skip UI tests with non-json error-format

When using the `rustfix-coverage` flag, some tests currently fail
because they define a different error-format than `json`.

The current implementation crashes when encountering those tests. Since
we don't care about non-json test output when collecting the coverage
data, we handle those tests by returning an empty `Vec` instead.

5 years agoSupport using LLVM's libunwind as the unwinder implementation
Petr Hosek [Mon, 11 Mar 2019 02:27:59 +0000 (19:27 -0700)]
Support using LLVM's libunwind as the unwinder implementation

This avoids the dependency on host libraries such as libgcc_s which
may be undesirable in some deployment environments where these aren't
available.

5 years agoCompare `Ty`s directly instead of their `TyKind`s
flip1995 [Wed, 3 Apr 2019 14:08:04 +0000 (16:08 +0200)]
Compare `Ty`s directly instead of their `TyKind`s

5 years agoDeny internal lints on two more crates
flip1995 [Wed, 3 Apr 2019 13:53:36 +0000 (15:53 +0200)]
Deny internal lints on two more crates

- libfmt_macros
- librustdoc

5 years agoAdd trait_object_dummy_self to CommonTypes
flip1995 [Wed, 3 Apr 2019 09:46:40 +0000 (11:46 +0200)]
Add trait_object_dummy_self to CommonTypes

5 years agoRemove TyKind arg from report_bin_hex_error function
flip1995 [Tue, 2 Apr 2019 14:57:12 +0000 (16:57 +0200)]
Remove TyKind arg from report_bin_hex_error function

5 years agoDeny internal lints on librustc_typeck
flip1995 [Sun, 31 Mar 2019 22:10:48 +0000 (00:10 +0200)]
Deny internal lints on librustc_typeck

5 years agoDeny internal lints on librustc_mir
flip1995 [Sun, 31 Mar 2019 22:02:46 +0000 (00:02 +0200)]
Deny internal lints on librustc_mir

5 years agoDeny internal lints on librustc_lint
flip1995 [Sun, 31 Mar 2019 21:48:48 +0000 (23:48 +0200)]
Deny internal lints on librustc_lint

5 years agoDeny internal lints on librustc_interface
flip1995 [Sun, 31 Mar 2019 21:29:35 +0000 (23:29 +0200)]
Deny internal lints on librustc_interface

5 years agoDeny internal lints on non conflicting crates
flip1995 [Sun, 31 Mar 2019 21:18:22 +0000 (23:18 +0200)]
Deny internal lints on non conflicting crates

- libarena
- librustc_allocator
- librustc_borrowck
- librustc_codegen_ssa
- librustc_codegen_utils
- librustc_driver
- librustc_errors
- librustc_incremental
- librustc_metadata
- librustc_passes
- librustc_privacy
- librustc_resolve
- librustc_save_analysis
- librustc_target
- librustc_traits
- libsyntax
- libsyntax_ext
- libsyntax_pos

5 years agoDeny internal lints in librustc
flip1995 [Sun, 31 Mar 2019 13:01:46 +0000 (15:01 +0200)]
Deny internal lints in librustc

5 years agoAdd unstable-options flag to stage!=0
flip1995 [Sun, 31 Mar 2019 12:57:18 +0000 (14:57 +0200)]
Add unstable-options flag to stage!=0

5 years agoUpdate tests
flip1995 [Thu, 21 Mar 2019 16:10:25 +0000 (17:10 +0100)]
Update tests

5 years agoCheck for unstable-options flag before register internals
flip1995 [Thu, 21 Mar 2019 16:09:04 +0000 (17:09 +0100)]
Check for unstable-options flag before register internals

5 years agoDeduplicate code in TyKind lint
flip1995 [Thu, 21 Mar 2019 16:03:45 +0000 (17:03 +0100)]
Deduplicate code in TyKind lint

5 years agoFix bug in TyKind lint
flip1995 [Tue, 19 Mar 2019 21:46:45 +0000 (22:46 +0100)]
Fix bug in TyKind lint

5 years agoMake internal lints allow-by-default
flip1995 [Sat, 16 Mar 2019 13:59:34 +0000 (14:59 +0100)]
Make internal lints allow-by-default

5 years agouse check_path instead of check_expr
flip1995 [Thu, 28 Feb 2019 16:34:01 +0000 (17:34 +0100)]
use check_path instead of check_expr

5 years agoFix rebase fallout
flip1995 [Sun, 24 Feb 2019 16:54:53 +0000 (17:54 +0100)]
Fix rebase fallout

5 years agoAdd register_internals function to `rustc_lint`
flip1995 [Thu, 6 Dec 2018 13:03:12 +0000 (14:03 +0100)]
Add register_internals function to `rustc_lint`

5 years agoUplift match_def_path from Clippy
flip1995 [Thu, 6 Dec 2018 13:02:21 +0000 (14:02 +0100)]
Uplift match_def_path from Clippy

5 years agoAdd internal lints default_hash_types and usage_of_ty_tykind
flip1995 [Thu, 6 Dec 2018 12:50:04 +0000 (13:50 +0100)]
Add internal lints default_hash_types and usage_of_ty_tykind

5 years agoAdd tests for internal lints
flip1995 [Thu, 6 Dec 2018 12:49:26 +0000 (13:49 +0100)]
Add tests for internal lints

5 years agoRevert rust-lld place changes.
O01eg [Wed, 3 Apr 2019 15:55:37 +0000 (18:55 +0300)]
Revert rust-lld place changes.

5 years agomake StringReader methods private
Aleksey Kladov [Wed, 3 Apr 2019 15:33:54 +0000 (18:33 +0300)]
make StringReader methods private

5 years agomake StringReader fields private
Aleksey Kladov [Wed, 3 Apr 2019 15:20:50 +0000 (18:20 +0300)]
make StringReader fields private

5 years agowasi: Fill out `std::fs` module for WASI
Alex Crichton [Fri, 29 Mar 2019 22:57:14 +0000 (15:57 -0700)]
wasi: Fill out `std::fs` module for WASI

This commit fills out the `std::fs` module and implementation for WASI.
Not all APIs are implemented, such as permissions-related ones and
`canonicalize`, but all others APIs have been implemented and very
lightly tested so far. We'll eventually want to run a more exhaustive
test suite!

For now the highlights of this commit are:

* The `std::fs::File` type is now backed by `WasiFd`, a raw WASI file
  descriptor.
* All APIs in `std::fs` (except permissions/canonicalize) have
  implementations for the WASI target.
* A suite of unstable extension traits were added to
  `std::os::wasi::fs`. These traits expose the raw filesystem
  functionality of WASI, namely `*at` syscalls (opening a file relative
  to an already opened one, for example). Additionally metadata only
  available on wasi is exposed through these traits.

Perhaps one of the most notable parts is the implementation of
path-taking APIs. WASI actually has no fundamental API that just takes a
path, but rather everything is relative to a previously opened file
descriptor. To allow existing APIs to work (that only take a path) WASI
has a few syscalls to learn about "pre opened" file descriptors by the
runtime. We use these to build a map of existing directory names to file
descriptors, and then when using a path we try to anchor it at an
already-opened file.

This support is very rudimentary though and is intended to be shared
with C since it's likely to be so tricky. For now though the C library
doesn't expose quite an API for us to use, so we implement it for now
and will swap it out as soon as one is available.

5 years agoAuto merge of #59182 - hug-dev:armv8m-base-hf, r=alexcrichton
bors [Wed, 3 Apr 2019 14:23:13 +0000 (14:23 +0000)]
Auto merge of #59182 - hug-dev:armv8m-base-hf, r=alexcrichton

Add dist builder for Armv8-M Baseline and HF

This commit adds the Armv8-M Baseline and Armv8-M Mainline with
FPU targets in the list of targets that
get their dist components built. It also update the build-manifest
so that this target gets also its dist components uploaded.

Made possible with the recent change merged in `compiler-builtins`:
rust-lang-nursery/compiler-builtins#276

A new `compiler-builtins` might be necessary for successfull compilation of the artefacts of those targets.

5 years agoAdd dist builder for Armv8-M Baseline and HF
Hugues de Valon [Tue, 12 Mar 2019 13:58:05 +0000 (13:58 +0000)]
Add dist builder for Armv8-M Baseline and HF

This commit adds the Armv8-M Baseline and Armv8-M Mainline with
FPU targets in the list of targets that
get their dist components built. It also update the build-manifest
so that this target gets also its dist components uploaded.

5 years agoUpdated the environment description in rustc.
Christian [Wed, 3 Apr 2019 13:50:20 +0000 (15:50 +0200)]
Updated the environment description in rustc.

5 years agoUpdated the reference in core::hint::spin_loop to the correct relative path.
Christian [Wed, 3 Apr 2019 13:47:38 +0000 (15:47 +0200)]
Updated the reference in core::hint::spin_loop to the correct relative path.

5 years agoupdate miri
Ralf Jung [Wed, 3 Apr 2019 13:05:45 +0000 (14:05 +0100)]
update miri

5 years agotry to fix rand feature flags
Ralf Jung [Sun, 31 Mar 2019 14:18:45 +0000 (16:18 +0200)]
try to fix rand feature flags

5 years agoupdate miri
Ralf Jung [Sat, 30 Mar 2019 11:55:20 +0000 (12:55 +0100)]
update miri

5 years agoAuto merge of #58458 - nnethercote:tweak-Span-encoding, r=petrochenkov
bors [Wed, 3 Apr 2019 11:27:38 +0000 (11:27 +0000)]
Auto merge of #58458 - nnethercote:tweak-Span-encoding, r=petrochenkov

Tweak `Span` encoding.

Failing to fit `base` is more common than failing to fit `len`.

5 years agoUpdated the documentation of core::hints::spin_loop and core::sync::spin_loop_hint
Christian [Wed, 3 Apr 2019 08:54:07 +0000 (10:54 +0200)]
Updated the documentation of core::hints::spin_loop and core::sync::spin_loop_hint

5 years agobe more direct about borrow requirenments
Aleksey Kladov [Wed, 3 Apr 2019 08:19:16 +0000 (11:19 +0300)]
be more direct about borrow requirenments

5 years agoAuto merge of #59657 - Centril:rollup-w5p98mc, r=Centril
bors [Wed, 3 Apr 2019 05:30:20 +0000 (05:30 +0000)]
Auto merge of #59657 - Centril:rollup-w5p98mc, r=Centril

Rollup of 4 pull requests

Successful merges:

 - #55448 (Add 'partition_at_index/_by/_by_key' for slices.)
 - #59186 (improve worst-case performance of BTreeSet intersection v3)
 - #59514 (Remove adt_def from projections and downcasts in MIR)
 - #59630 (Shrink `mir::Statement`.)

Failed merges:

r? @ghost

5 years agoRollup merge of #59630 - nnethercote:shrink-mir-Statement, r=pnkfelix
Mazdak Farrokhzad [Wed, 3 Apr 2019 02:36:14 +0000 (04:36 +0200)]
Rollup merge of #59630 - nnethercote:shrink-mir-Statement, r=pnkfelix

Shrink `mir::Statement`.

The `InlineAsm` variant is extremely rare, and `mir::Statement` often
contributes significantly to peak memory usage.

5 years agoRollup merge of #59514 - tmandry:remove-adt-def-from-projection-elem, r=eddyb
Mazdak Farrokhzad [Wed, 3 Apr 2019 02:36:12 +0000 (04:36 +0200)]
Rollup merge of #59514 - tmandry:remove-adt-def-from-projection-elem, r=eddyb

Remove adt_def from projections and downcasts in MIR

As part of optimizing generator layouts in MIR, we'd like to allow downcasting generators to variants which do not have a corresponding `def_id`, since they are created by the compiler.

This refactor hopes to allow that, without regressing perf.

r? @eddyb

5 years agoRollup merge of #59186 - ssomers:btreeset_intersection_revisited_again, r=KodrAus
Mazdak Farrokhzad [Wed, 3 Apr 2019 02:36:11 +0000 (04:36 +0200)]
Rollup merge of #59186 - ssomers:btreeset_intersection_revisited_again, r=KodrAus

improve worst-case performance of BTreeSet intersection v3

Variation of [#59078](https://github.com/rust-lang/rust/pull/59078) with `Intersection` remaining a struct

r? @scottmcm

5 years agoRollup merge of #55448 - Mokosha:SortAtIndex, r=bluss
Mazdak Farrokhzad [Wed, 3 Apr 2019 02:36:09 +0000 (04:36 +0200)]
Rollup merge of #55448 - Mokosha:SortAtIndex, r=bluss

Add 'partition_at_index/_by/_by_key' for slices.

This is an analog to C++'s std::nth_element (a.k.a. quickselect).

Corresponds to tracking bug #55300.

5 years agoLink to sync_all
Chris Gregory [Wed, 3 Apr 2019 02:26:11 +0000 (22:26 -0400)]
Link to sync_all

5 years agoTweak `Span` encoding.
Nicholas Nethercote [Thu, 14 Feb 2019 08:17:07 +0000 (19:17 +1100)]
Tweak `Span` encoding.

Failing to fit `base` is more common than failing to fit `len`.

5 years agoShrink `mir::Statement`.
Nicholas Nethercote [Tue, 2 Apr 2019 09:07:09 +0000 (20:07 +1100)]
Shrink `mir::Statement`.

The `InlineAsm` variant is extremely rare, and `mir::Statement` often
contributes significantly to peak memory usage.

5 years agoAuto merge of #59638 - alexcrichton:less-assertions, r=pietroalbini
bors [Tue, 2 Apr 2019 21:40:20 +0000 (21:40 +0000)]
Auto merge of #59638 - alexcrichton:less-assertions, r=pietroalbini

ci: Disable llvm/debug assertions on x86_64-mingw

Tracked at #59637 for re-enabling this commit disables assertions to
hopefully bring the runtime for this builder under control.

5 years agoRemove adt_def from PlaceTy and make it a struct
Tyler Mandry [Fri, 29 Mar 2019 02:08:31 +0000 (19:08 -0700)]
Remove adt_def from PlaceTy and make it a struct

5 years agoReplace adt_def with name in mir::ProjectionElem::Downcast
Tyler Mandry [Fri, 29 Mar 2019 01:00:17 +0000 (18:00 -0700)]
Replace adt_def with name in mir::ProjectionElem::Downcast

5 years agoci: Disable llvm/debug assertions on x86_64-mingw
Alex Crichton [Tue, 2 Apr 2019 18:02:44 +0000 (11:02 -0700)]
ci: Disable llvm/debug assertions on x86_64-mingw

Tracked at #59637 for re-enabling this commit disables assertions to
hopefully bring the runtime for this builder under control.

5 years agoAuto merge of #59636 - Centril:rollup, r=Centril
bors [Tue, 2 Apr 2019 16:26:10 +0000 (16:26 +0000)]
Auto merge of #59636 - Centril:rollup, r=Centril

Rollup of 4 pull requests

Successful merges:

 - #59166 (resolve: collect trait aliases along with traits)
 - #59341 (Fix custom relative libdir)
 - #59446 (Fix stack overflow when generating debuginfo for 'recursive' type)
 - #59529 (Added documentation on the remainder (Rem) operator for floating points.)

Failed merges:

r? @ghost

5 years agoRollup merge of #59529 - DevQps:improve-rem-docs, r=cuviper
Mazdak Farrokhzad [Tue, 2 Apr 2019 16:25:17 +0000 (18:25 +0200)]
Rollup merge of #59529 - DevQps:improve-rem-docs, r=cuviper

Added documentation on the remainder (Rem) operator for floating points.

# Description

As has been explained in #57738 the remainder operator on floating points is not clear.
This PR requests adds some information on how the `Rem` / remainder operator on floating points works.

Note also that this description is for both `Rem<f32> for f32` and `Rem<f64> for f64` implementations.

Ps. I wasn't really sure on how to formulate things. So please suggest changes if you have better idea's!

closes #57738

5 years agoRollup merge of #59446 - Aaron1011:fix/debuginfo-overflow, r=oli-obk
Mazdak Farrokhzad [Tue, 2 Apr 2019 16:25:15 +0000 (18:25 +0200)]
Rollup merge of #59446 - Aaron1011:fix/debuginfo-overflow, r=oli-obk

Fix stack overflow when generating debuginfo for 'recursive' type

By using 'impl trait', it's possible to create a self-referential
type as follows:

fn foo() -> impl Copy { foo }

This is a function which returns itself.
Normally, the signature of this function would be impossible
to write - it would look like 'fn foo() -> fn() -> fn() ...'
e.g. a function which returns a function, which returns a function...

Using 'impl trait' allows us to avoid writing this infinitely long
type. While it's useless for practical purposes, it does compile and run

However, issues arise when we try to generate llvm debuginfo for such a
type. All 'impl trait' types (e.g. ty::Opaque) are resolved when we
generate debuginfo, which can lead to us recursing back to the original
'fn' type when we try to process its return type.

To resolve this, I've modified debuginfo generation to account for these
kinds of weird types. Unfortunately, there's no 'correct' debuginfo that
we can generate - 'impl trait' does not exist in debuginfo, and this
kind of recursive type is impossible to directly represent.

To ensure that we emit *something*, this commit emits dummy
debuginfo/type names whenever it encounters a self-reference. In
practice, this should never happen - it's just to ensure that we can
emit some kind of debuginfo, even if it's not particularly meaningful

Fixes #58463

5 years agoRollup merge of #59341 - o01eg:use-custom-libdir, r=Mark-Simulacrum
Mazdak Farrokhzad [Tue, 2 Apr 2019 16:25:14 +0000 (18:25 +0200)]
Rollup merge of #59341 - o01eg:use-custom-libdir, r=Mark-Simulacrum

Fix custom relative libdir

While working on #58947 I found out relative libdir ignored during setting LD_LIBRARY_PATH.

5 years agoRollup merge of #59166 - seanmonstar:trait-alias-import, r=alexreg
Mazdak Farrokhzad [Tue, 2 Apr 2019 16:25:12 +0000 (18:25 +0200)]
Rollup merge of #59166 - seanmonstar:trait-alias-import, r=alexreg

resolve: collect trait aliases along with traits

It seems trait aliases weren't being collected as `TraitCandidates` in resolve, this should change that. (I can't compile the full compiler locally, so relying on CI...)

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

r? @alexreg

5 years agoAuto merge of #59632 - Centril:rollup, r=Centril
bors [Tue, 2 Apr 2019 13:06:12 +0000 (13:06 +0000)]
Auto merge of #59632 - Centril:rollup, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #59262 (Remove duplicated code from Iterator::{ne, lt, le, gt, ge})
 - #59286 (Refactor async fn return type lowering)
 - #59444 (Implement useful steps_between for all integers)
 - #59452 (Speed up rustdoc run a bit)
 - #59533 (Support allocating iterators with arenas)
 - #59585 (Fixes for shallow borrows)
 - #59607 (Renames `EvalErrorKind` to `InterpError`)
 - #59613 (SGX target: convert a bunch of panics to aborts)

Failed merges:

 - #59630 (Shrink `mir::Statement`.)

r? @ghost

5 years agoRollup merge of #59613 - jethrogb:jb/waitqueue-wait-unwind, r=alexcrichton
Mazdak Farrokhzad [Tue, 2 Apr 2019 11:47:31 +0000 (13:47 +0200)]
Rollup merge of #59613 - jethrogb:jb/waitqueue-wait-unwind, r=alexcrichton

SGX target: convert a bunch of panics to aborts

Fixes https://github.com/fortanix/rust-sgx/issues/86, https://github.com/fortanix/rust-sgx/issues/103 and in general protect preemptively against Iago attacks by aborting instead of unwinding in potentially unexpected situations.

5 years agoRollup merge of #59607 - kenta7777:renames-EvalErrorKind-to-InterpError, r=oli-obk
Mazdak Farrokhzad [Tue, 2 Apr 2019 11:47:30 +0000 (13:47 +0200)]
Rollup merge of #59607 - kenta7777:renames-EvalErrorKind-to-InterpError, r=oli-obk

Renames `EvalErrorKind` to `InterpError`

This PR renames `EvalErrorKind` to `InterpError`.
This is related to #54395.

5 years agoRollup merge of #59585 - rust-lang:shallow-borrow-fixes, r=pnkfelix
Mazdak Farrokhzad [Tue, 2 Apr 2019 11:47:28 +0000 (13:47 +0200)]
Rollup merge of #59585 - rust-lang:shallow-borrow-fixes, r=pnkfelix

Fixes for shallow borrows

* Don't promote these borrows if we're going to remove them before
  codegen
* Correctly mark unreachable code

5 years agoRollup merge of #59533 - Zoxc:arena-slices, r=michaelwoerister
Mazdak Farrokhzad [Tue, 2 Apr 2019 11:47:27 +0000 (13:47 +0200)]
Rollup merge of #59533 - Zoxc:arena-slices, r=michaelwoerister

Support allocating iterators with arenas

Split out from https://github.com/rust-lang/rust/pull/57173.

r? @michaelwoerister

5 years agoRollup merge of #59452 - GuillaumeGomez:speedup-rustdoc, r=QuietMisdreavus
Mazdak Farrokhzad [Tue, 2 Apr 2019 11:47:25 +0000 (13:47 +0200)]
Rollup merge of #59452 - GuillaumeGomez:speedup-rustdoc, r=QuietMisdreavus

Speed up rustdoc run a bit

r? @QuietMisdreavus

5 years agoRollup merge of #59444 - cuviper:steps_between, r=scottmcm
Mazdak Farrokhzad [Tue, 2 Apr 2019 11:47:24 +0000 (13:47 +0200)]
Rollup merge of #59444 - cuviper:steps_between, r=scottmcm

Implement useful steps_between for all integers

We can use `usize::try_from` to convert steps from any size of integer.
This enables a meaningful `size_hint()` for larger ranges, rather than
always just `(0, None)`. Now they return the true `(len, Some(len))`
when it fits, otherwise `(usize::MAX, None)` for overflow.

5 years agoRollup merge of #59286 - cramertj:async-fn-ret-ty, r=varkor
Mazdak Farrokhzad [Tue, 2 Apr 2019 11:47:22 +0000 (13:47 +0200)]
Rollup merge of #59286 - cramertj:async-fn-ret-ty, r=varkor

Refactor async fn return type lowering

async fn now lowers directly to an existential type declaration
rather than reusing the `impl Trait` return type lowering.

As part of this, it lowers all argument-position elided lifetimes
using the in-band-lifetimes machinery, creating fresh parameter
names for each of them, using each lifetime parameter as a generic
argument to the generated existential type.

This doesn't currently successfully allow multiple
argument-position elided lifetimes since `existential type`
doesn't yet support multiple lifetimes where neither outlive
the other:
```rust
existential type Foo<'a, 'b>:; // error: ambiguous lifetime bound in `impl Trait`
fn foo<'a, 'b>(_: &'a u8, _: &'b u8) -> Foo<'a, 'b> { () }
```

This requires a separate fix.

Fix #59001
Fix #58885
Fix #55324
Fix #54974
Progress on #56238

r? @nikomatsakis

5 years agoRollup merge of #59262 - timvermeulen:iterator_cmp_dedup, r=scottmcm
Mazdak Farrokhzad [Tue, 2 Apr 2019 11:47:21 +0000 (13:47 +0200)]
Rollup merge of #59262 - timvermeulen:iterator_cmp_dedup, r=scottmcm

Remove duplicated code from Iterator::{ne, lt, le, gt, ge}

This PR delegates `Iterator::ne` to `Iterator::eq` and `Iterator::{lt, le, gt, ge}` to `Iterator::partial_cmp`.

Oddly enough, this change actually simplifies the generated assembly [in some cases](https://rust.godbolt.org/z/riBtNe), although I don't understand assembly well enough to see if the longer assembly is doing something clever.

I also added two extremely simple benchmarks:
```
// before
test iter::bench_lt               ... bench:      98,404 ns/iter (+/- 21,008)
test iter::bench_partial_cmp      ... bench:      62,437 ns/iter (+/- 5,009)

// after
test iter::bench_lt               ... bench:      61,757 ns/iter (+/- 8,770)
test iter::bench_partial_cmp      ... bench:      62,151 ns/iter (+/- 13,753)
```

I have no idea why the current `lt`/`le`/`gt`/`ge` implementations don't seem to be compiled optimally, but simply having them call `partial_cmp` seems to be an improvement.

See #44729 for a previous discussion.