]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoAuto merge of #35340 - michaelwoerister:incr-comp-cli-args, r=nikomatsakis
bors [Mon, 15 Aug 2016 15:35:18 +0000 (08:35 -0700)]
Auto merge of #35340 - michaelwoerister:incr-comp-cli-args, r=nikomatsakis

Take commandline arguments into account for incr. comp.

Implements the conservative strategy described in https://github.com/rust-lang/rust/issues/33727.

From now one, every time a new commandline option is added, one has to specify if it influences the incremental compilation cache. I've tried to implement this as automatic as possible: One just has to added either the `[TRACKED]` or the `[UNTRACKED]` marker next to the field. The `Options`, `CodegenOptions`, and `DebuggingOptions` definitions in `session::config` show plenty of examples.

The PR removes some cruft from `session::config::Options`, mostly unnecessary copies of flags also present in `DebuggingOptions` or `CodeGenOptions` in the same struct.

One notable removal is the `cfg` field that contained the values passed via `--cfg` commandline arguments. I chose to remove it because (1) its content is only a subset of what later is stored in `hir::Crate::config` and it's pretty likely that reading the cfgs from `Options` would not be what you wanted, and (2) we could not incorporate it into the dep-tracking hash of the `Options` struct because of how the test framework works, leaving us with a piece of untracked but vital data.

It is now recommended (just as before) to access the crate config via the `krate()` method in the HIR map.

Because the `cfg` field is not present in the `Options` struct any more, some methods in the `CompilerCalls` trait now take the crate config as an explicit parameter -- which might constitute a breaking change for plugin authors.

7 years agoAuto merge of #35567 - creativcoder:e0261, r=jonathandturner
bors [Mon, 15 Aug 2016 12:12:35 +0000 (05:12 -0700)]
Auto merge of #35567 - creativcoder:e0261, r=jonathandturner

Update E0261 and E0262 to new error format

Fixes #35516 and  #35517 . Part of #35233
r? @jonathandturner

7 years agoAuto merge of #35638 - ahmedcharles:url, r=alexcrichton
bors [Mon, 15 Aug 2016 04:38:21 +0000 (21:38 -0700)]
Auto merge of #35638 - ahmedcharles:url, r=alexcrichton

Upgrade linkchecker to url 1.2.0.

7 years agoAuto merge of #35427 - cardoe:arm-musl-targets, r=alexcrichton
bors [Mon, 15 Aug 2016 01:36:33 +0000 (18:36 -0700)]
Auto merge of #35427 - cardoe:arm-musl-targets, r=alexcrichton

add GNU make files for arm-unknown-linux-musleabi

For Yocto (Embedded Linux meta distro) Rust is provided via the [meta-rust layer](https://github.com/meta-rust/meta-rust). In this project there have been patches to add `arm-unknown-linux-musleabi`. Rust recently acquired that support via #35060 but only for rustbuild. meta-rust is currently only able to build Rust support with the existing GNU Makefiles. This adds `arm-unknown-linux-musleabi` support to Rust for the GNU Makefiles until meta-rust is able to sort out why using rustbuild does not work for it.

/cc @srwalter @derekstraka @jmesmon @japaric

7 years agoAuto merge of #35666 - eddyb:rollup, r=eddyb
bors [Sun, 14 Aug 2016 22:27:15 +0000 (15:27 -0700)]
Auto merge of #35666 - eddyb:rollup, r=eddyb

Rollup of 30 pull requests

- Successful merges: #34941, #35392, #35444, #35447, #35491, #35533, #35539, #35558, #35573, #35574, #35577, #35586, #35588, #35594, #35596, #35597, #35598, #35606, #35611, #35615, #35616, #35620, #35622, #35640, #35643, #35644, #35646, #35647, #35648, #35661
- Failed merges: #35395, #35415

7 years agoAuto merge of #35409 - eddyb:mir-storage-stmts, r=nikomatsakis
bors [Sun, 14 Aug 2016 19:28:48 +0000 (12:28 -0700)]
Auto merge of #35409 - eddyb:mir-storage-stmts, r=nikomatsakis

[MIR] Add Storage{Live,Dead} statements to emit llvm.lifetime.{start,end}.

Storage live ranges are tracked for all MIR variables and temporaries with a drop scope.
`StorageLive` is lowered to `llvm.lifetime.start` and `StorageDead` to `llvm.lifetime.end`.

There are some improvements possible here, such as:
* pack multiple storage liveness statements by using the index of first local + `u64` bitset
* enforce that locals are not directly accessed outside their storage live range
* shrink storage live ranges for never-borrowed locals to initialization -> last use
* emit storage liveness statements for *all* temporaries
 * however, the remaining ones are *always* SSA immediates, so they'd be noop in MIR trans
 * could have a flag on the temporary that its storage is irrelevant (a la C's old `register`)
   * would also deny borrows if necessary
    * this seems like an overcompliation and with packing & optimizations it may be pointless

Even in the current state, it helps stage2 `rustc` compile `boiler` without overflowing (see #35408).

A later addition fixes #26764 and closes #27372 by emitting `.section` directives for dylib metadata to avoid them being allocated into memory or read as `.note`. For this PR, those bugs were tripping valgrind.

7 years agoRollup merge of #35661 - IvanUkhov:raw-vec, r=alexcrichton
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:53 +0000 (20:29 +0300)]
Rollup merge of #35661 - IvanUkhov:raw-vec, r=alexcrichton

Fix a couple of typos in RawVec

Hi,

The pull request is to fix a couple of typos in `liballoc/raw_vec.rs`.

Regards,
Ivan

7 years agoRollup merge of #35648 - ahmedcharles:pred, r=alexcrichton
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:53 +0000 (20:29 +0300)]
Rollup merge of #35648 - ahmedcharles:pred, r=alexcrichton

Predicates haven't existed in almost 5 years.

This test probably adds negative value other than historical amusement.

7 years agoRollup merge of #35647 - ahmedcharles:spelling, r=alexcrichton
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:53 +0000 (20:29 +0300)]
Rollup merge of #35647 - ahmedcharles:spelling, r=alexcrichton

Ensure that attributes are spelled properly.

7 years agoRollup merge of #35646 - theypsilon:master, r=jonathandturner
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:52 +0000 (20:29 +0300)]
Rollup merge of #35646 - theypsilon:master, r=jonathandturner

E0094 error message updated

Part of #35233
Fixes #35231

r? @jonathandturner

7 years agoRollup merge of #35644 - garekkream:update-E0302-new-error-format, r=jonathandturner
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:52 +0000 (20:29 +0300)]
Rollup merge of #35644 - garekkream:update-E0302-new-error-format, r=jonathandturner

Update E0302 to the new format

Part of #35233.
Fixes #35523.

r? @jonathandturner

7 years agoRollup merge of #35643 - garekkream:update-E0301-new-error-format, r=jonathandturner
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:52 +0000 (20:29 +0300)]
Rollup merge of #35643 - garekkream:update-E0301-new-error-format, r=jonathandturner

Update E0301 to the new format

Part of #35233.
Fixes #35522.

r? @jonathandturner

7 years agoRollup merge of #35640 - ahmedcharles:dead, r=alexcrichton
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:52 +0000 (20:29 +0300)]
Rollup merge of #35640 - ahmedcharles:dead, r=alexcrichton

compiletest: Remove dead code.

7 years agoRollup merge of #35622 - matthew-piziak:convert-docs-typos, r=apasel422
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:52 +0000 (20:29 +0300)]
Rollup merge of #35622 - matthew-piziak:convert-docs-typos, r=apasel422

fix small typos in std::convert documentation

Fix subject-verb agreement in copypasta: "`AsRef` dereference" to
"`AsRef` dereferences".

Formalize "eg" to "e.g." Italicization of common Latin abbreviations
seems to be going out of style in written English, so I left it plain.

7 years agoRollup merge of #35620 - cvubrugier:master, r=Manishearth
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:51 +0000 (20:29 +0300)]
Rollup merge of #35620 - cvubrugier:master, r=Manishearth

book: fix the hidden find() functions in error-handling.md

The hidden find() functions always returns None. Consequently, one of the
examples using find() prints "No file extension found" instead of
"File extension: rs" which is the expected output.

This patch fixes the issue by implementing find() with std::str::find().

Signed-off-by: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
7 years agoRollup merge of #35616 - clementmiao:E0067_new_error_format, r=jonathandturner
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:51 +0000 (20:29 +0300)]
Rollup merge of #35616 - clementmiao:E0067_new_error_format, r=jonathandturner

changed E0067 to new error format

Updated E0067 to new error format.
Part of #35233
Fixes #35502

Passes all the tests when running:
`python src/bootstrap/bootstrap.py --step check-cfail --stage 1`

**This seems strange, given that the format for E0067 has been changed.**
It feels like it should fail some unit tests maybe?

Let me know if I'm mistaken. Otherwise I can create a unit test for it.

Thanks for letting me help!

r? @jonathandturner

7 years agoRollup merge of #35615 - clementmiao:E0070_new_error_format, r=jonathandturner
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:51 +0000 (20:29 +0300)]
Rollup merge of #35615 - clementmiao:E0070_new_error_format, r=jonathandturner

Update E0070 to new error format

Updated E0070 to new error format.
Part of #35233
Fixes #35503

Thanks for letting me help!

r? @jonathandturner

7 years agoRollup merge of #35611 - jonathandturner:ptr-helper, r=nikomatsakis
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:51 +0000 (20:29 +0300)]
Rollup merge of #35611 - jonathandturner:ptr-helper, r=nikomatsakis

Improve &-ptr printing

This PR replaces printing `&-ptr` with a more readable description.  To do so it uses a few heuristics.

If the name of the type is unknown, too long (longer than just saying "reference"), or too complex (a type with explicit lifetime annotations), it will instead opt to print either "reference" or "mutable reference", depending on the mutability of the type.

Before:

```
error[E0308]: mismatched types
  --> src/test/compile-fail/issue-7061.rs:14:46
   |
14 |     fn foo(&'a mut self) -> Box<BarStruct> { self }
   |                                              ^^^^ expected box, found &-ptr
   |
   = note: expected type `Box<BarStruct>`
   = note:    found type `&'a mut BarStruct`

error: aborting due to previous error
```

After:

```
error[E0308]: mismatched types
  --> src/test/compile-fail/issue-7061.rs:14:46
   |
14 |     fn foo(&'a mut self) -> Box<BarStruct> { self }
   |                                              ^^^^ expected box, found mutable reference
   |
   = note: expected type `Box<BarStruct>`
   = note:    found type `&'a mut BarStruct`

error: aborting due to previous error
```

7 years agoRollup merge of #35606 - Mark-Simulacrum:no-std-fix, r=brson
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:51 +0000 (20:29 +0300)]
Rollup merge of #35606 - Mark-Simulacrum:no-std-fix, r=brson

Change stabilization version of no_std from 1.0 to 1.6.

I don't know if more than this is needed.

Fixes #35579.

7 years agoRollup merge of #35598 - tshepang:needless-binding, r=steveklabnik
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:50 +0000 (20:29 +0300)]
Rollup merge of #35598 - tshepang:needless-binding, r=steveklabnik

string: remove needless binding

7 years agoRollup merge of #35597 - tshepang:it-is-a-slice, r=steveklabnik
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:50 +0000 (20:29 +0300)]
Rollup merge of #35597 - tshepang:it-is-a-slice, r=steveklabnik

doc: a value of type `&str` is called a "string slice"

7 years agoRollup merge of #35596 - crypto-universe:E0254_style_and_tests, r=jonathandturner
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:50 +0000 (20:29 +0300)]
Rollup merge of #35596 - crypto-universe:E0254_style_and_tests, r=jonathandturner

Add label to E0254

This issue #35513 is a part of #35233.
r? @jonathandturner

7 years agoRollup merge of #35594 - shepmaster:configure-llvm-39, r=alexcrichton
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:50 +0000 (20:29 +0300)]
Rollup merge of #35594 - shepmaster:configure-llvm-39, r=alexcrichton

Allow compiling against a custom LLVM 3.9 installation

7 years agoRollup merge of #35588 - Antti:fix-atomics-docs, r=alexcrichton
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:50 +0000 (20:29 +0300)]
Rollup merge of #35588 - Antti:fix-atomics-docs, r=alexcrichton

Use an existing constant name as an example.

By reading atomics documentation I tried to use `INIT_ATOMIC_BOOL`, which I couldn't find. Turns out it was renamed to `ATOMIC_BOOL_INIT`.

7 years agoRollup merge of #35586 - shyaamsundhar:SqushCom, r=jonathandturner
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:49 +0000 (20:29 +0300)]
Rollup merge of #35586 - shyaamsundhar:SqushCom, r=jonathandturner

E0248, E0267 & E0268 Change into issue format

r? @jonathandturner  Part of #35391, #35519 and #35520. I have squashed all changes into a single commit. Please review the changes.

E0248 Change in issue format

E0267 UT New Format

E0268 UT New Format

E0267 & E0268 New Error Format

7 years agoRollup merge of #35577 - japaric:relax, r=alexcrichton
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:49 +0000 (20:29 +0300)]
Rollup merge of #35577 - japaric:relax, r=alexcrichton

add -mrelax-relocations=no to i686-musl and i586-gnu

I've been experiencing #34978 with these two targets. This applies the
hack in #35178 to these targets as well.

r? @alexcrichton

7 years agoRollup merge of #35574 - badboy:emscripten-test-fixes, r=brson
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:49 +0000 (20:29 +0300)]
Rollup merge of #35574 - badboy:emscripten-test-fixes, r=brson

Emscripten test fixes

This picks up parts of #31623 to disable certain tests that emscripten can't run, as threads/processes are not supported.
I re-applied @tomaka's changes manually, I can rebase those commits with his credentials if he wants.

It also disables jemalloc for emscripten (at least in Rustbuild, I have to check if there is another setting for the same thing in the old makefile approach).

This should not impact anything for normal builds.

7 years agoRollup merge of #35573 - wdv4758h:E0138, r=jonathandturner
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:49 +0000 (20:29 +0300)]
Rollup merge of #35573 - wdv4758h:E0138, r=jonathandturner

Update E0138 to new format

Part of #35233
Fix #35510
r? @jonathandturner

![e0138](https://cloud.githubusercontent.com/assets/2716047/17562415/7200d93c-5f5d-11e6-98ff-e15c29f40e03.png)

Question: How can I only underline the function name ? I have observed the debug output and the struct of item, but I can't find the `Span` for function name. Should I modify the struct I get to save function name's position or there is another way to get it ? (I can only find `Span`s for function attributes, inputs, outputs, blocks)

7 years agoRollup merge of #35558 - lukehinds:master, r=nikomatsakis
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:49 +0000 (20:29 +0300)]
Rollup merge of #35558 - lukehinds:master, r=nikomatsakis

Update error message for E0253 #35512

Fixes #35512. Part of #35233.

7 years agoRollup merge of #35539 - cgswords:ts_concat, r=nrc
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:49 +0000 (20:29 +0300)]
Rollup merge of #35539 - cgswords:ts_concat, r=nrc

Implemented a smarter TokenStream concatenation system

The new algorithm performs 'aggressive compacting' during concatenation as follows:

- If the nodes' combined total total length is less than 32, we copy both of
   them into a new vector and build a new leaf node.
- If one node is an internal node and the other is a 'small' leaf (length<32),
   we recur down the internal node on the appropriate side.
 - Otherwise, we construct a new internal node that points to them as left and
 right.

This should produce notably better behavior than the current concatenation implementation.

7 years agoRollup merge of #35533 - frewsxcv:22984, r=brson
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:48 +0000 (20:29 +0300)]
Rollup merge of #35533 - frewsxcv:22984, r=brson

Add regression test for #22894.

None

7 years agoRollup merge of #35491 - sanxiyn:pub-restricted-span, r=nikomatsakis
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:48 +0000 (20:29 +0300)]
Rollup merge of #35491 - sanxiyn:pub-restricted-span, r=nikomatsakis

Correct span for pub_restricted field

Fix #35435.

7 years agoRollup merge of #35447 - frewsxcv:vec-into-iter-as-slice, r=alexcrichton
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:48 +0000 (20:29 +0300)]
Rollup merge of #35447 - frewsxcv:vec-into-iter-as-slice, r=alexcrichton

Introduce `as_slice`/`as_mut_slice` methods on `std::vec::IntoIter` struct.

Similar to the `as_slice` method on `core::slice::Iter` struct.

7 years agoRollup merge of #35444 - alexcrichton:optimize-catch-unwind, r=brson
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:48 +0000 (20:29 +0300)]
Rollup merge of #35444 - alexcrichton:optimize-catch-unwind, r=brson

std: Optimize panic::catch_unwind slightly

The previous implementation of this function was overly conservative with
liberal usage of `Option` and `.unwrap()` which in theory never triggers. This
commit essentially removes the `Option`s in favor of unsafe implementations,
improving the code generation of the fast path for LLVM to see through what's
happening more clearly.

cc #34727

7 years agoRollup merge of #35392 - malbarbo:cell-from, r=brson
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:47 +0000 (20:29 +0300)]
Rollup merge of #35392 - malbarbo:cell-from, r=brson

Implement From for Cell, RefCell and UnsafeCell

Considering that `From` is implemented for `Box`, `Rc` and `Arc`, it seems [reasonable](https://internals.rust-lang.org/t/implementing-from-t-for-other-std-types/3744) to implement it for `Cell`, `RefCell` and `UnsafeCell`.

7 years agoRollup merge of #34941 - qolop:patch-2, r=apasel422
Eduard-Mihai Burtescu [Sun, 14 Aug 2016 17:29:47 +0000 (20:29 +0300)]
Rollup merge of #34941 - qolop:patch-2, r=apasel422

Fix typo (privledge->privilege)

7 years agoAuto merge of #34366 - Diggsey:rust-src-pkg, r=brson
bors [Sun, 14 Aug 2016 16:34:18 +0000 (09:34 -0700)]
Auto merge of #34366 - Diggsey:rust-src-pkg, r=brson

Produce source package in rust-installer format

See rust-lang/rust-buildbot#102

There may be a better way to do this, wasn't sure how to clean-up the `rust-src-image` directory when it's used by multiple make rules.

7 years agoAuto merge of #35534 - michaelwoerister:fix-const-collection2, r=nikomatsakis
bors [Sun, 14 Aug 2016 13:42:16 +0000 (06:42 -0700)]
Auto merge of #35534 - michaelwoerister:fix-const-collection2, r=nikomatsakis

Make the translation item collector handle *uses* of 'const' items instead of declarations.

This should fix issue #34754.

7 years agoAuto merge of #34206 - petrochenkov:pipdeny, r=nikomatsakis
bors [Sun, 14 Aug 2016 10:50:50 +0000 (03:50 -0700)]
Auto merge of #34206 - petrochenkov:pipdeny, r=nikomatsakis

Make `private_in_public` compatibility lint deny-by-default

In accordance with the [plan](https://internals.rust-lang.org/t/fcp-for-various-future-compatibility-warnings/3590/5?u=petrochenkov).

r? @nikomatsakis

7 years agoupdated compile-fail tests
Rahul Sharma [Sun, 14 Aug 2016 10:48:58 +0000 (16:18 +0530)]
updated compile-fail tests

7 years agoGet rid of the .note interpretation of rustc dylib metadata.
Eduard Burtescu [Sun, 14 Aug 2016 08:16:28 +0000 (11:16 +0300)]
Get rid of the .note interpretation of rustc dylib metadata.

7 years agoAuto merge of #35453 - jseyfried:hygienize_metavariables, r=nrc
bors [Sun, 14 Aug 2016 06:37:11 +0000 (23:37 -0700)]
Auto merge of #35453 - jseyfried:hygienize_metavariables, r=nrc

macros: Make metavariables hygienic

This PR makes metavariables hygienic. For example, consider:
```rust
macro_rules! foo {
    ($x:tt) => { // Suppose that this token tree argument is always a metavariable.
        macro_rules! bar { ($x:expr, $y:expr) => { ($x, $y) } }
    }
}

fn main() {
    foo!($z); // This currently compiles.
    foo!($y); // This is an error today but compiles after this PR.
}
```
Today, the `macro_rules! bar { ... }` definition is only valid when the metavariable passed to `foo` is not `$y` (since it unhygienically conflicts with the `$y` in the definition of `bar`) or `$x` (c.f. #35450).

After this PR, the definition of `bar` is always valid (and `bar!(a, b)` always expands to `(a, b)` as expected).

This can break code that was allowed in #34925 (landed two weeks ago). For example,
```rust
macro_rules! outer {
    ($t:tt) => {
        macro_rules! inner { ($i:item) => { $t } }
    }
}

outer!($i); // This `$i` should not interact with the `$i` in the definition of `inner!`.
inner!(fn main() {}); // After this PR, this is an error ("unknown macro variable `i`").
```

Due to the severe limitations on nested `macro_rules!` before #34925, this is not a breaking change for stable/beta.

Fixes #35450.

r? @nrc

7 years agoFix a couple of typos in RawVec
Ivan Ukhov [Sun, 14 Aug 2016 04:59:43 +0000 (06:59 +0200)]
Fix a couple of typos in RawVec

7 years ago[MIR] Add Storage{Live,Dead} statements to emit llvm.lifetime.{start,end}.
Eduard Burtescu [Sun, 14 Aug 2016 03:34:14 +0000 (06:34 +0300)]
[MIR] Add Storage{Live,Dead} statements to emit llvm.lifetime.{start,end}.

7 years agoFix make-tidy lock file checks
Diggory Blake [Sat, 13 Aug 2016 21:36:04 +0000 (22:36 +0100)]
Fix make-tidy lock file checks

7 years agoAuto merge of #35414 - jupp0r:feature/test-threads-flag, r=alexcrichton
bors [Sat, 13 Aug 2016 16:52:49 +0000 (09:52 -0700)]
Auto merge of #35414 - jupp0r:feature/test-threads-flag, r=alexcrichton

Add --test-threads option to test binaries

This change allows parallelism of test runs to be specified by a
command line flag names --test-threads in addition to the existing
environment variable RUST_TEST_THREADS. Fixes #25636.

7 years agoPredicates haven't existed in almost 5 years.
Ahmed Charles [Sat, 13 Aug 2016 09:45:53 +0000 (02:45 -0700)]
Predicates haven't existed in almost 5 years.

This test probably adds negative value other than historical amusement.

7 years agoEnsure that attributes are spelled properly.
Ahmed Charles [Sat, 13 Aug 2016 09:41:43 +0000 (02:41 -0700)]
Ensure that attributes are spelled properly.

7 years agoE0094 error message updated
José manuel Barroso Galindo [Sat, 13 Aug 2016 09:32:43 +0000 (16:32 +0700)]
E0094 error message updated

Part of #35233
Fixes #35231

7 years agoAuto merge of #35348 - scottcarr:discriminant2, r=nikomatsakis
bors [Sat, 13 Aug 2016 08:20:46 +0000 (01:20 -0700)]
Auto merge of #35348 - scottcarr:discriminant2, r=nikomatsakis

[MIR] Add explicit SetDiscriminant StatementKind for deaggregating enums

cc #35186

To deaggregate enums, we need to be able to explicitly set the discriminant.  This PR implements a new StatementKind that does that.

I think some of the places that have `panics!` now could maybe do something smarter.

7 years agoupdated E0067 to new error format
Clement Miao [Sat, 13 Aug 2016 07:03:04 +0000 (00:03 -0700)]
updated E0067 to new error format

7 years agocompiletest: Remove dead code.
Ahmed Charles [Sat, 13 Aug 2016 06:45:39 +0000 (23:45 -0700)]
compiletest: Remove dead code.

7 years agoUpgrade linkchecker to url 1.2.0.
Ahmed Charles [Sat, 13 Aug 2016 03:45:16 +0000 (20:45 -0700)]
Upgrade linkchecker to url 1.2.0.

7 years agoAuto merge of #35138 - petrochenkov:clarify, r=eddyb
bors [Sat, 13 Aug 2016 02:38:46 +0000 (19:38 -0700)]
Auto merge of #35138 - petrochenkov:clarify, r=eddyb

Implement RFC 1506 "Clarify the relationships between various kinds of structs and variants"

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

7 years agoUpdate E0302 to the new format
Krzysztof Garczynski [Sat, 13 Aug 2016 00:33:52 +0000 (02:33 +0200)]
Update E0302 to the new format

7 years agoUpdate E0301 to the new format
Krzysztof Garczynski [Fri, 12 Aug 2016 23:33:42 +0000 (01:33 +0200)]
Update E0301 to the new format

7 years agoParse numeric fields in struct expressions and patterns
Vadim Petrochenkov [Fri, 29 Jul 2016 20:47:55 +0000 (23:47 +0300)]
Parse numeric fields in struct expressions and patterns

7 years agoRemove restrictions from tuple structs/variants
Vadim Petrochenkov [Fri, 29 Jul 2016 20:47:55 +0000 (23:47 +0300)]
Remove restrictions from tuple structs/variants

Hard errors are turned into feature gates

7 years agoupdated E0070 to new error format
Clement Miao [Fri, 12 Aug 2016 17:15:54 +0000 (10:15 -0700)]
updated E0070 to new error format

7 years agoProduce source package in rust-installer format in addition to vanilla tarball
Diggory Blake [Sat, 9 Jul 2016 12:33:03 +0000 (13:33 +0100)]
Produce source package in rust-installer format in addition to vanilla tarball

Copy source files from rust code

Add missing wildcard

Remove unused function

Remove use of tar --transform

7 years agofix small typos in std::convert documentation
Matthew Piziak [Fri, 12 Aug 2016 16:15:06 +0000 (12:15 -0400)]
fix small typos in std::convert documentation

Fix subject-verb agreement in copypasta: "`AsRef` dereference" to
"`AsRef` dereferences".

Formalize "eg" to "e.g." Italicization of common Latin abbreviations
seems to be going out of style in written English, so I left it plain.

7 years agoMake the translation item collector handle *uses* of 'const' items instead of declara...
Michael Woerister [Fri, 22 Jul 2016 16:14:26 +0000 (12:14 -0400)]
Make the translation item collector handle *uses* of 'const' items instead of declarations.

7 years agoAuto merge of #35431 - GuillaumeGomez:err_codes, r=jonathandturner
bors [Fri, 12 Aug 2016 15:58:55 +0000 (08:58 -0700)]
Auto merge of #35431 - GuillaumeGomez:err_codes, r=jonathandturner

Err codes

r? @jonathandturner

7 years agobook: fix the hidden find() functions in error-handling.md
Christophe Vu-Brugier [Fri, 12 Aug 2016 09:49:52 +0000 (11:49 +0200)]
book: fix the hidden find() functions in error-handling.md

The hidden find() functions always returns None. Consequently, one of the
examples using find() prints "No file extension found" instead of
"File extension: rs" which is the expected output.

This patch fixes the issue by implementing find() with std::str::find().

Signed-off-by: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
7 years agoCorrect span for pub_restricted field
Seo Sanghyeon [Mon, 8 Aug 2016 12:35:15 +0000 (21:35 +0900)]
Correct span for pub_restricted field

7 years agoAuto merge of #35091 - eddyb:impl-trait, r=nikomatsakis
bors [Fri, 12 Aug 2016 08:26:12 +0000 (01:26 -0700)]
Auto merge of #35091 - eddyb:impl-trait, r=nikomatsakis

Implement `impl Trait` in return type position by anonymization.

This is the first step towards implementing `impl Trait` (cc #34511).
`impl Trait` types are only allowed in function and inherent method return types, and capture all named lifetime and type parameters, being invariant over them.
No lifetimes that are not explicitly named lifetime parameters are allowed to escape from the function body.
The exposed traits are only those listed explicitly, i.e. `Foo` and `Clone` in `impl Foo + Clone`, with the exception of "auto traits" (like `Send` or `Sync`) which "leak" the actual contents.

The implementation strategy is anonymization, i.e.:
```rust
fn foo<T>(xs: Vec<T>) -> impl Iterator<Item=impl FnOnce() -> T> {
    xs.into_iter().map(|x| || x)
}

// is represented as:
type A</*invariant over*/ T> where A<T>: Iterator<Item=B<T>>;
type B</*invariant over*/ T> where B<T>: FnOnce() -> T;
fn foo<T>(xs: Vec<T>) -> A<T> {
    xs.into_iter().map(|x| || x): $0 where $0: Iterator<Item=$1>, $1: FnOnce() -> T
}
```
`$0` and `$1` are resolved (to `iter::Map<vec::Iter<T>, closure>` and the closure, respectively) and assigned to `A` and `B`, after checking the body of `foo`. `A` and `B` are *never* resolved for user-facing type equality (typeck), but always for the low-level representation and specialization (trans).

The "auto traits" exception is implemented by collecting bounds like `impl Trait: Send` that have failed for the obscure `impl Trait` type (i.e. `A` or `B` above), pretending they succeeded within the function and trying them again after type-checking the whole crate, by replacing `impl Trait` with the real type.

While passing around values which have explicit lifetime parameters (of the function with `-> impl Trait`) in their type *should* work, regionck appears to assign inference variables in *way* too many cases, and never properly resolving them to either explicit lifetime parameters, or `'static`.
We might not be able to handle lifetime parameters in `impl Trait` without changes to lifetime inference, but type parameters can have arbitrary lifetimes in them from the caller, so most type-generic usecases (or not generic at all) should not run into this problem.

cc @rust-lang/lang

7 years agoFix fallout in tests.
Jeffrey Seyfried [Fri, 12 Aug 2016 06:26:06 +0000 (06:26 +0000)]
Fix fallout in tests.

7 years agoAuto merge of #34811 - DanielJCampbell:Expander, r=jseyfried
bors [Fri, 12 Aug 2016 05:10:16 +0000 (22:10 -0700)]
Auto merge of #34811 - DanielJCampbell:Expander, r=jseyfried

Extended expand.rs to support alternate expansion behaviours (eg. stepwise expansion)

r? nrc

7 years agoImprove &-ptr printing
Jonathan Turner [Fri, 12 Aug 2016 04:47:56 +0000 (21:47 -0700)]
Improve &-ptr printing

7 years agotest: add more extensive tests for impl Trait.
Eduard Burtescu [Wed, 10 Aug 2016 21:04:43 +0000 (00:04 +0300)]
test: add more extensive tests for impl Trait.

7 years agotypeck: leak auto trait obligations through impl Trait.
Eduard Burtescu [Thu, 28 Jul 2016 15:27:11 +0000 (18:27 +0300)]
typeck: leak auto trait obligations through impl Trait.

7 years agotypeck: record `impl Trait` concrete resolutions.
Eduard Burtescu [Sat, 6 Aug 2016 00:12:20 +0000 (03:12 +0300)]
typeck: record `impl Trait` concrete resolutions.

7 years agotypeck: disallow `impl Trait` outside of return types of functions and impl methods.
Eduard Burtescu [Sat, 6 Aug 2016 00:11:17 +0000 (03:11 +0300)]
typeck: disallow `impl Trait` outside of return types of functions and impl methods.

7 years agorustc: add TyAnon (impl Trait) to the typesystem.
Eduard Burtescu [Fri, 22 Jul 2016 15:56:22 +0000 (18:56 +0300)]
rustc: add TyAnon (impl Trait) to the typesystem.

7 years agosyntax: add anonymized type syntax, i.e. impl TraitA+TraitB.
Eduard Burtescu [Mon, 1 Aug 2016 01:25:32 +0000 (04:25 +0300)]
syntax: add anonymized type syntax, i.e. impl TraitA+TraitB.

7 years agorustc: don't reveal specializable polymorphic projections.
Eduard Burtescu [Fri, 1 Jul 2016 16:32:53 +0000 (19:32 +0300)]
rustc: don't reveal specializable polymorphic projections.

7 years agorustc: always normalize projections in ty::layout regardless where they appear.
Eduard Burtescu [Fri, 1 Jul 2016 15:36:54 +0000 (18:36 +0300)]
rustc: always normalize projections in ty::layout regardless where they appear.

7 years agorustc: rename ProjectionMode and its variant to be more memorable.
Eduard Burtescu [Thu, 30 Jun 2016 18:22:47 +0000 (21:22 +0300)]
rustc: rename ProjectionMode and its variant to be more memorable.

7 years agoFix typo
Patrick McCann [Thu, 11 Aug 2016 23:04:11 +0000 (19:04 -0400)]
Fix typo

Didn't see this one at first.

7 years agoChange stabilization version of no_std from 1.0 to 1.6.
Mark-Simulacrum [Thu, 11 Aug 2016 21:46:10 +0000 (15:46 -0600)]
Change stabilization version of no_std from 1.0 to 1.6.

7 years agoIntroduce `as_mut_slice` method on `std::vec::IntoIter` struct.
Corey Farwell [Sun, 7 Aug 2016 14:08:40 +0000 (10:08 -0400)]
Introduce `as_mut_slice` method on `std::vec::IntoIter` struct.

7 years agoIntroduce `as_slice` method on `std::vec::IntoIter` struct.
Corey Farwell [Sun, 7 Aug 2016 04:30:17 +0000 (00:30 -0400)]
Introduce `as_slice` method on `std::vec::IntoIter` struct.

Similar to the `as_slice` method on `core::slice::Iter` struct.

7 years agoAdd test for #28514
Vadim Petrochenkov [Thu, 14 Jul 2016 19:54:36 +0000 (22:54 +0300)]
Add test for #28514

Fixes #28514

7 years agoMake `private_in_public` compatibility lint deny-by-default
Vadim Petrochenkov [Fri, 10 Jun 2016 20:30:05 +0000 (23:30 +0300)]
Make `private_in_public` compatibility lint deny-by-default

7 years agoAuto merge of #35592 - jonathandturner:rollup, r=jonathandturner
bors [Thu, 11 Aug 2016 20:14:28 +0000 (13:14 -0700)]
Auto merge of #35592 - jonathandturner:rollup, r=jonathandturner

Rollup of 23 pull requests

- Successful merges: #35279, #35331, #35358, #35375, #35445, #35448, #35482, #35486, #35505, #35528, #35530, #35532, #35536, #35537, #35541, #35552, #35554, #35555, #35557, #35562, #35565, #35569, #35576
- Failed merges: #35395, #35415, #35563

7 years agoFix tidy tests
crypto-universe [Thu, 11 Aug 2016 19:08:36 +0000 (21:08 +0200)]
Fix tidy tests

7 years agoadd SetDiscriminant StatementKind to enable deaggregation of enums
Scott A Carr [Thu, 4 Aug 2016 23:14:33 +0000 (16:14 -0700)]
add SetDiscriminant StatementKind to enable deaggregation of enums

7 years agostring: remove needless binding
Tshepang Lekhonkhobe [Thu, 11 Aug 2016 18:44:49 +0000 (20:44 +0200)]
string: remove needless binding

7 years agodoc: a value of type `&str` is called a "string slice"
Tshepang Lekhonkhobe [Thu, 11 Aug 2016 18:41:04 +0000 (20:41 +0200)]
doc: a value of type `&str` is called a "string slice"

7 years agostd: Optimize panic::catch_unwind slightly
Alex Crichton [Sat, 9 Jul 2016 02:45:37 +0000 (19:45 -0700)]
std: Optimize panic::catch_unwind slightly

The previous implementation of this function was overly conservative with
liberal usage of `Option` and `.unwrap()` which in theory never triggers. This
commit essentially removes the `Option`s in favor of unsafe implementations,
improving the code generation of the fast path for LLVM to see through what's
happening more clearly.

cc #34727

7 years agoAdd label to E0254
crypto-universe [Wed, 10 Aug 2016 23:52:44 +0000 (01:52 +0200)]
Add label to E0254

This issue #35513 is a part of #35233.
r? @jonathandturner

7 years agoFix tidy warning
Jonathan Turner [Thu, 11 Aug 2016 17:17:12 +0000 (10:17 -0700)]
Fix tidy warning

7 years agoAuto merge of #34193 - petrochenkov:privalias, r=nikomatsakis
bors [Thu, 11 Aug 2016 17:09:10 +0000 (10:09 -0700)]
Auto merge of #34193 - petrochenkov:privalias, r=nikomatsakis

privacy: Substitute type aliases in private-in-public checker

Closes https://github.com/rust-lang/rust/issues/30503
Closes https://github.com/rust-lang/rust/issues/34293

Everyone in the issue discussion seemed to be in favor, @huonw also spoke about this [here](https://www.reddit.com/r/rust/comments/3xldr9/surfaces_and_signatures_component_privacy_versus/cy615wq), but the issue haven't got any movement.
I think it's reasonable to do this before turning `private_in_public` warnings into errors.

r? @nikomatsakis

7 years agoAllow compiling against a custom LLVM 3.9 installation
Jake Goulding [Thu, 11 Aug 2016 16:55:53 +0000 (12:55 -0400)]
Allow compiling against a custom LLVM 3.9 installation

7 years agofix match
Jorge Aparicio [Thu, 11 Aug 2016 16:22:39 +0000 (11:22 -0500)]
fix match

7 years agoAlways add `-Z incremental-info` to incremental compilation tests.
Michael Woerister [Thu, 11 Aug 2016 14:59:35 +0000 (10:59 -0400)]
Always add `-Z incremental-info` to incremental compilation tests.

7 years agoFix incremental/commandline-args test.
Michael Woerister [Thu, 11 Aug 2016 14:59:05 +0000 (10:59 -0400)]
Fix incremental/commandline-args test.

7 years agoAddress comments by reviewers.
Michael Woerister [Tue, 9 Aug 2016 19:28:24 +0000 (15:28 -0400)]
Address comments by reviewers.

7 years agoRemove the 'cfg' field from session::config::Options.
Michael Woerister [Tue, 9 Aug 2016 12:44:11 +0000 (08:44 -0400)]
Remove the 'cfg' field from session::config::Options.

The 'cfg' in the Options struct is only the commandline-specified
subset of the crate configuration and it's almost always wrong to
read that instead of the CrateConfig in HIR crate node.

7 years agoSave dep-tracking hash of commandline arguments in dep-graph file.
Michael Woerister [Thu, 4 Aug 2016 22:29:58 +0000 (18:29 -0400)]
Save dep-tracking hash of commandline arguments in dep-graph file.

.. and use it to purge the incremental compilation cache if necessary.