Commit Graph

55862 Commits

Author SHA1 Message Date
Eduard Burtescu
34f856e905 Update LLVM to include 4 backported commits by @majnemer. 2016-08-17 05:37:48 +03:00
bors
514d4cef24 Auto merge of #35354 - tomgarcia:covariant-drain, r=alexcrichton
Made vec_deque::Drain, hash_map::Drain, and hash_set::Drain covariant

Fixed the rest of the Drain iterators.
2016-08-16 13:26:15 -07:00
bors
db7300d414 Auto merge of #35637 - japaric:no-builtins-lto, r=alexcrichton
exclude `#![no_builtins]` crates from LTO

this prevents intrinsics like `memcpy` from being mis-optimized to
infinite recursive calls when LTO is used.

fixes #31544
closes #35540

---

r? @alexcrichton
cc @Amanieu
2016-08-16 10:13:18 -07:00
bors
1de5b7e8c2 Auto merge of #35617 - jseyfried:fix_unused_cfg_attr_path, r=eddyb
Fix incorrect unused import warnings on `cfg_attr`ed `path` attributes

Fixes #35584.
r? @eddyb
2016-08-16 06:32:20 -07:00
bors
e25542cb02 Auto merge of #35162 - canndrew:bang_type_coerced, r=nikomatsakis
Implement the `!` type

This implements the never type (`!`) and hides it behind the feature gate `#[feature(never_type)]`. With the feature gate off, things should build as normal (although some error messages may be different). With the gate on, `!` is usable as a type and diverging type variables (ie. types that are unconstrained by anything in the code) will default to `!` instead of `()`.
2016-08-16 00:12:12 -07:00
Jorge Aparicio
e996405696 test that a no_builtins crate is passed to the linker 2016-08-15 18:24:14 -05:00
bors
197be89f36 Auto merge of #35680 - GuillaumeGomez:err_codes, r=jonathandturner
Err codes

r? @jonathandturner
2016-08-15 11:35:01 -07:00
bors
f65d96fe3f 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.
2016-08-15 08:35:18 -07:00
Guillaume Gomez
92779194ed Add new error code tests 2016-08-15 16:47:45 +02:00
Guillaume Gomez
844c6e3d5c Add E0394 error explanation 2016-08-15 16:47:17 +02:00
bors
b72fa8ca95 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
2016-08-15 05:12:35 -07:00
Andrew Cann
f59f1f0914 Fix bug for ! in old trans 2016-08-15 13:32:12 +08:00
bors
f0bab98695 Auto merge of #35638 - ahmedcharles:url, r=alexcrichton
Upgrade linkchecker to url 1.2.0.
2016-08-14 21:38:21 -07:00
Jorge Aparicio
35eba85c3d refactor: use CStore::is_no_builtins 2016-08-14 21:56:26 -05:00
bors
47e6da2a01 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
2016-08-14 18:36:33 -07:00
bors
13ff307f07 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
2016-08-14 15:27:15 -07:00
bors
1d5b758bab 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.
2016-08-14 12:28:48 -07:00
Eduard-Mihai Burtescu
bcee2edc54 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
2016-08-14 20:29:53 +03:00
Eduard-Mihai Burtescu
43cd345a9e 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.
2016-08-14 20:29:53 +03:00
Eduard-Mihai Burtescu
c63adb1712 Rollup merge of #35647 - ahmedcharles:spelling, r=alexcrichton
Ensure that attributes are spelled properly.
2016-08-14 20:29:53 +03:00
Eduard-Mihai Burtescu
f73f1282f5 Rollup merge of #35646 - theypsilon:master, r=jonathandturner
E0094 error message updated

Part of #35233
Fixes #35231

r? @jonathandturner
2016-08-14 20:29:52 +03:00
Eduard-Mihai Burtescu
50aa568709 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
2016-08-14 20:29:52 +03:00
Eduard-Mihai Burtescu
f91d242ad6 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
2016-08-14 20:29:52 +03:00
Eduard-Mihai Burtescu
42b3df23e2 Rollup merge of #35640 - ahmedcharles:dead, r=alexcrichton
compiletest: Remove dead code.
2016-08-14 20:29:52 +03:00
Eduard-Mihai Burtescu
2294fc4e4b 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.
2016-08-14 20:29:52 +03:00
Eduard-Mihai Burtescu
5766b42572 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>
2016-08-14 20:29:51 +03:00
Eduard-Mihai Burtescu
15f66ad326 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
2016-08-14 20:29:51 +03:00
Eduard-Mihai Burtescu
c5a9228068 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
2016-08-14 20:29:51 +03:00
Eduard-Mihai Burtescu
80510b800a 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
```
2016-08-14 20:29:51 +03:00
Eduard-Mihai Burtescu
7aaa83a7d8 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.
2016-08-14 20:29:51 +03:00
Eduard-Mihai Burtescu
b975a120e1 Rollup merge of #35598 - tshepang:needless-binding, r=steveklabnik
string: remove needless binding
2016-08-14 20:29:50 +03:00
Eduard-Mihai Burtescu
322aa6e021 Rollup merge of #35597 - tshepang:it-is-a-slice, r=steveklabnik
doc: a value of type `&str` is called a "string slice"
2016-08-14 20:29:50 +03:00
Eduard-Mihai Burtescu
812a8c1e33 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
2016-08-14 20:29:50 +03:00
Eduard-Mihai Burtescu
e3a94b4909 Rollup merge of #35594 - shepmaster:configure-llvm-39, r=alexcrichton
Allow compiling against a custom LLVM 3.9 installation
2016-08-14 20:29:50 +03:00
Eduard-Mihai Burtescu
955458e346 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`.
2016-08-14 20:29:50 +03:00
Eduard-Mihai Burtescu
b65ff08d46 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
2016-08-14 20:29:49 +03:00
Eduard-Mihai Burtescu
da2328b0b1 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
2016-08-14 20:29:49 +03:00
Eduard-Mihai Burtescu
8ade28e9a2 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.
2016-08-14 20:29:49 +03:00
Eduard-Mihai Burtescu
c3cede2257 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)
2016-08-14 20:29:49 +03:00
Eduard-Mihai Burtescu
9c347b93a4 Rollup merge of #35558 - lukehinds:master, r=nikomatsakis
Update error message for E0253 #35512

Fixes #35512. Part of #35233.
2016-08-14 20:29:49 +03:00
Eduard-Mihai Burtescu
9fb4fa8e99 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.
2016-08-14 20:29:49 +03:00
Eduard-Mihai Burtescu
b1ec5b2ad2 Rollup merge of #35533 - frewsxcv:22984, r=brson
Add regression test for #22894.

None
2016-08-14 20:29:48 +03:00
Eduard-Mihai Burtescu
c35d8dba7f Rollup merge of #35491 - sanxiyn:pub-restricted-span, r=nikomatsakis
Correct span for pub_restricted field

Fix #35435.
2016-08-14 20:29:48 +03:00
Eduard-Mihai Burtescu
6d8af8cf5d 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.
2016-08-14 20:29:48 +03:00
Eduard-Mihai Burtescu
41e0f2d5e3 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
2016-08-14 20:29:48 +03:00
Eduard-Mihai Burtescu
fa57f358a3 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`.
2016-08-14 20:29:47 +03:00
Eduard-Mihai Burtescu
9d1900b417 Rollup merge of #34941 - qolop:patch-2, r=apasel422
Fix typo (privledge->privilege)
2016-08-14 20:29:47 +03:00
bors
92ae4ceb6c 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.
2016-08-14 09:34:18 -07:00
bors
2e29b126b6 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.
2016-08-14 06:42:16 -07:00
bors
d927fa4856 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
2016-08-14 03:50:50 -07:00