]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoRollup merge of #40142 - MajorBreakfast:patch-4, r=steveklabnik
Steve Klabnik [Tue, 28 Feb 2017 23:38:40 +0000 (15:38 -0800)]
Rollup merge of #40142 - MajorBreakfast:patch-4, r=steveklabnik

Structs doc: Change "pointers" to "references"

Let's call them "references" instead of "pointers". That's how they're called in chapter 4.9 "References and Borrowing".

r? @steveklabnik

7 years agoRollup merge of #40130 - alexcrichton:fix-musl-again, r=nikomatsakis
Steve Klabnik [Tue, 28 Feb 2017 23:38:39 +0000 (15:38 -0800)]
Rollup merge of #40130 - alexcrichton:fix-musl-again, r=nikomatsakis

travis: Fix typos in linux-tested-targets

These flags were supposed to be relevant for musl, not for gnu

cc #39979

7 years agoAuto merge of #40148 - frewsxcv:rollup, r=frewsxcv
bors [Tue, 28 Feb 2017 14:06:39 +0000 (14:06 +0000)]
Auto merge of #40148 - frewsxcv:rollup, r=frewsxcv

Rollup of 9 pull requests

- Successful merges: #39977, #40033, #40047, #40056, #40057, #40122, #40124, #40126, #40131
- Failed merges: #40101

7 years agoRollup merge of #40131 - MajorBreakfast:patch-3, r=steveklabnik
Corey Farwell [Tue, 28 Feb 2017 13:33:10 +0000 (08:33 -0500)]
Rollup merge of #40131 - MajorBreakfast:patch-3, r=steveklabnik

Make lifetime elision docs clearer

Previously it said
"It's forbidden to allow reasoning about types based on the item signature alone."

I think that sentence is wrong. Rust **uses** the item signatures to perform type inference within the body. I think what's meant is the other way around: It does not infer types for item signatures.

r? @steveklabnik

7 years agoRollup merge of #40126 - GuillaumeGomez:fmt-write-docs, r=frewsxcv
Corey Farwell [Tue, 28 Feb 2017 13:33:09 +0000 (08:33 -0500)]
Rollup merge of #40126 - GuillaumeGomez:fmt-write-docs, r=frewsxcv

Add missing docs and examples for fmt::Write

r? @frewsxcv

7 years agoRollup merge of #40124 - koba-e964:patch-1, r=steveklabnik
Corey Farwell [Tue, 28 Feb 2017 13:33:08 +0000 (08:33 -0500)]
Rollup merge of #40124 - koba-e964:patch-1, r=steveklabnik

Remove unnecessary "for"

7 years agoRollup merge of #40122 - robinst:process-add-example-for-writing-to-stdin, r=alexcrichton
Corey Farwell [Tue, 28 Feb 2017 13:33:07 +0000 (08:33 -0500)]
Rollup merge of #40122 - robinst:process-add-example-for-writing-to-stdin, r=alexcrichton

Example for how to provide stdin using std::process::Command

Spawning a child process and writing to its stdin is a bit tricky due to
`as_mut` and having to use a limited borrow. An example for this might
help newer users.

r? @steveklabnik

7 years agoRollup merge of #40057 - GuillaumeGomez:html-issue, r=frewsxcv
Corey Farwell [Tue, 28 Feb 2017 13:33:05 +0000 (08:33 -0500)]
Rollup merge of #40057 - GuillaumeGomez:html-issue, r=frewsxcv

Fix nightly-only experimental API display

Before:

<img width="1440" alt="screen shot 2017-02-23 at 12 53 09" src="https://cloud.githubusercontent.com/assets/3050060/23258119/0c9cf6f2-f9c7-11e6-9989-15b4346dade0.png">

After:

<img width="1440" alt="screen shot 2017-02-23 at 12 51 40" src="https://cloud.githubusercontent.com/assets/3050060/23258076/e6881118-f9c6-11e6-826c-442a73502b59.png">

r? @frewsxcv

7 years agoRollup merge of #40056 - keeperofdakeys:contributing, r=alexcrichton
Corey Farwell [Tue, 28 Feb 2017 13:33:04 +0000 (08:33 -0500)]
Rollup merge of #40056 - keeperofdakeys:contributing, r=alexcrichton

Replace ./configure with config.toml in README.md and CONTRIBUTING.md

Replace ./configure with config.toml in README.md and CONTRIBUTING.md, so that new users aren't confused about which build system to use, and how to configure the build process.

7 years agoRollup merge of #40047 - topecongiro:master, r=est31
Corey Farwell [Tue, 28 Feb 2017 13:33:02 +0000 (08:33 -0500)]
Rollup merge of #40047 - topecongiro:master, r=est31

Add compile fail test for unboxed_closures feature

Hello, this is my first contribution to rust.
Issue #39059.

7 years agoRollup merge of #40033 - GuillaumeGomez:condvar-docs, r=frewsxcv
Corey Farwell [Tue, 28 Feb 2017 13:33:01 +0000 (08:33 -0500)]
Rollup merge of #40033 - GuillaumeGomez:condvar-docs, r=frewsxcv

Add missing urls and examples for Condvar docs

r? @frewsxcv

7 years agoRollup merge of #39977 - frewsxcv:error-reporting-cleanup, r=eddyb
Corey Farwell [Tue, 28 Feb 2017 13:33:00 +0000 (08:33 -0500)]
Rollup merge of #39977 - frewsxcv:error-reporting-cleanup, r=eddyb

librustc error_reporting.rs cleanup.

Read some code in librustc, mainly in error_reporting.rs, and cleaned up some things along the way. I recommend looking at each commit individually or looking at the [whitespace insensitive diff](https://github.com/rust-lang/rust/pull/39977/files?w=1).

7 years agoReplace ./configure with config.toml in README.md and CONTRIBUTING.md
Josh Driver [Thu, 23 Feb 2017 10:45:30 +0000 (21:15 +1030)]
Replace ./configure with config.toml in README.md and CONTRIBUTING.md

7 years agoAdd missing docs and examples for fmt::Write
Guillaume Gomez [Mon, 27 Feb 2017 18:00:43 +0000 (19:00 +0100)]
Add missing docs and examples for fmt::Write

7 years agoAuto merge of #40135 - alexcrichton:split-android, r=aturon
bors [Tue, 28 Feb 2017 10:00:31 +0000 (10:00 +0000)]
Auto merge of #40135 - alexcrichton:split-android, r=aturon

travis: Split Android into dist/test images

PRs can't land againt beta right now because the android bot is filling up on
disk space. I don't really know what's going on but the android bot is the
longest one to run anyway so it'll benefit from being split up regardless.

7 years agoStructs doc: Change "pointers" to "references"
Josef Brandl [Tue, 28 Feb 2017 09:58:13 +0000 (10:58 +0100)]
Structs doc: Change "pointers" to "references"

7 years agoAuto merge of #40008 - eddyb:lazy-12, r=nikomatsakis
bors [Tue, 28 Feb 2017 07:59:25 +0000 (07:59 +0000)]
Auto merge of #40008 - eddyb:lazy-12, r=nikomatsakis

[12/12] On-demand type-checking, const-evaluation, MIR building & const-qualification.

_This is the last of a series ([prev](https://github.com/rust-lang/rust/pull/38813)) of patches designed to rework rustc into an out-of-order on-demand pipeline model for both better feature support (e.g. [MIR-based](https://github.com/solson/miri) early constant evaluation) and incremental execution of compiler passes (e.g. type-checking), with beneficial consequences to IDE support as well.
If any motivation is unclear, please ask for additional PR description clarifications or code comments._

<hr>

As this contains all of the changes that didn't fit neatly into other PRs, I'll be elaborating a bit:

### User-facing changes
* when determining whether an `impl Trait` type implements an auto-trait (e.g. `Send` or `Sync`), the function the `impl Trait` came from has to be inferred and type-checking, disallowing cycles
  * this results from not having an obvious place to put the "deferred obligation" in on-demand atm
  * while we could model side-effects like that and "post-processing passes" better, it's still more limiting than being able to know the result in the original function (e.g. specialization) *and* there are serious problems around region-checking (if a `Send` impl required `'static`, it wasn't enforced)
* early const-eval requires type-checking and const-qualification to be performed first, which means:
  * you get the intended errors before (if any) constant evaluation error that is simply fallout
  * associated consts should always work now, and `const fn` type parameters are properly tracked
    * don't get too excited, array lengths still can't depend on type parameters
* #38864 works as intended now, with `Self` being allowed in `impl` bounds
* #32205 is largely improved, with associated types being limited to "exact match" `impl`s (as opposed to traversing the specialization graph to resolve unspecified type parameters to their defaults in another `impl` or in the `trait`) *while* checking for overlaps building the specialization graph for that trait - once all the trait impls' have been checked for coherence (including ahead-of-time/on-demand), it's uniform
* [crater report](https://gist.github.com/eddyb/bbb869072468c7e08d6d808e75938051) looks clean (aside from `clippy` which broke due to `rustc` internal changes)

### Compiler-internal changes
* `ty::Generics`
  * no longer contains the actual type parameter defaults, instead they're associated with the type parameter's `DefId`, like associated types in a trait definition
    * this allows computing `ty::Generics` as a leaf (reading only its own HIR)
  * holds a mapping from `DefIndex` of type parameters to their indices
* `ty::AdtDef`
  * only tracks `#[repr(simd)]` in its `ReprOptions` `repr` field
  * doesn't contain `enum` discriminant values, but instead each variant either refers to either an explicit value for its discriminant, or the distance from the last explicit discriminant, if any
    * the `.discriminants(tcx)` method produces an iterator of `ConstInt` values, looking up explicit discriminants in a separate map, if necessary
    * this allows computing `ty::AdtDef` as a leaf (reading only its own HIR)
* Small note: the two above (`Generics`, `AdtDef`), `TraitDef` and `AssociatedItem` should probably end up as part of the HIR, eventually, as they're trivially constructed from it
* `ty::FnSig`
  * now also holds ABI and unsafety, alongside argument types, return type and C variadicity
  * `&ty::BareFnTy` and `ty::ClosureTy` have been replaced with `PolyFnSig = Binder<FnSig>`
    * `BareFnTy` was interned and `ClosureTy` was treated as non-trivial to `Clone` because they had a `PolyFnSig` and so used to contain a `Vec<Ty>` (now `&[Ty]`)
* `ty::maps`
  * all the `DepTrackingMap`s have been grouped in a structure available at `tcx.maps`
  * when creating the `tcx`, a set of `Providers` (one `fn` pointer per map) is required for the local crate, and one for all other crates (i.e. metadata loading), `librustc_driver` plugging the various crates (e.g. `librustc_metadata`, `librustc_typeck`, `librustc_mir`) into it
  * when a map is queried and the value is missing, the appropriate `fn` pointer from the `Providers` of that crate is called with the `TyCtxt` and the key being queried, to produce the value on-demand
* `rustc_const_eval`
  * demands both `typeck_tables` and `mir_const_qualif` (in preparation for miri)
  * tracks `Substs` in `ConstVal::Function` for `const fn` calls
  * returns `TypeckError` if type-checking has failed (or cases that can only be reached if it had)
    * this error kind is never reported, resulting in less noisy/redundant diagnostics
  * fixes #39548 (testcase by @larsluthman, taken from #39812, which this supersedes)
* on-demand has so far been hooked up to:
  * `rustc_metadata::cstore_impl`: `ty`, `generics`, `predicates`, `super_predicates`, `trait_def`, `adt_def`, `variances`, `associated_item_def_ids`, `associated_item`, `impl_trait_ref`, `custom_coerce_unsized_kind`, `mir`, `mir_const_qualif`, `typeck_tables`, `closure_kind`, `closure_type`
  * `rustc_typeck::collect`: `ty`, `generics`, `predicates`, `super_predicates`, `type_param_predicates`, `trait_def`, `adt_def`, `impl_trait_ref`
  * `rustc_typeck::coherence`: `coherent_trait`, `coherent_inherent_impls`
  * `rustc_typeck::check`: `typeck_tables`, `closure_type`, `closure_kind`
  * `rustc_mir::mir_map`: `mir`
  * `rustc_mir::transform::qualify_consts`: `mir_const_qualif`

7 years agorustc_save_analysis: don't pollute the codemap with fake files.
Eduard Burtescu [Fri, 10 Jun 2016 10:00:21 +0000 (13:00 +0300)]
rustc_save_analysis: don't pollute the codemap with fake files.

7 years agotravis: Split Android into dist/test images
Alex Crichton [Mon, 27 Feb 2017 22:53:12 +0000 (14:53 -0800)]
travis: Split Android into dist/test images

PRs can't land againt beta right now because the android bot is filling up on
disk space. I don't really know what's going on but the android bot is the
longest one to run anyway so it'll benefit from being split up regardless.

7 years agoAuto merge of #40095 - alexcrichton:sccache-mingw, r=brson
bors [Tue, 28 Feb 2017 02:26:09 +0000 (02:26 +0000)]
Auto merge of #40095 - alexcrichton:sccache-mingw, r=brson

appveyor: Use sccache on pc-windows-gnu for caching

Now that mozilla/sccache#43 is fixed the caching works for MinGW on Windows. We
still can't use it for MSVC just yet, but I'll try to revive that branch at some
point.

7 years agoAdd compile fail test for unboxed_closures feature
topecongiro [Thu, 23 Feb 2017 05:04:09 +0000 (14:04 +0900)]
Add compile fail test for unboxed_closures feature

7 years agoMake lifetime elision docs clearer
Josef Brandl [Mon, 27 Feb 2017 20:49:05 +0000 (21:49 +0100)]
Make lifetime elision docs clearer

7 years agotravis: Fix typos in linux-tested-targets
Alex Crichton [Mon, 27 Feb 2017 20:46:43 +0000 (12:46 -0800)]
travis: Fix typos in linux-tested-targets

These flags were supposed to be relevant for musl, not for gnu

cc #39979

7 years agoappveyor: Use sccache on pc-windows-gnu for caching
Alex Crichton [Sat, 25 Feb 2017 08:53:12 +0000 (00:53 -0800)]
appveyor: Use sccache on pc-windows-gnu for caching

Now that mozilla/sccache#43 is fixed the caching works for MinGW on Windows. We
still can't use it for MSVC just yet, but I'll try to revive that branch at some
point.

7 years agoAuto merge of #38165 - Yamakaky:better-backtrace, r=petrochenkov
bors [Mon, 27 Feb 2017 17:21:37 +0000 (17:21 +0000)]
Auto merge of #38165 - Yamakaky:better-backtrace, r=petrochenkov

Improve backtrace formating while panicking.

Fixes #37783.

Done:

- Fix alignment of file paths for better readability
- `RUST_BACKTRACE=full` prints all the informations (current behaviour)
- `RUST_BACKTRACE=(short|yes)` is the default and does:
  - Skip irrelevant frames at the beginning and the end
  - Remove function address
  - Remove the current directory from the absolute paths
  - Remove `::hfabe6541873` at the end of the symbols
- `RUST_BACKTRACE=(0|no)` disables the backtrace.
- `RUST_BACKTRACE=<everything else>` is equivalent to `short` for
  backward compatibility.
- doc
- More uniform printing across platforms.

Removed, TODO in a new PR:

- Remove path prefix for libraries and libstd

Example of short backtrace:
```rust
fn fail() {
    panic!();
}

fn main() {
    let closure = || fail();
    closure();
}
```
Short:
```
thread 'main' panicked at 'explicit panic', t.rs:2
Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: t::fail
            at ./t.rs:2
   1: t::main::{{closure}}
            at ./t.rs:6
   2: t::main
            at ./t.rs:7
```
Full:
```
thread 'main' panicked at 'This function never returns!', t.rs:2
stack backtrace:
   0:     0x558ddf666478 - std::sys::imp::backtrace::tracing::imp::unwind_backtrace::hec84c9dd8389cc5d
                               at /home/yamakaky/dev/rust/rust/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1:     0x558ddf65d90e - std::sys_common::backtrace::_print::hfa25f8b31f4b4353
                               at /home/yamakaky/dev/rust/rust/src/libstd/sys_common/backtrace.rs:71
   2:     0x558ddf65cb5e - std::sys_common::backtrace::print::h9b711e11ac3ba805
                               at /home/yamakaky/dev/rust/rust/src/libstd/sys_common/backtrace.rs:60
   3:     0x558ddf66796e - std::panicking::default_hook::{{closure}}::h736d216e74748044
                               at /home/yamakaky/dev/rust/rust/src/libstd/panicking.rs:355
   4:     0x558ddf66743c - std::panicking::default_hook::h16baff397e46ea10
                               at /home/yamakaky/dev/rust/rust/src/libstd/panicking.rs:371
   5:     0x558ddf6682bc - std::panicking::rust_panic_with_hook::h6d5a9bb4eca42c80
                               at /home/yamakaky/dev/rust/rust/src/libstd/panicking.rs:559
   6:     0x558ddf64ea93 - std::panicking::begin_panic::h17dc549df2f10b99
                               at /home/yamakaky/dev/rust/rust/src/libstd/panicking.rs:521
   7:     0x558ddf64ec42 - t::diverges::he6bc43fc925905f5
                               at /tmp/p/t.rs:2
   8:     0x558ddf64ec5a - t::main::h0ffc20356b8a69c0
                               at /tmp/p/t.rs:6
   9:     0x558ddf6687f5 - core::ops::FnOnce::call_once::hce41f19c0db56f93
  10:     0x558ddf667cde - std::panicking::try::do_call::hd4c8c97efb4291df
                               at /home/yamakaky/dev/rust/rust/src/libstd/panicking.rs:464
  11:     0x558ddf698d77 - __rust_try
  12:     0x558ddf698c57 - __rust_maybe_catch_panic
                               at /home/yamakaky/dev/rust/rust/src/libpanic_unwind/lib.rs:98
  13:     0x558ddf667adb - std::panicking::try::h2c56ed2a59ec1d12
                               at /home/yamakaky/dev/rust/rust/src/libstd/panicking.rs:440
  14:     0x558ddf66cc9a - std::panic::catch_unwind::h390834e0251cc9af
                               at /home/yamakaky/dev/rust/rust/src/libstd/panic.rs:361
  15:     0x558ddf6809ee - std::rt::lang_start::hb73087428e233982
                               at /home/yamakaky/dev/rust/rust/src/libstd/rt.rs:57
  16:     0x558ddf64ec92 - main
  17:     0x7fecb869e290 - __libc_start_main
  18:     0x558ddf64e8b9 - _start
  19:                0x0 - <unknown>
```

7 years agoRemove unnecessary "for"
Hiroki Kobayashi [Mon, 27 Feb 2017 15:47:24 +0000 (00:47 +0900)]
Remove unnecessary "for"

7 years agoThis test is too hard to maintain cross-platform
Yamakaky [Mon, 27 Feb 2017 15:22:31 +0000 (10:22 -0500)]
This test is too hard to maintain cross-platform

7 years agoAuto merge of #40121 - king6cong:fix-typo, r=apasel422
bors [Mon, 27 Feb 2017 14:58:13 +0000 (14:58 +0000)]
Auto merge of #40121 - king6cong:fix-typo, r=apasel422

fix typo

7 years agoExample for how to provide stdin using std::process::Command
Robin Stocker [Mon, 27 Feb 2017 06:01:47 +0000 (17:01 +1100)]
Example for how to provide stdin using std::process::Command

Spawning a child process and writing to its stdin is a bit tricky due to
`as_mut` and having to use a limited borrow. An example for this might
help newer users.

7 years agofix typo
king6cong [Mon, 27 Feb 2017 03:18:11 +0000 (11:18 +0800)]
fix typo

7 years agoAuto merge of #40115 - MajorBreakfast:patch-2, r=steveklabnik
bors [Mon, 27 Feb 2017 02:20:29 +0000 (02:20 +0000)]
Auto merge of #40115 - MajorBreakfast:patch-2, r=steveklabnik

Loop docs: Present perfect instead of simple past

Sounds better with present perfect because there's a link to the present.

I'm not a native speaker, though. So, plz check whether it really is better ;)

r? @steveklabnik

7 years agoAlso ignore std::panic
Yamakaky [Mon, 27 Feb 2017 00:10:45 +0000 (19:10 -0500)]
Also ignore std::panic

7 years agoAuto merge of #40102 - pmer:pmer/use-macos-term-in-docs, r=steveklabnik
bors [Mon, 27 Feb 2017 00:06:11 +0000 (00:06 +0000)]
Auto merge of #40102 - pmer:pmer/use-macos-term-in-docs, r=steveklabnik

doc: Use "macOS" terminology consistently

One line in the documentation used the term macOS while the other six used OSX. Be consistent and use the current product brand of macOS.

7 years agoRemove unused
Yamakaky [Sun, 26 Feb 2017 20:53:45 +0000 (15:53 -0500)]
Remove unused

7 years agoAuto merge of #39738 - keeperofdakeys:vec-docs, r=GuillaumeGomez
bors [Sun, 26 Feb 2017 20:36:10 +0000 (20:36 +0000)]
Auto merge of #39738 - keeperofdakeys:vec-docs, r=GuillaumeGomez

Add notes about capacity effects to Vec::truncate()

Add notes about the effects of Vec::truncate() and Vec::clear() on the capacity of a vector.

7 years agoAuto merge of #40112 - alexcrichton:fetch-all, r=brson
bors [Sun, 26 Feb 2017 15:15:23 +0000 (15:15 +0000)]
Auto merge of #40112 - alexcrichton:fetch-all, r=brson

 travis: Make more network requests retryable

This commit attempts to move more network operations to being retryable through
various operations. For example git submodule updates, downloading snapshots,
etc, are now all in retryable steps.

Hopefully this commit can cut down on the number of network failures we've been
seeing!

7 years agoFix tests on Windows in Debug configuration (#4)
Vadim Petrochenkov [Sun, 26 Feb 2017 14:39:25 +0000 (17:39 +0300)]
Fix tests on Windows in Debug configuration (#4)

7 years agoLoop docs: Present perfect instead of simple past
Josef Brandl [Sun, 26 Feb 2017 14:33:45 +0000 (15:33 +0100)]
Loop docs: Present perfect instead of simple past

7 years agoAuto merge of #40111 - alexcrichton:fix-manifests, r=brson
bors [Sun, 26 Feb 2017 12:58:08 +0000 (12:58 +0000)]
Auto merge of #40111 - alexcrichton:fix-manifests, r=brson

Attempt to fix nightly manifests

Found a few bugs and mistakes with the manifests.

Closes #40106

7 years agotravis: Make more network requests retryable
Alex Crichton [Sat, 25 Feb 2017 08:00:47 +0000 (00:00 -0800)]
travis: Make more network requests retryable

This commit attempts to move more network operations to being retryable through
various operations. For example git submodule updates, downloading snapshots,
etc, are now all in retryable steps.

Hopefully this commit can cut down on the number of network failures we've been
seeing!

7 years agoAuto merge of #40078 - tclfs:patch-3, r=GuillaumeGomez
bors [Sun, 26 Feb 2017 05:22:08 +0000 (05:22 +0000)]
Auto merge of #40078 - tclfs:patch-3, r=GuillaumeGomez

Fix a typo

7 years agobuild-manifest: Remove old to_hex function
Alex Crichton [Sun, 26 Feb 2017 04:16:42 +0000 (20:16 -0800)]
build-manifest: Remove old to_hex function

This was actually just generating invalid hashes for the `rust`
component.

7 years agobuild-manifest: Fix typos with rust-analysis
Alex Crichton [Sun, 26 Feb 2017 04:16:22 +0000 (20:16 -0800)]
build-manifest: Fix typos with rust-analysis

The name of the package is 'rust-analysis', not 'analysis', and then
name of the channel is 'nightly', not 'rust-nightly'

7 years agodoc: Use "macOS" terminology consistently
Paul Merrill [Sat, 25 Feb 2017 23:46:10 +0000 (15:46 -0800)]
doc: Use "macOS" terminology consistently

One line in the documentation used the term macOS while the other six
used OSX. Be consistent and use the name current product brand of macOS.

7 years agotypo
Yamakaky [Sat, 25 Feb 2017 21:11:59 +0000 (16:11 -0500)]
typo

7 years agoFix nightly-only experimental API display
Guillaume Gomez [Thu, 23 Feb 2017 11:51:28 +0000 (12:51 +0100)]
Fix nightly-only experimental API display

7 years agorustc_const_eval: demand that the MIR qualify_consts ran on each evaluated body.
Eduard-Mihai Burtescu [Mon, 20 Feb 2017 01:55:28 +0000 (03:55 +0200)]
rustc_const_eval: demand that the MIR qualify_consts ran on each evaluated body.

7 years agorustc_const_eval: always demand typeck_tables for evaluating constants.
Eduard-Mihai Burtescu [Wed, 15 Feb 2017 13:00:20 +0000 (15:00 +0200)]
rustc_const_eval: always demand typeck_tables for evaluating constants.

7 years agorustc_typeck: rework coherence to be almost completely on-demand.
Eduard-Mihai Burtescu [Sun, 19 Feb 2017 12:46:29 +0000 (14:46 +0200)]
rustc_typeck: rework coherence to be almost completely on-demand.

7 years agorustc: allow handling cycle errors gracefully in on-demand.
Eduard-Mihai Burtescu [Sun, 19 Feb 2017 12:37:50 +0000 (14:37 +0200)]
rustc: allow handling cycle errors gracefully in on-demand.

7 years agorustc_typeck: hook up collect and item/body check to on-demand.
Eduard-Mihai Burtescu [Tue, 14 Feb 2017 09:32:00 +0000 (11:32 +0200)]
rustc_typeck: hook up collect and item/body check to on-demand.

7 years agorustc_typeck: move the leaves (generics, trait_def, adt_def) to on-demand.
Eduard-Mihai Burtescu [Mon, 13 Feb 2017 23:11:24 +0000 (01:11 +0200)]
rustc_typeck: move the leaves (generics, trait_def, adt_def) to on-demand.

7 years agorustc: simplify tcx.closure_type(...) as it can copy the cached values.
Eduard-Mihai Burtescu [Mon, 13 Feb 2017 21:26:32 +0000 (23:26 +0200)]
rustc: simplify tcx.closure_type(...) as it can copy the cached values.

7 years agorustc: combine BareFnTy and ClosureTy into FnSig.
Eduard-Mihai Burtescu [Mon, 13 Feb 2017 08:51:06 +0000 (10:51 +0200)]
rustc: combine BareFnTy and ClosureTy into FnSig.

7 years agorustc_typeck: don't use Result for get_type_parameter_bounds and ensure_super_predicates.
Eduard-Mihai Burtescu [Sat, 11 Feb 2017 17:26:13 +0000 (19:26 +0200)]
rustc_typeck: don't use Result for get_type_parameter_bounds and ensure_super_predicates.

7 years agorustc_typeck: lift CrateCtxt to TyCtxt.
Eduard Burtescu [Mon, 3 Oct 2016 23:19:40 +0000 (02:19 +0300)]
rustc_typeck: lift CrateCtxt to TyCtxt.

7 years agorustc_mir: expose MIR building through ty::maps::Provider.
Eduard-Mihai Burtescu [Wed, 8 Feb 2017 09:16:14 +0000 (11:16 +0200)]
rustc_mir: expose MIR building through ty::maps::Provider.

7 years agorustc: introduce a query system for type information in ty::maps.
Eduard Burtescu [Wed, 28 Sep 2016 23:30:53 +0000 (02:30 +0300)]
rustc: introduce a query system for type information in ty::maps.

7 years agorustc: consolidate dep-tracked hashmaps in tcx.maps.
Eduard-Mihai Burtescu [Tue, 7 Feb 2017 09:47:35 +0000 (11:47 +0200)]
rustc: consolidate dep-tracked hashmaps in tcx.maps.

7 years agorustc: move the actual values of enum discriminants into a map.
Eduard-Mihai Burtescu [Sun, 5 Feb 2017 05:01:48 +0000 (07:01 +0200)]
rustc: move the actual values of enum discriminants into a map.

7 years agorustc_typeck: simplify AstConv requests as implemented by collect.
Eduard-Mihai Burtescu [Thu, 2 Feb 2017 12:18:13 +0000 (14:18 +0200)]
rustc_typeck: simplify AstConv requests as implemented by collect.

7 years agorustc: store type parameter defaults outside of ty::Generics.
Eduard-Mihai Burtescu [Wed, 25 Jan 2017 20:01:11 +0000 (22:01 +0200)]
rustc: store type parameter defaults outside of ty::Generics.

7 years agoFix tests on ARM Linux (#3)
Vadim Petrochenkov [Sat, 25 Feb 2017 14:18:17 +0000 (17:18 +0300)]
Fix tests on ARM Linux (#3)

7 years agoAuto merge of #40091 - eddyb:rollup, r=eddyb
bors [Sat, 25 Feb 2017 12:29:32 +0000 (12:29 +0000)]
Auto merge of #40091 - eddyb:rollup, r=eddyb

Rollup of 28 pull requests

- Successful merges: #39859, #39864, #39888, #39903, #39905, #39914, #39945, #39950, #39953, #39961, #39980, #39988, #39993, #39995, #40019, #40020, #40022, #40024, #40025, #40026, #40027, #40031, #40035, #40037, #40038, #40064, #40069, #40086
- Failed merges: #39927, #40008, #40047

7 years agoRollup merge of #40086 - danobi:move-compiler_tests, r=brson
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:43 +0000 (14:13 +0200)]
Rollup merge of #40086 - danobi:move-compiler_tests, r=brson

Move COMPILER_TESTS.md out of the root directory

See #39896.

r? @brson

7 years agoRollup merge of #40069 - Rufflewind:master, r=steveklabnik
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:42 +0000 (14:13 +0200)]
Rollup merge of #40069 - Rufflewind:master, r=steveklabnik

Add Gankro's table to nomicon/src/phantom-data.md

Original: https://github.com/rust-lang/rust/issues/30069#issuecomment-159928136

Testing confirms that:

  - `PhantomData<fn() -> T>` does not actually enable drop checking.
  - `PhantomData<fn(T) -> T>` is neither variant nor contravariant.

7 years agoRollup merge of #40064 - arielb1:virtual-enum, r=nikomatsakis
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:41 +0000 (14:13 +0200)]
Rollup merge of #40064 - arielb1:virtual-enum, r=nikomatsakis

trans: don't ICE when trying to create ADT trans-items

ADTs are translated in-place from rustc_trans::callee, so no trans-items
are needed.

This fix will be superseded by the shimmir branch, but I prefer not to
backport that to beta.

Fixes #39823.

Beta-nominating because regression.

r? @michaelwoerister

7 years agoRollup merge of #40038 - nikomatsakis:issue-39828, r=michaelwoerister
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:39 +0000 (14:13 +0200)]
Rollup merge of #40038 - nikomatsakis:issue-39828, r=michaelwoerister

detect "bootstrap outputs" when serializing the dep-graph

Fixes #39828.

r? @michaelwoerister

7 years agoRollup merge of #40037 - froydnj:overflow-checks, r=alexcrichton
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:38 +0000 (14:13 +0200)]
Rollup merge of #40037 - froydnj:overflow-checks, r=alexcrichton

add `-C overflow-checks` option

In addition to defining and handling the new option, we also add a method on librustc::Session for determining the necessity of overflow checks.  This method provides a single point to sort out the three (!) different ways for turning on overflow checks: -C debug-assertions, -C overflow-checks, and -Z force-overflow-checks.

I was seeing a [run-pass/issue-28950.rs](https://github.com/rust-lang/rust/blob/b1363a73ede57ae595f3a1be2bb75d308ba4f7f6/src/test/run-pass/issue-28950.rs) failure on my machine with these patches, but I was also seeing the failure without the changes to the core compiler.  We'll see what travis says.

Fixes #33134.  r? @alexcrichton

7 years agoRollup merge of #40035 - er-1:master, r=alexcrichton
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:37 +0000 (14:13 +0200)]
Rollup merge of #40035 - er-1:master, r=alexcrichton

Ignore ASM tests on powerpc

Part of #39015

7 years agoRollup merge of #40031 - cynicaldevil:master, r=est31
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:36 +0000 (14:13 +0200)]
Rollup merge of #40031 - cynicaldevil:master, r=est31

Added test for inclusive_range_syntax in compile-fail test suite

Fixes #39059
r? @est31

Forgot to leave a comment on the issue, hopefully nobody else is working on this one!

7 years agoRollup merge of #40027 - cramertj:stabilize_static_recursion, r=nrc
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:35 +0000 (14:13 +0200)]
Rollup merge of #40027 - cramertj:stabilize_static_recursion, r=nrc

Stabilize static_recursion

Fix #29719.

7 years agoRollup merge of #40026 - nrc:analysis-manifest, r=alexcrichton
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:34 +0000 (14:13 +0200)]
Rollup merge of #40026 - nrc:analysis-manifest, r=alexcrichton

Add save-analysis data to nightly manifests.

For use by RLS.

r? @alexcrichton

7 years agoRollup merge of #40025 - est31:master, r=eddyb
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:33 +0000 (14:13 +0200)]
Rollup merge of #40025 - est31:master, r=eddyb

Implement non-capturing closure to fn coercion

Implements non capturing closure coercion ([RFC 1558](https://github.com/rust-lang/rfcs/blob/master/text/1558-closure-to-fn-coercion.md)).

cc tracking issue #39817

7 years agoRollup merge of #40024 - raphlinus:readdir, r=alexcrichton
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:32 +0000 (14:13 +0200)]
Rollup merge of #40024 - raphlinus:readdir, r=alexcrichton

Switch Fuchsia to readdir (instead of readdir_r)

The readdir_r function is deprecated on newer Posix systems because of
various problems, and not implemented at all for Fuchsia. There are
already implementations using both, and this patch switches Fuchsia
over to the readdir-based one.

Fixes #40021 for Fuchsia, but that issue also contains discussion of
what should happen for other Posix systems.

7 years agoRollup merge of #40022 - wagenet:lib-defaults, r=alexcrichton
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:31 +0000 (14:13 +0200)]
Rollup merge of #40022 - wagenet:lib-defaults, r=alexcrichton

Better handling of lib defaults

r? @alexcrichton

7 years agoRollup merge of #40020 - alexcrichton:fix-unwind-safe, r=sfackler
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:31 +0000 (14:13 +0200)]
Rollup merge of #40020 - alexcrichton:fix-unwind-safe, r=sfackler

std: Relax UnwindSafe impl for Unique

Add the `?Sized` bound as we don't require the type to be sized.

Closes #40011

7 years agoRollup merge of #40019 - alexcrichton:fix-musl, r=brson
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:30 +0000 (14:13 +0200)]
Rollup merge of #40019 - alexcrichton:fix-musl, r=brson

travis: Compile a more compatible libc.a for musl

The mitigations for #34978 involve passing `-Wa,-mrelax-relocations=no` to all C
code we compile, and we just forgot to pass it when compiling musl itself.

Closes #39979

7 years agoRollup merge of #39995 - Aatch:vtable-ptr-metadata, r=arielb1
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:28 +0000 (14:13 +0200)]
Rollup merge of #39995 - Aatch:vtable-ptr-metadata, r=arielb1

Set metadata for vtable-related loads

Give LLVM much more information about vtable pointers. Without the extra
information, LLVM has to be rather pessimistic about vtables, preventing
a number of obvious optimisations.

* Makes the vtable pointer argument noalias and readonly.
* Marks loads of the vtable pointer as nonnull.
* Marks load from the vtable with `!invariant.load` metadata.

Fixes #39992

7 years agoRollup merge of #39993 - japaric:incr-san, r=alexcrichton
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:27 +0000 (14:13 +0200)]
Rollup merge of #39993 - japaric:incr-san, r=alexcrichton

incr-comp: track the -Z sanitizer flag

closes #39611

r? @michaelwoerister

7 years agoRollup merge of #39988 - arthurprs:hm-adapt2, r=alexcrichton
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:26 +0000 (14:13 +0200)]
Rollup merge of #39988 - arthurprs:hm-adapt2, r=alexcrichton

Simplify/fix adaptive hashmap

Please see https://github.com/rust-lang/rust/pull/38368#issuecomment-280957863 for context.

The shift length math is broken. It turns out that checking for the shift length is complicated. Using simulations it's possible to see that a value of 2000 will only get probabilities down to ~1e-7 when the hashmap load factor is 90% (rust goes up to 90.9% as of today). That's probably not good enough to go into the stdlib with pluggable hashers.

So this PR simplify the adaptive behavior to only consider displacement, which is much safer and very useful by itself.

There's two comments because one of them is already being tested to be merged by bors.

7 years agoRollup merge of #39980 - arielb1:privately-uninhabited, r=nikomatsakis
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:25 +0000 (14:13 +0200)]
Rollup merge of #39980 - arielb1:privately-uninhabited, r=nikomatsakis

check_match: don't treat privately uninhabited types as uninhabited

Fixes #38972, which is a regression in 1.16 from @canndrew's patchset.

r? @nikomatsakis

beta-nominating because regression.

7 years agoRollup merge of #39961 - redox-os:redox, r=alexcrichton
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:24 +0000 (14:13 +0200)]
Rollup merge of #39961 - redox-os:redox, r=alexcrichton

Fix compilation on Redox

This updates the Redox sys module to fix compilation.

The functions peek and peek_from are added to TcpStream and UdpSocket as stubs. The sys::backtrace module is now included correctly

7 years agoRollup merge of #39953 - keeperofdakeys:macro-error, r=jseyfried
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:23 +0000 (14:13 +0200)]
Rollup merge of #39953 - keeperofdakeys:macro-error, r=jseyfried

Provide suggestions for unknown macros imported with `use`

cc https://github.com/rust-lang/rust/issues/30197

r? @jseyfried

7 years agoRollup merge of #39950 - ishitatsuyuki:stop-trashing-ldpath, r=alexcrichton
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:22 +0000 (14:13 +0200)]
Rollup merge of #39950 - ishitatsuyuki:stop-trashing-ldpath, r=alexcrichton

bootstrap: stop trashing (DY)LD_LIBRARY_PATH

This generated an ugly error with fakeroot before.

7 years agoRollup merge of #39945 - petrochenkov:llvmtarg, r=alexcrichton
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:21 +0000 (14:13 +0200)]
Rollup merge of #39945 - petrochenkov:llvmtarg, r=alexcrichton

Use ARM instead of SystemZ for testing uninstalled targets

This needs some explanation.
`config.toml` has section `targets` listing backends that are built during LLVM build:
```
targets = "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc;NVPTX"
```
It would be reasonable to expect that `targets = "X86"` would be enough for doing a local build in typical case (building on x86 and not working on some non-x86 platform-specific functionality).
However, for `x.py test` to pass successfully you have to add ARM and SystemZ to the target list as well (`targets = "X86;ARM;SystemZ"`), because two tests (`compile-fail/issue-37131.rs` and `run-make\target-without-atomics`) require these architectures to be enabled in LLVM.
This patch moves `compile-fail/issue-37131.rs` from SystemZ to ARM, so `targets = "X86;ARM"` becomes sufficient for running the full test suite without errors.

7 years agoRollup merge of #39914 - raphlinus:mx_handle_wait, r=alexcrichton
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:20 +0000 (14:13 +0200)]
Rollup merge of #39914 - raphlinus:mx_handle_wait, r=alexcrichton

Follow rename of mx_handle_wait Magenta syscalls

The mx_handle_wait_* syscalls in Magenta were renamed to
mx_object_wait. The syscall is used in the Magenta/Fuchsia
implementation of std::process, to wait on child processes.

In addition, this patch enables the use of the system provided
libbacktrace library on Fuchsia targets. Symbolization is not yet
working, but at least it allows printing hex addresses in a backtrace
and makes building succeed when the backtrace feature is not disabled.

7 years agoRollup merge of #39905 - estebank:useless-error, r=arielb1
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:19 +0000 (14:13 +0200)]
Rollup merge of #39905 - estebank:useless-error, r=arielb1

Properly display note/expected details

Given a file

```rust
fn takes_cb(f: fn(i8)) {}

fn main() {
    fn callback(x: i32) {}
    takes_cb(callback)
}
```

output

```rust
error[E0308]: mismatched types
 --> file2.rs:5:22
  |
5 |             takes_cb(callback)
  |                      ^^^^^^^^ expected i8, found i32
  |
  = note: expected type `fn(i8)`
             found type `fn(i32) {main::callback}`
```

Fix #39343.

7 years agoRollup merge of #39903 - binarycrusader:issue-39901, r=alexcrichton
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:18 +0000 (14:13 +0200)]
Rollup merge of #39903 - binarycrusader:issue-39901, r=alexcrichton

add solaris sparcv9 support

Fixes #39901

7 years agoRollup merge of #39888 - nagisa:on-fail-bootstrap, r=alexcrichton
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:17 +0000 (14:13 +0200)]
Rollup merge of #39888 - nagisa:on-fail-bootstrap, r=alexcrichton

[rustbuild] add a way to run command after failure

This is a simple way to workaround the debugging issues caused by the rustc
wrapper used in the bootstrap process. Namely, it uses some obscure environment
variables and you can't just copy the failed command and run it in the shell or
debugger to examine the failure more closely.

With `--on-fail` its possible to run an arbitrary command within exactly the
same environment under which rustc failed. Theres's multiple ways to use this
new flag:

$ python x.py build --stage=1 --on-fail=env

    would print a list of environment variables and the failed command, so a
    few copy-pastes and you now can run the same rust in your shell outside the
    bootstrap system.

$ python x.py build --stage=1 --on-fail=bash

    Is a more useful variation of the command above in that it launches a whole
    shell with environment already in place! All that's left to do is copy-paste
    the command just above the shell prompt!

Fixes #38686
Fixes #38221

7 years agoRollup merge of #39864 - cramertj:normalize-breaks, r=nikomatsakis
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:16 +0000 (14:13 +0200)]
Rollup merge of #39864 - cramertj:normalize-breaks, r=nikomatsakis

Normalize labeled and unlabeled breaks

Part of #39849.

7 years agoRollup merge of #39859 - GuillaumeGomez:rustdoc-test-relative-path, r=alexcrichton
Eduard-Mihai Burtescu [Sat, 25 Feb 2017 12:13:15 +0000 (14:13 +0200)]
Rollup merge of #39859 - GuillaumeGomez:rustdoc-test-relative-path, r=alexcrichton

Set rustdoc --test files' path relative to the current directory

r? @alexcrichton

7 years agoMove COMPILER_TESTS.md out of the root directory
Daniel Xu [Sat, 25 Feb 2017 06:13:00 +0000 (00:13 -0600)]
Move COMPILER_TESTS.md out of the root directory

7 years agoAuto merge of #40060 - alexcrichton:retry-downloads, r=aturon
bors [Sat, 25 Feb 2017 05:50:08 +0000 (05:50 +0000)]
Auto merge of #40060 - alexcrichton:retry-downloads, r=aturon

rustbuild: Retry downloads by default

Don't rely on curl's --retry, it appears to not work for some errors like SSL
errors.

7 years agoAdd Gankro's table to nomicon/src/phantom-data.md
Phil Ruffwind [Fri, 24 Feb 2017 00:19:25 +0000 (19:19 -0500)]
Add Gankro's table to nomicon/src/phantom-data.md

Original: https://github.com/rust-lang/rust/issues/30069#issuecomment-159928136

Testing confirms that:

  - PhantomData<fn() -> T> does not actually enable drop checking.
  - PhantomData<fn(T) -> T> is neither variant nor contravariant.

7 years agoAuto merge of #40084 - alexcrichton:update-sccache, r=aturon
bors [Sat, 25 Feb 2017 03:10:23 +0000 (03:10 +0000)]
Auto merge of #40084 - alexcrichton:update-sccache, r=aturon

Update sccache binaries on CI

Currently CI builds can fail spuriously during the LLVM build (#39003). I
believe this is due to sccache, and I believe that in turn was due to the fact
that the sccache server used to just be a raw mio server. Historically raw mio
servers are quite complicated to get right, but this is why we built Tokio! The
sccache server has been migrated to Tokio which I suspect would fix any latent
issues.

I have no confirmation of this (never been able to reproduce the deadlock
locally), but my hunch is that updating sccache to the master branch will fix
the timeouts during the LLVM build.

The binaries previously came from Gecko's infrastructure, but I've built new
ones by hand for Win/Mac/Linux and uploaded them to our CI bucket.

7 years agoAuto merge of #40072 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Sat, 25 Feb 2017 00:40:09 +0000 (00:40 +0000)]
Auto merge of #40072 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 11 pull requests

- Successful merges: #39777, #39815, #39845, #39886, #39940, #40010, #40030, #40048, #40050, #40052, #40071
- Failed merges:

7 years agoUpdate sccache binaries on CI
Alex Crichton [Fri, 24 Feb 2017 21:16:54 +0000 (13:16 -0800)]
Update sccache binaries on CI

Currently CI builds can fail spuriously during the LLVM build (#39003). I
believe this is due to sccache, and I believe that in turn was due to the fact
that the sccache server used to just be a raw mio server. Historically raw mio
servers are quite complicated to get right, but this is why we built Tokio! The
sccache server has been migrated to Tokio which I suspect would fix any latent
issues.

I have no confirmation of this (never been able to reproduce the deadlock
locally), but my hunch is that updating sccache to the master branch will fix
the timeouts during the LLVM build.

The binaries previously came from Gecko's infrastructure, but I've built new
ones by hand for Win/Mac/Linux and uploaded them to our CI bucket.

7 years agoAuto merge of #39892 - petrochenkov:rt, r=alexcrichton
bors [Fri, 24 Feb 2017 16:06:15 +0000 (16:06 +0000)]
Auto merge of #39892 - petrochenkov:rt, r=alexcrichton

Fix test caching on Windows/GNU

Addresses https://github.com/rust-lang/rust/issues/36385#issuecomment-277131231

Previously the sysroot directory was purged on every build and mingw startup objects were rebuilt unconditionally and always triggered test reruns.
Now mingw startup objects are built in the native directory and then copied into the sysroot directory. They are also rebuilt only when necessary, so test caching works.

7 years agoFix a typo
Tang Chenglong [Fri, 24 Feb 2017 14:01:26 +0000 (22:01 +0800)]
Fix a typo