Commit Graph

74763 Commits

Author SHA1 Message Date
kennytm
1c62067448
Rollup merge of - glaubitz:s390x-linux, r=sanxiyn
test: Fix s390x-unknown-linux-gnu atomic-lock-free test not run for systemz

The s390-unknown-linux-gnu atomic-lock-free test is currently run for ```LLVM_COMPONENTS == powerpc```. I assume it was meant to be run for ```LLVM_COMPONENTS == systemz```, so let's fix this.
2018-02-25 21:30:48 +08:00
kennytm
266386a10e
Rollup merge of - glaubitz:x32-linux, r=alexcrichton
bootstrap: Add openssl configuration for x86_64-unknown-linux-gnux32

OpenSSL provides a native configuration for x86_64-unknown-linux-gnux32:

> https://github.com/openssl/openssl/blob/master/Configurations/10-main.conf#L810

Let's use it.
2018-02-25 21:30:47 +08:00
kennytm
c9b6dcaaf9
Rollup merge of - newpavlov:rdrand, r=nagisa
Rename rdrnd target feature to rdrand

Plus minor cleanup.

Related stdsimd [issue](https://github.com/rust-lang-nursery/stdsimd/issues/325).
2018-02-25 21:30:45 +08:00
kennytm
f28931f767
Rollup merge of - cuviper:libdir_relative, r=Mark-Simulacrum
rustbuild: Restore Config.libdir_relative

This re-introduces a `Config.libdir_relative` field, now derived from
`libdir` and made relative to `prefix` if necessary.

This fixes a regression from  when `--libdir` is given an absolute
path.  `Builder::sysroot_libdir` should always use a relative path so
its callers don't clobber system locations, and `librustc` also asserts
that `CFG_LIBDIR_RELATIVE` is really relative.
2018-02-25 21:30:44 +08:00
kennytm
6627cbae92
Rollup merge of - mark-i-m:markim_macro-test, r=aturon
Move macro-at-most-once-rep-ambig test to ui test

I had written this test for the feature. Now moving to ui test.
2018-02-25 15:54:46 +08:00
kennytm
b571155631
Rollup merge of - glaubitz:sparc-linux, r=estebank
Add missing pieces for sparc-linux-gnu support

I noticed that while Rust has CABI support for 32-bit SPARC, there are still some pieces missing to be able to use Rust on a 32-Bit SPARC system like Gentoo which still defaults to a 32-bit port unlike Debian's sparc64 port.

This PR is an attempt to add the missing pieces. I will send the necessary changes for libc in a separate PR.

CC @jrtc27
2018-02-25 15:54:45 +08:00
kennytm
3e2072e51d
Rollup merge of - jakllsch:netbsd-powerpc, r=alexcrichton
Add powerpc-unknown-netbsd target
2018-02-25 15:54:44 +08:00
kennytm
b443e57ce6
Rollup merge of - hedgehog1024:hedgehog1024-stabilize-entry_and_modify, r=alexcrichton
Stabilize 'entry_and_modify' feature

Stabilize `entry_and_modify` feature introduced by .

Closes 
2018-02-25 15:54:42 +08:00
kennytm
562626ac3f
Rollup merge of - Centril:feature/iterator_flatten, r=alexcrichton
Add Iterator::flatten

This adds the trait method `.flatten()` on `Iterator` which flattens one level of nesting from an iterator or (into)iterators. The method `.flat_fmap(f)` is then redefined as `.map(f).flatten()`. The implementation of `Flatten` is essentially that of what it was for `FlatMap` but removing the call to `f` at various places.

Hopefully the type alias approach should be OK as was indicated / alluded to by @bluss and @eddyb in https://github.com/rust-lang/rfcs/pull/2306#issuecomment-361391370.

cc @scottmcm
2018-02-25 15:54:41 +08:00
kennytm
725856d67f
Rollup merge of - canarysnort01:fix_pie, r=alexcrichton
pass correct pie args to gcc linker

When linking with gcc, run gcc -v to see if --enable-default-pie is
compiled in. If it is, pass -no-pie when necessary to disable pie.
Otherwise, pass -pie when necessary to enable it.

Fixes  and fixes 
2018-02-25 15:54:40 +08:00
kennytm
e253224541
Rollup merge of - vlovich:condvar_wait_until, r=dtolnay
Add Condvar APIs not susceptible to spurious wake

Provide wait_until and wait_timeout_until helper wrappers that aren't susceptible to spurious wake.
Additionally wait_timeout_until makes it possible to more easily write code that waits for a fixed amount of time in face of spurious wakes since otherwise each user would have to do math on adjusting the duration.

Implements .
2018-02-25 15:54:39 +08:00
kennytm
f5116e712f
Rollup merge of - jcowgill:mips64-abi, r=eddyb
rustc_trans: rewrite mips64 ABI code

This PR rewrites the ABI handling code for 64-bit MIPS and should fix various FFI issues including .

To accomodate the 64-bit ABI I have had to add a new `CastTarget` variant which I've called `Chunked` (though maybe this isn't the best name). This allows an ABI to cast to some arbitrary structure of `Reg` types. This is required on MIPS which might need to cast to a structure containing a mixture of `i64` and `f64` types.
2018-02-25 15:54:38 +08:00
Manish Goregaokar
0aa753ba30
1.25.0 -> 1.26.- 2018-02-25 14:24:24 +08:00
bors
026339e42b Auto merge of - Manishearth:rollup, r=Manishearth
Rollup of 15 pull requests

- Successful merges: , , , , , , , , , , , , , , 
- Failed merges:
2018-02-25 02:07:14 +00:00
Manish Goregaokar
52047f0ba0 ignore-pretty on dyn trait test 2018-02-24 18:02:33 -08:00
Manish Goregaokar
7ba4afc17a
Rollup merge of - petrochenkov:nort, r=Mark-Simulacrum
Remove directory `src/rt`
2018-02-24 15:52:20 -08:00
Manish Goregaokar
0a7210166e
Rollup merge of - dwijnand:patch-1, r=BurntSushi
Fix capitalisation in Path#file_name's docs
2018-02-24 15:52:19 -08:00
Manish Goregaokar
9523c82543
Rollup merge of - petrochenkov:orpat, r=eddyb
Implement multiple patterns with `|` in `if let` and `while let` (RFC 2175)

cc https://github.com/rust-lang/rust/issues/48215
2018-02-24 15:52:17 -08:00
Manish Goregaokar
7e6829938c
Rollup merge of - Manishearth:dyn-paren, r=petrochenkov
Allow parentheses in `dyn (Trait)`

r? @eddyb @nikomatsakis
2018-02-24 15:52:16 -08:00
Manish Goregaokar
2dba874d57
Rollup merge of - varkor:unpacked-kind, r=eddyb
Introduce UnpackedKind

This adds an `UnpackedKind` type as a typesafe counterpart to `Kind`. This should make future changes to kinds (such as const generics!) more resilient, as the type-checker will be able to catch more potential issues.

r? @eddyb
cc @yodaldevoid
2018-02-24 15:52:15 -08:00
Manish Goregaokar
90f21d4377
Rollup merge of - nikomatsakis:default-binding-mode-issue-46688, r=cramertj
reset default binding mode when we pass through a `&` pattern

Fixes .

r? @cramertj
2018-02-24 15:52:14 -08:00
Manish Goregaokar
69757c5bb9
Rollup merge of - petrochenkov:exty, r=estebank
Fix parsing of extern paths in types and poly-traits

Fixes https://github.com/rust-lang/rust/issues/48262
2018-02-24 15:52:13 -08:00
Manish Goregaokar
43d1d6e885
Rollup merge of - QuietMisdreavus:traits-on-traits-on-traits, r=Manishearth
rustdoc: don't crash when an external trait's docs needs to import another trait

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

When resolving intra-paths for an item, rustdoc needs to have information about their items on hand, for proper bookkeeping. When loading a path for an external item, it needs to load these items from their host crate, since their information isn't otherwise available. This includes resolving paths for those docs. which can cause this process to recurse. Rustdoc keeps a map of external traits in a `RefCell<HashMap<DefId, Trait>>`, and it keeps a borrow of this active when importing an external trait. In the linked crash, this led to a RefCell borrow error, panic, and ICE.

This PR manually releases the borrow while importing the trait, and also keeps a list of traits being imported at the given moment. The latter keeps rustdoc from infinitely recursing as it tries to import the same trait repeatedly.
2018-02-24 15:52:11 -08:00
Manish Goregaokar
9901befe06
Rollup merge of - steveklabnik:second-edition-is-the-best-edition, r=QuietMisdreavus
Update the book to promote second edition

This updates the book repository, but mostly to include
https://github.com/rust-lang/book/pull/1180

TL;DR: the second edition is close enough to done that we should
universally recommend it over the first edition.
2018-02-24 15:52:10 -08:00
Manish Goregaokar
7738eb4ddb
Rollup merge of - estebank:string, r=petrochenkov
Handle custom diagnostic for `&str + String`

Now all of `&str + &str`, `&str + String` and `String + String` have relevant diagnostic output.
2018-02-24 15:52:09 -08:00
Manish Goregaokar
d45c4a6d27
Rollup merge of - withoutboats:nonstandard-style, r=Manishearth
Add nonstandard_style alias for bad_style.
2018-02-24 15:52:08 -08:00
Manish Goregaokar
58af0c7b64
Rollup merge of - ishitatsuyuki:exp-unblow, r=nikomatsakis
Fix exponential projection complexity on nested types

This implements solution 1 from https://github.com/rust-lang/rust/issues/38528#issuecomment-366263076.

The code quality is currently extremely poor, but we can improve them during review.

Blocking issues:

- we probably don't want a quadratic deduplication for obligations.
- is there an alternative to deduplication?

Based on .

Needs changelog. Noticable improvement on compile time is expected.

Fix 
Close 
Close 
2018-02-24 15:52:07 -08:00
Manish Goregaokar
0957572109
Rollup merge of - bobtwinkles:two_phase_borrow_on_ops, r=nikomatsakis
Allow two-phase borrows of &mut self in ops

We need two-phase borrows of ops to be in the initial NLL release since without them lots of existing code will break. Fixes .
CC @pnkfelix  and @nikomatsakis

r? @pnkfelix
2018-02-24 15:52:06 -08:00
Manish Goregaokar
dd890d80a0
Rollup merge of - Centril:stabilize/box_leak, r=alexcrichton
Stabilize Box::leak

Stabilizes the following:
+ `Box::leak` (`box_leak`, in nightly since 2017-11-23)

cc 

 r? @rust-lang/libs
2018-02-24 15:52:04 -08:00
Manish Goregaokar
edfdfc2483
Rollup merge of - davidtwco:issue-45157, r=nikomatsakis
Fix borrow checker unsoundness with unions

Fixes . After discussion with @nikomatsakis on Gitter, this PR only adds a test since the original issue was resolved elsewhere.

r? @nikomatsakis
2018-02-24 15:52:03 -08:00
bors
28a1e4ffef Auto merge of - Manishearth:rollup, r=Manishearth
Rollup of 15 pull requests

- Successful merges: , , , , , , , , , , , , , , 
- Failed merges:
2018-02-24 20:48:24 +00:00
Manish Goregaokar
182f8820c4 Rollup merge of - nikomatsakis:nll-do-not-run-mir-typeck-twice, r=eddyb
Fixes .
r? @nrc
2018-02-24 12:48:03 -08:00
Manish Goregaokar
6ec5dc399c Rollup merge of - eddyb:y-u-no-inline, r=nikomatsakis
rustc_data_structures: add missing #[inline].

r? @nikomatsakis
2018-02-24 12:48:02 -08:00
Manish Goregaokar
fc7caed04e Rollup merge of - estebank:unsafe-without-braces, r=nikomatsakis
When encountering invalid token after `unsafe`, mention `{`

Fix .
2018-02-24 12:48:02 -08:00
Manish Goregaokar
2483d842fb Rollup merge of - michaelwoerister:monoitem-static-defid, r=eddyb
Allow for instantiating statics from upstream crates

This PR makes the infrastructure around translating statics a bit more flexible so that it can also instantiate statics from upstream crates if the need arises. This is preparatory work for a MIR-only RLIBs prototype, where the instantiation of a `static` may be deferred until a leaf crate.

r? @eddyb (feel free to assign to someone else if you're busy)
2018-02-24 12:48:01 -08:00
Manish Goregaokar
a1a1409647 Rollup merge of - ExpHP:unused-unsafe-is-no-fn, r=estebank
unused_unsafe: don't label irrelevant fns

Fixes 

Diagnostic bugfix to remove an errant note.  Stops the search for an enclosing unsafe scope at the first safe fn encountered.

```rust
pub unsafe fn outer() {
    fn inner() {
        unsafe { /* unnecessary */ }
    }

    inner()
}
```

**Before:**

```
warning: unnecessary `unsafe` block
 --> src/main.rs:3:9
  |
1 | pub unsafe fn outer() {
  | --------------------- because it's nested under this `unsafe` fn
2 |     fn inner() {
3 |         unsafe { /* unnecessary */ }
  |         ^^^^^^ unnecessary `unsafe` block
  |
  = note: #[warn(unused_unsafe)] on by default
```

**After:**

```
warning: unnecessary `unsafe` block
 --> src/main.rs:3:9
  |
3 |         unsafe { /* unnecessary */ }
  |         ^^^^^^ unnecessary `unsafe` block
  |
  = note: #[warn(unused_unsafe)] on by default
```
2018-02-24 12:48:01 -08:00
Manish Goregaokar
b3f85fdf33 Rollup merge of - nrc:save-proc-nested, r=eddyb
save-analysis: power through bracket mis-counts

Closes 

This is pretty unsatisfying since it is working around a span bug. However, I can't track down the span bug and it could be in the parser, proc macro expansion, the user macro, or Syn (or any other library that can manipulate spans). Given that user code can cause this error, I think we need to be more robust here.

r? @eddyb
2018-02-24 12:48:00 -08:00
Manish Goregaokar
387d177ceb Rollup merge of - estebank:ice, r=nikomatsakis
Avoid ICE in arg mistmatch error for tuple variants

Fix .
2018-02-24 12:48:00 -08:00
Manish Goregaokar
8fdad6f2ef Rollup merge of - fpoli:master, r=pnkfelix
mir: Gather move at SwitchInt, Assert terminators

Previously, `_1` was not marked as "definitely uninitialized" after a `switchInt(move _1)` terminator.

I think the same goes for the `assert` terminator.

Related discussion: https://internals.rust-lang.org/t/why-is-2-definitely-initialized-after-switchint-move-2/6760
2018-02-24 12:47:59 -08:00
Manish Goregaokar
111af8f5c1 Rollup merge of - michaelwoerister:colors-array, r=nikomatsakis
incr.comp.: Store DepNode colors in a dense array instead of a hashmap.

Implements half of https://github.com/rust-lang/rust/issues/47293.

r? @nikomatsakis
2018-02-24 12:47:59 -08:00
Manish Goregaokar
e96699337b Rollup merge of - michaelwoerister:recursive-cache-decoding, r=nikomatsakis
incr.comp.: Don't keep RefCells in on-disk-cache borrowed in order to allow for recursive invocations.

Fixes .

r? @nikomatsakis
2018-02-24 12:47:59 -08:00
Manish Goregaokar
b52b33a386 Rollup merge of - nikomatsakis:termination_trait_in_tests, r=eddyb
Termination trait in tests

Support the `Termination` trait in unit tests (cc https://github.com/rust-lang/rust/issues/43301)

Also, a drive-by fix for .

This is joint work with @bkchr.
2018-02-24 12:47:58 -08:00
Manish Goregaokar
a79e5e210e Rollup merge of - cramertj:impl-trait-errors, r=nikomatsakis
Error on nested impl Trait and path projections from impl Trait

cc 

r? @nikomatsakis
2018-02-24 12:47:58 -08:00
Manish Goregaokar
25ec810921
Rollup merge of - Zoxc:rm-recursion-checking, r=eddyb
Remove "static item recursion checking" in favor of relying on cycle checks in the query engine

Tests are changed to use the cycle check error message instead. Some duplicate tests are removed.

r? @eddyb
2018-02-24 08:55:36 -08:00
Vadim Petrochenkov
aafebbcba9 Remove directory src/rt 2018-02-24 16:45:39 +03:00
Dale Wijnand
e3e1c8f7d2
Fix capitalisation in Path#file_name's docs 2018-02-24 12:31:03 +00:00
bors
6070d3e47e Auto merge of - Manishearth:rollup, r=Manishearth
Rollup of 12 pull requests

- Successful merges: , , , , , , , , , , , 
- Failed merges:
2018-02-24 07:55:34 +00:00
bors
b0a8620ed6 Auto merge of - Mark-Simulacrum:appveyor-split, r=Mark-Simulacrum
Split MinGW tests into two builders on AppVeyor

Run-pass and compile-fail tests appear to take the most significant chunk of time, so split them into their own builder.

Should help with https://github.com/rust-lang/rust/issues/46903.

r? @kennytm
cc @alexcrichton
2018-02-24 00:54:15 +00:00
John Paul Adrian Glaubitz
e3781c6585 test: Fix s390x-unknown-linux-gnu atomic-lock-free test not run for systemz 2018-02-24 01:18:33 +01:00
Vadim Petrochenkov
8640a51ff8 Implement multiple patterns with | in if let and while let 2018-02-24 03:12:35 +03:00