Commit graph

67883 commits

Author SHA1 Message Date
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
Jeremy Soller
00c7ea5f53 Fix network families 2017-09-16 20:54:11 -06: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
Michal Budzynski
5f62c0c864 Added more text from unstable-book to compiler_fence docs 2017-09-16 22:18:46 +02:00
Michal Budzynski
9a60bb077c Added example to compiler_fence docs taken from unstable-book 2017-09-16 22:18:46 +02:00
Michal Budzynski
8a11172d6b stabilized compiler_fences (fixes #41091) 2017-09-16 22:18:46 +02:00
bors
277476c4fb Auto merge of #43964 - Gankro:unsafe-reform, r=sfackler
implement unsafe pointer methods

I also cleaned up some existing documentation a bit here or there since I was doing so much auditing of it. Most notably I significantly rewrote the `offset` docs to clarify safety (`*const` and `*mut`'s offset docs had actually diverged).
2017-09-16 19:54:58 +00:00
bors
ae8efdc87d Auto merge of #43017 - durka:stabilize-const-invocation, r=eddyb
Individualize feature gates for const fn invocation

This PR changes the meaning of `#![feature(const_fn)]` so it is only required to declare a const fn but not to call one. Based on discussion at #24111. I was hoping we could have an FCP here in order to move that conversation forward.

This sets the stage for future stabilization of the constness of several functions in the standard library (listed below), so could someone please tag the lang team for review.

- `std::cell`
    - `Cell::new`
    - `RefCell::new`
    - `UnsafeCell::new`
- `std::mem`
    - `size_of`
    - `align_of`
- `std::ptr`
    - `null`
    - `null_mut`
- `std::sync`
    - `atomic`
        - `Atomic{Bool,Ptr,Isize,Usize}::new`
    - `once`
        - `Once::new`
- primitives
    - `{integer}::min_value`
    - `{integer}::max_value`

Some other functions are const but they are also unstable or hidden, e.g. `Unique::new` so they don't have to be considered at this time.

After this stabilization, the following `*_INIT` constants in the standard library can be deprecated. I wasn't sure whether to include those deprecations in the current PR.

- `std::sync`
    - `atomic`
        - `ATOMIC_{BOOL,ISIZE,USIZE}_INIT`
    - `once`
        - `ONCE_INIT`
2017-09-16 17:02:17 +00:00
Alex Burka
332c38cd70 bump rls 2017-09-16 15:53:02 +00:00
Alex Burka
681e5da61e change #![feature(const_fn)] to specific gates 2017-09-16 15:53:02 +00:00
Alex Crichton
5cfee9b854 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-16 08:35:47 -07:00
kennytm
9f763549c1
Make use of Travis's conditional jobs. 2017-09-16 19:28:08 +08:00
Ralf Jung
83589f2808 fix test name being printed twice for ui tests 2017-09-16 13:12:58 +02:00
Ralf Jung
474c717644 compiletest: print the correct basename of the src dir 2017-09-16 13:12:53 +02:00
bors
b965d55a32 Auto merge of #44605 - alexcrichton:less-rustdoc, r=Mark-Simulacrum
rustbuild: Compile the error-index in stage 2

Right now we comiple rustdoc in stage 2 and the error index in stage 0, which
ends up compiling rustdoc twice! To avoid compiling rustdoc twice (which takes
awhile) let's just compile it once in stage 2.
2017-09-16 09:26:45 +00:00
Zack M. Davis
d02ceacb25 --cap-lints allow switches off can_emit_warnings
This boolean field on the error `Handler` is toggled to silence
warnings when `-A warnings` is passed. (This is actually a separate
mechanism from the global lint level—whether there's some redundancy
to be factored away here is an important question, but not one we
concern ourselves with in this commit.)  But the same rationale
applies for `--cap-lints allow`. In particular, this makes the "soft"
feature-gate warning introduced in 8492ad24 (which is not a lint, but
just calls `struct_span_warn`) not pollute the builds of dependent
crates.

Thanks to @kennytm for pointing out the potential of
`can_emit_warnings` for this purpose.

Resolves #44213.
2017-09-16 00:13:07 -07:00
Jessica Hamilton
3443dd8801 ci: haiku: wrap lines as necessary for tidy. 2017-09-16 01:00:40 -05:00
MaulingMonkey
995f0bdb9b Skip passing /natvis to lld-link until supported.
LLVM 5.0.0's lld-link frontend errors out if passed /natvis.
LLVM 6 (maybe earlier?) should at least ignore the flag.
Hopefully LLVM will eventually support the flag, at which point
this workaround can perhaps be simply removed, if 6? is old enough.
2017-09-15 22:16:18 -07:00
bors
3a7ab6cdd1 Auto merge of #44610 - alexcrichton:osx-no-assertions, r=Mark-Simulacrum
travis: Disable LLVM assertions on OSX

Our OSX builders are routinely and significantly over hour 2 hour "soft limit"
for testing PRs. I *think* that a big portion of this time comes from the fact
that LLVM and debug assertions are enabled. In an effort to speed up these
builders and reduce cycle time this commit disables LLVM assertions on OSX for
all builders.

My thinking is that we'll let this bake for a bit after merged to see what the
effect is on timing on Travis. If it doesn't actually help much we can turn them
back on, and if it doesn't help enough we can disable Rust debug assertions as
well.
2017-09-16 04:04:24 +00:00
Jessica Hamilton
06d8118d8e ci: haiku: rename llvm-config to address tidy issues. 2017-09-15 21:51:50 -05:00
Trevor Merrifield
e391079496 Retain suid/sgid/sticky bits in Metadata.permissions
Most users would expect set_permissions(Metadata.permissions()) to be
non-destructive. While we can't guarantee this, we can at least pass
the needed info to chmod.

Also update the PermissionsExt documentation to disambiguate what it
contains, and to refer to the underlying value as `st_mode` rather than
its type `mode_t`.

Closes #44147
2017-09-15 22:42:34 -04:00
Corey Farwell
5ff7064330 Fix incorrect into_inner link in docs.
Fixes https://github.com/rust-lang/rust/issues/42373.
2017-09-15 21:52:40 -04:00
Zack M. Davis
d09db63d2f unstable book section for fn_must_use 2017-09-15 17:13:48 -07:00
Jessica Hamilton
4fb402c37b ci: move dist-x86_64-haiku into disabled. 2017-09-15 19:04:24 -05:00
Zack M. Davis
e9569d91cf RFC 1940 UI test in own directory, exercise must_use trait methods
(It was put forward that all tests related to a feature being in their own
directory makes stabilization decisionmaking more convenient.)
2017-09-15 16:26:34 -07:00
Alex Crichton
3da54fb036 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-15 15:28:59 -07:00