Commit Graph

67787 Commits

Author SHA1 Message Date
Alex Crichton
c72240acf7 rustc_trans: Refactor collection to use tcx
This commit refactors the `collect_crate_translation_items` function to only
require the `TyCtxt` instead of a `SharedCrateContext` in preparation for
query-ifying this portion of trans.
2017-09-17 09:41:43 -07:00
Alex Crichton
4857bb7ffa rustbuild: Don't pass -j if called by make
In these situations Cargo just prints out a warning about ignoring the flag
anyway, so let `make` take care of jobs and whatnot instead of getting warnings
printed.
2017-09-17 09:29:11 -07:00
Ixrec
38fa340ba2 missed a 'mut' 2017-09-17 17:11:42 +01:00
Ixrec
2633b85ab2 Replace str's transmute() calls with pointer casts
After the following conversation in #rust-lang:
```
[14:43:50] <Ixrec> TIL the implementation of from_utf_unchecked is literally just "mem::transmute(x)"
[14:43:59] <Ixrec> no wonder people keep saying transmute is overpowered
[15:15:30] <eddyb> Ixrec: it should be a pointer cast lol
[15:15:46] <eddyb> unless it doesn't let you
[16:50:34] <Ixrec> https://play.rust-lang.org/?gist=d1e6b629ad9ec1baf64ce261c63845e6&version=stable seems like it does let me
[16:52:35] <eddyb> Ixrec: yeah that's the preferred impl
[16:52:46] <eddyb> Ixrec: it just wasn't in 1.0
[16:52:50] <eddyb> IIRC
[16:53:00] <eddyb> (something something fat pointers)
```
Since I already wrote half of the preferred impls in the playground, might as well make an actual PR.
2017-09-17 17:03:56 +01:00
bors
1cdd68922d Auto merge of #44654 - TimNN:rollup, r=TimNN
Rollup of 17 pull requests

- Successful merges: #44073, #44088, #44381, #44397, #44509, #44533, #44549, #44553, #44562, #44567, #44595, #44604, #44617, #44622, #44630, #44639, #44647
- Failed merges:
2017-09-17 11:19:56 +00:00
Tim Neumann
7aefb6c3ef Rollup merge of #44647 - tmerr:fix-44645, r=dtolnay
Ensure tcp test case passes when disconnected from network

net::tcp::tests::connect_timeout_unroutable fails when the network
is unreachable, like on a laptop disconnected from wifi. Check for
this error and allow the test to pass.

Closes #44645
2017-09-17 13:19:15 +02:00
Tim Neumann
d046421743 Rollup merge of #44639 - budziq:stabilize_needs_drop, r=dtolnay
stabilized needs_drop (fixes #41890)

fixes #41890
2017-09-17 13:19:14 +02:00
Tim Neumann
6b1f0c8694 Rollup merge of #44630 - RalfJung:compiletest, r=Mark-Simulacrum
compiletest: print the correct basename of the src dir

See <https://github.com/laumann/compiletest-rs/issues/76>.

Fixes #40712
2017-09-17 13:19:13 +02:00
Tim Neumann
bbb89863a9 Rollup merge of #44622 - frewsxcv:frewsxcv-invalid-link, r=QuietMisdreavus
Fix incorrect `into_inner` link in docs.

Fixes https://github.com/rust-lang/rust/issues/42373.
2017-09-17 13:19:12 +02:00
Tim Neumann
80d7e76185 Rollup merge of #44617 - alexcrichton:download-from-us-west-1, r=aidanhs
ci: Upload/download from a new S3 bucket

Moving buckets from us-east-1 to us-west-1 because us-west-1 is where
rust-central-station itself runs and in general is where we have all our other
buckets.
2017-09-17 13:19:11 +02:00
Tim Neumann
fbee41b714 Rollup merge of #44604 - alexcrichton:update-cargo, r=Mark-Simulacrum
Update cargo submodule

Just a routine update
2017-09-17 13:19:10 +02:00
Tim Neumann
064f718247 Rollup merge of #44595 - budziq:stabilize_compiler_fences, r=alexcrichton
stabilized compiler_fences (fixes #41091)

I did not know what to proceed with "unstable-book" entry. The feature would no longer be unstable so I have deleted it. If it was the wrong call I'll revert it (unfortunately his case is not described in the CONTRIBUTING.md).
2017-09-17 13:19:09 +02:00
Tim Neumann
1437e53f9f Rollup merge of #44567 - budziq:stabilize_iterator_for_each, r=alexcrichton
stabilized iterator_for_each (closes #42986)

Also updated clippy and rls as these use the iterator_for_each

I've made my first PR's today so most likely I've done something wrong. Sorry about that!
2017-09-17 13:19:08 +02:00
Tim Neumann
4dc01c475f Rollup merge of #44562 - eddyb:ugh-rustdoc, r=nikomatsakis
rustdoc: pretty-print Unevaluated expressions in types.

Fixes #44555.

r? @nikomatsakis
2017-09-17 13:19:07 +02:00
Tim Neumann
eab164842a Rollup merge of #44553 - qmx:refactor-remove-overzealous-box-szero-optimization, r=arielb1
remove overzealous Box<ZeroSizeType> optimization
2017-09-17 13:19:06 +02:00
Tim Neumann
efdcd5efef Rollup merge of #44549 - gaurikholkar:master, r=arielb1
extend E0623 for earlybound and latebound for structs

This fixes #44508

r? @nikomatsakis
2017-09-17 13:19:05 +02:00
Tim Neumann
eea2f5596a Rollup merge of #44533 - nrc:rustfmt-submod, r=alexcrichton
Add Rustfmt

r? @alexcrichton
2017-09-17 13:19:04 +02:00
Tim Neumann
39710f8fcc Rollup merge of #44509 - tamird:remove-rustbuild-feature, r=nikomatsakis
Update compiler-builtins

~~I can't tell if this was ever used, but it's not used today.~~

See commits.
2017-09-17 13:19:03 +02:00
Tim Neumann
49bc845807 Rollup merge of #44397 - GuillaumeGomez:codeblock-color, r=QuietMisdreavus
Codeblock color

<img width="1440" alt="screen shot 2017-09-07 at 21 53 58" src="https://user-images.githubusercontent.com/3050060/30183045-4319108e-9419-11e7-98da-da54952cab37.png">

This screenshot has been generated from:

```rust
/// foo
///
/// ```compile_fail
/// foo();
/// ```
///
/// ```ignore
/// goo();
/// ```
///
/// ```
/// let x = 0;
/// ```
pub fn bar() -> usize { 2 }
```

r? @QuietMisdreavus
cc @rust-lang/docs
2017-09-17 13:19:02 +02:00
Tim Neumann
2934588c15 Rollup merge of #44381 - jessicah:haiku-ci, r=alexcrichton
ci: introduce haiku x86_64 builder
2017-09-17 13:19:01 +02:00
Tim Neumann
bc638b8635 Rollup merge of #44088 - bjorn3:better_trace_macros, r=jseyfried
Fix "new trace_macros doesn't work if there's an error during expansion"

Fixes #43493
2017-09-17 13:19:00 +02:00
Tim Neumann
a0edcb4b03 Rollup merge of #44073 - murarth:rc-into-raw-unsized, r=alexcrichton
Implement `Arc`/`Rc` raw pointer conversions for `?Sized`

* Add `T: ?Sized` bound to {`Arc`,`Rc`}::{`from_raw`,`into_raw`}
2017-09-17 13:18:59 +02:00
Michal Budzynski
6b167f98d9 Updated tracking issue for String::splice and its unstable-book entry 2017-09-17 10:41:24 +02:00
Michal Budzynski
7b932d2e12 stabilized vec_splice (fixes #32310) 2017-09-17 10:32:59 +02:00
Ulrik Sverdrup
7859c9ef44 std: Document thread builder panics for nul bytes in thread names
This seems to have been undocumented. Mention this where the name is set
(Builder::name) and where the panic could happen (Builder::spawn).

Thread::new is private and I think the builder is the only user where
this matters. A short comment was added to "document" Thread::new too.
2017-09-17 10:21:15 +02:00
bors
ef227f5ffe Auto merge of #44641 - alexcrichton:disable-more-osx-assertions, r=Mark-Simulacrum
ci: Disable rustc debug assertions on OSX

This commit disables debug assertions for OSX in an effort to improve cycle time
on OSX. It looks like #44610 didn't shave off quite as much time as desired so
let's see how much this helps.
2017-09-17 05:19:00 +00:00
Trevor Merrifield
fcdd46e534 Ensure tcp test case passes when disconnected from network
net::tcp::tests::connect_timeout_unroutable fails when the network
is unreachable, like on a laptop disconnected from wifi. Check for
this error and allow the test to pass.

Closes #44645
2017-09-17 00:16:30 -04:00
bors
71e37674a1 Auto merge of #44634 - alexcrichton:rollup, r=alexcrichton
Rollup of 19 pull requests

- Successful merges: #44273, #44356, #44395, #44531, #44537, #44542, #44560, #44567, #44574, #44577, #44586, #44589, #44590, #44593, #44598, #44606, #44609, #44616, #44631
- Failed merges:
2017-09-17 01:51:55 +00:00
Alex Crichton
c1a83acf98 ci: Disable rustc debug assertions on OSX
This commit disables debug assertions for OSX in an effort to improve cycle time
on OSX. It looks like #44610 didn't shave off quite as much time as desired so
let's see how much this helps.
2017-09-16 17:25:12 -07:00
Alex Crichton
2bd4dcf891 Rollup merge of #44631 - kennytm:travis-conditional-jobs, r=alexcrichton
Make use of Travis's conditional jobs.

Conditional jobs: https://docs.travis-ci.com/user/conditional-builds-stages-jobs/#Conditional-Jobs.

Jobs not matching the condition will not be scheduled at all. This allows us to get rid of `$ALLOW_PR`/`$ALLOW_TRY`/`$SKIP_BUILD` in `.travis.yml`, and perfectly prevent spurious PR failures due to flaky macOS machines.
2017-09-16 17:09:41 -07:00
Alex Crichton
9eae111831 Rollup merge of #44616 - alexcrichton:rustdoc-fix-again-whee, r=Mark-Simulacrum
rustbuild: Fix test "test rustdoc" invocation

Previously it would use the librustc output directory which would cause rustdoc
to get entirely recompiled, whereas the intention is that it uses the
already-compiled artifacts from building rustdoc itself, using the tool output
directory
2017-09-16 17:09:41 -07:00
Alex Crichton
0df4e92662 Rollup merge of #44609 - jonhoo:hash-alloc, r=steveklabnik
Mention that HashMap::new and HashSet::new do not allocate

The docs for `HashMap::with_capacity` and `HashSet::with_capacity` already say that
> If `capacity` is 0, the hash map/set will not allocate.
However, the docs for `::new` do not say that the initial capacity is 0, and thus promise that a call to `::new` alone does not allocate. This PR fixes that.
2017-09-16 17:09:41 -07:00
Alex Crichton
a47ca2291d Rollup merge of #44606 - alexcrichton:update-cmake, r=Mark-Simulacrum
rustbuild: Update `cmake` dependency

Should help suppress some warnings from various repos as `cmake` in the newest
version disables warnings by default.
2017-09-16 17:09:41 -07:00
Alex Crichton
4531fe1f45 Rollup merge of #44598 - RalfJung:installer, r=alexcrichton
update rust-installer

Fixes <https://github.com/rust-lang/rust/issues/44594>

r? @alexcrichton
2017-09-16 17:09:41 -07:00
Alex Crichton
3cc135afa3 Rollup merge of #44593 - budziq:stabilize_ord_max_min, r=alexcrichton
stabilized ord_max_min (fixes #25663)
2017-09-16 17:09:40 -07:00
Alex Crichton
c4f29d4cc5 Rollup merge of #44590 - oli-obk:allow_unused_mut_on_vars, r=eddyb
Get `allow(unused_mut)` to work on `let` bindings

fixes #40491
2017-09-16 17:09:40 -07:00
Alex Crichton
0d88bb9c7f Rollup merge of #44589 - makotokato:thumb2, r=alexcrichton
Require +thumb-mode to generate thumb2 code for Android/armv7-a

I am investigating rust's code generation into Gecko by https://bugzilla.mozilla.org/show_bug.cgi?id=1399337.

armv7-linux-androideabi target uses `+v7,+thumb2,+vfp3,+d16,-neon` as target-feature.  But `+thumb2` only doesn't generate thumb2 code.  To generate thumb2 code, it requires `+thumb-mode`.  So we should add it for armv7-linux-androideabi.

r? @alexcrichton
2017-09-16 17:09:40 -07:00
Alex Crichton
1d088382e5 Rollup merge of #44586 - alexcrichton:smaller-query, r=michaelwoerister
rustc: Preallocate when building the dep graph

This commit alters the `query` function in the dep graph module to preallocate
memory using `with_capacity` instead of relying on automatic growth. Discovered
in #44576 it was found that for the syntex_syntax clean incremental benchmark
the peak memory usage was found when the dep graph was being saved, particularly
the `DepGraphQuery` data structure itself. PRs like #44142 which add more
queries end up just making this much larger!

I didn't see an immediately obvious way to reduce the size of the
`DepGraphQuery` object, but it turns out that `with_capacity` helps quite a bit!
Locally 831 MB was used [before] this commit, and 770 MB is in use at the peak
of the compiler [after] this commit. That's a nice 7.5% improvement! This won't
quite make up for the losses in #44142 but I figured it's a good start.

[before]: https://gist.github.com/alexcrichton/2d2b9c7a65503761925c5a0bcfeb0d1e
[before]: https://gist.github.com/alexcrichton/6da51f2a6184bfb81694cc44f06deb5b
2017-09-16 17:09:40 -07:00
Alex Crichton
3dbd9c5489 Rollup merge of #44577 - cuviper:flat_map-fold, r=alexcrichton
Customize `<FlatMap as Iterator>::fold`

`FlatMap` can use internal iteration for its `fold`, which shows a
performance advantage in the new benchmarks:

    test iter::bench_flat_map_chain_ref_sum ... bench:   4,354,111 ns/iter (+/- 108,871)
    test iter::bench_flat_map_chain_sum     ... bench:     468,167 ns/iter (+/- 2,274)
    test iter::bench_flat_map_ref_sum       ... bench:     449,616 ns/iter (+/- 6,257)
    test iter::bench_flat_map_sum           ... bench:     348,010 ns/iter (+/- 1,227)

... where the "ref" benches are using `by_ref()` that isn't optimized.
So this change shows a decent advantage on its own, but much more when
combined with a `chain` iterator that also optimizes `fold`.
2017-09-16 17:09:40 -07:00
Alex Crichton
c25290d715 Rollup merge of #44574 - alexcrichton:new-sccache-region, r=aidanhs
travis: Move sccache to the us-west-1 region

Most of the other rust-lang buckets are in us-west-1 and I think the original
bucket was just accidentally created in the us-east-1 region. Let's consolidate
by moving it to the same location as the rest of our buckets.
2017-09-16 17:09:39 -07:00
Alex Crichton
893aa23655 Rollup merge of #44560 - qmx:import-TyCtxt, r=eddyb
bring TyCtxt into scope

got comments both from @eddyb and @nikomatsakis (via https://github.com/rust-lang/rust/pull/44505) that we should always put `TyCtxt` in scope

should I just go and import it at other places in the codebase or we just keep doing small improvements?
2017-09-16 17:09:39 -07:00
Alex Crichton
54d5657d8d Rollup merge of #44542 - alexcrichton:fix-windows-emscripten, r=nikomatsakis
rustc: Spawn `cmd /c emcc.bat` explicitly

In #42436 the behavior for spawning processes on Windows was tweaked slightly to
fix various bugs, but this caused #42791 as a regression, namely that to spawn
batch scripts they need to be manually spawned with `cmd /c` instead now. This
updates the compiler to handle this case explicitly for Emscripten.

Closes #42791
2017-09-16 17:09:39 -07:00
Alex Crichton
941e172fc1 Rollup merge of #44531 - QuietMisdreavus:bump-gcc, r=alexcrichton
bump gcc for bootstrap

On Windows, the gcc crate would send /Wall to msvc, which would cause
builds to get flooded with warnings, exploding compile times from one
hour to more than 72! The gcc crate version 0.3.54 changes this behavior
to send /W4 instead, which greatly cuts down on cl.exe flooding the
command prompt window with warnings.
2017-09-16 17:09:37 -07:00
Alex Crichton
256b8879cc Rollup merge of #44395 - jcdyer:ip-constructors, r=alexcrichton
Ipv4Addr and Ipv6Addr convenience constructors.

Introduce convenience constructors for common types.

This introduces the following constructors:

* Ipv6Addr::localhost()
* Ipv6Addr::unspecified()
* Ipv4Addr::localhost()
* Ipv4Addr::unspecified()

The recently added `From` implementations were nice for avoiding the fallibility of conversions from strings like `"127.0.0.1".parse().unwrap()`, and `"::1".parse().unwrap()`, but while the Ipv4 version is roughly comparable in verbosity, the Ipv6 version lacks zero-segment elision, which makes it significantly more awkward: `[0, 0, 0, 0, 0, 0, 0, 0].into()`.  While there isn't a clear way to introduce zero elision to type that can infallibly be converted into Ipv6 addresses, this PR resolves the problem for the two most commonly used addresses, which, incidentally, are the ones that suffer the most from the lack of zero-segment elision.

This change is dead simple, and introduces no backwards incompatibility.

See also, [this topic on the inernals board](https://internals.rust-lang.org/t/pre-rfc-convenience-ip-address-constructors/5878)
2017-09-16 17:09:37 -07:00
Alex Crichton
48193c2fe0 Rollup merge of #44356 - nrc:rls-component-manifest, r=@alexcrichton
Attempt to fix the component manifest problem for rls-preview

cc #44270

See #44270
2017-09-16 17:09:37 -07:00
Alex Crichton
2a844b3d0d Rollup merge of #44273 - bluss:rc-downcast, r=alexcrichton
Implement <Rc<Any>>::downcast

* Implement `<Rc<Any>>::downcast::<T>`
  * New unstable method. Works just like Box\<Any\>, but for Rc.
  * Any has two cases for its methods: Any and Any + Send; Rc is never Send, so that case is skipped for Rc.
  * Motivation for being a method with self is to match Box and there is no user-supplied type; the inner type is Any and downcast does not conflict with any method of Any.
* Arc was skipped because Any itself has no downcast for the case that makes most sense: Any + Send + Sync
2017-09-16 17:09:36 -07:00
Murarth
1cbb2b3a88 Implement Arc/Rc raw pointer conversions for ?Sized
* Add `T: ?Sized` bound to {`Arc`,`Rc`}::{`from_raw`,`into_raw`}
2017-09-16 16:34:13 -07:00
bors
b492405b1f Auto merge of #43989 - circuitfox:sliceext-binary-search-sig, r=alexcrichton
Remove Borrow bound from SliceExt::binary_search

#37761 added a Borrow bound to `binary_search` and `binary_search_by_key` in `core::SliceExt`, but did not add it to the methods in `std::slice`. #41590 attempted to add this bound to `std::slice` but was not merged due to breakage. This PR removes the bound in `core::SliceExt`, so that these methods will have the same signature in `core` and `std`.

Fixes #41561
2017-09-16 22:20:55 +00:00
Michal Budzynski
04855950b9 stabilized needs_drop (fixes #41890) 2017-09-16 23:41:04 +02:00
Michal Budzynski
b7152901ce stabilized iterator_for_each (closes #42986)
updated clippy and rls as it uses the iterator_for_each
2017-09-16 22:49:40 +02:00