Commit Graph

67646 Commits

Author SHA1 Message Date
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
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
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
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
Alex Crichton 97fee3e94b 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-15 10:34:05 -07:00
Ulrik Sverdrup 3a39d95330 alloc: Add tracking issue for rc_downcast 2017-09-15 19:16:22 +02:00
Alex Crichton 61e255a534 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-15 09:35:08 -07:00
bors fd4bef54ab Auto merge of #43949 - GuillaumeGomez:compile_fail_stable, r=alexcrichton
Compile fail stable

Since #30726, we never made the `compile_fail` flag nor the error code check stable. I think it's time to change this fact.

r? @alexcrichton
2017-09-15 08:05:39 +00:00
bors d86a7f7a78 Auto merge of #44585 - frewsxcv:rollup, r=frewsxcv
Rollup of 23 pull requests

- Successful merges: #44131, #44254, #44368, #44374, #44378, #44388, #44430, #44450, #44453, #44472, #44476, #44477, #44485, #44497, #44521, #44534, #44536, #44541, #44552, #44559, #44563, #44569, #44572
- Failed merges:
2017-09-15 04:22:45 +00:00
Corey Farwell 68e0f28304 Rollup merge of #44572 - frewsxcv:frewsxcv-from-utf16-lossy, r=QuietMisdreavus
Clarify return type of `String::from_utf16_lossy`.

Fixes https://github.com/rust-lang/rust/issues/32874
2017-09-14 22:32:52 -04:00
Corey Farwell 2a86884a37 Rollup merge of #44569 - est31:master, r=estebank
"avoid" is a better word here than "disable"

You don't "disable" the warning really, you just avoid it (as a conscious action).
2017-09-14 22:32:51 -04:00
Corey Farwell 4af8acd6c1 Rollup merge of #44563 - budziq:stablilize_tcpstream_connect_timeout, r=alexcrichton
stabilize tcpstream_connect_timeout (closes #43079)
2017-09-14 22:32:50 -04:00
Corey Farwell 19ad12af65 Rollup merge of #44559 - frewsxcv:frewsxcv-rm-loop, r=sfackler
Remove unneeded `loop`.

None
2017-09-14 22:32:49 -04:00
Corey Farwell ffd286ba6f Rollup merge of #44552 - durka:patch-42, r=alexcrichton
update "since" for discriminant_value

It's [going](https://github.com/rust-lang/rust/pull/44263#issuecomment-329257597) to be backported to beta.

r? @alexcrichton
2017-09-14 22:32:48 -04:00
Corey Farwell b87e4f6421 Rollup merge of #44541 - GuillaumeGomez:openoptions-docs, r=QuietMisdreavus
Openoptions docs

r? @QuietMisdreavus
2017-09-14 22:32:48 -04:00
Corey Farwell 3e478fd512 Rollup merge of #44536 - Havvy:transmute-docs, r=steveklabnik
Fix example in transmute; add safety requirement to Vec::from_raw_parts

This fixes the second bullet point on #44281 and also removes some incorrect information.
2017-09-14 22:32:47 -04:00
Corey Farwell a48cc80d57 Rollup merge of #44534 - adlerd:drain_filter_doctest, r=bluss
Fix drain_filter doctest.

Fixes #44499.

Also change some of the hidden logic in the doctest as a regression test; two bugs in the original would now cause test failure.
2017-09-14 22:32:46 -04:00
Corey Farwell 50240f80f1 Rollup merge of #44521 - rwakulszowa:str_utf16_doc, r=frewsxcv
Add an example of std::str::encode_utf16

Closes #44419
2017-09-14 22:32:45 -04:00
Corey Farwell 1d361ff2a5 Rollup merge of #44497 - tommyip:doc_example, r=frewsxcv
Add doc example to str::from_boxed_utf8_unchecked

Fixes #44463.
2017-09-14 22:32:44 -04:00
Corey Farwell e3c4b8c43a Rollup merge of #44485 - 42triangles:master, r=frewsxcv
Added an example for `std::str::into_boxed_bytes()`

This solves issue #44423.
2017-09-14 22:32:43 -04:00
Corey Farwell 592cafeb3d Rollup merge of #44477 - napen123:master, r=frewsxcv
Add doc examples to str::from_utf8_unchecked_mut

Fixes #44461
2017-09-14 22:32:42 -04:00
Corey Farwell 27b1097ba0 Rollup merge of #44476 - integer32llc:update-label-explanation, r=Mark-Simulacrum
Update label explanations

Some of the newer labels weren't covered in CONTRIBUTING.md :)

r? @Mark-Simulacrum
2017-09-14 22:32:41 -04:00
Corey Farwell 65b9b56463 Rollup merge of #44472 - smt923:master, r=frewsxcv
Add short doc examples for str::from_utf8_mut

Fixes #44462
2017-09-14 22:32:40 -04:00
Corey Farwell b4f6fba1d9 Rollup merge of #44453 - tommyip:doc_string_as_mut_str, r=frewsxcv
Add doc example to String::as_mut_str

Fixes #44429.
2017-09-14 22:32:38 -04:00
Corey Farwell 1e2d6a804e Rollup merge of #44450 - SergioBenitez:master, r=nrc
Add `impl From<Vec<Span>> for MultiSpan`.

A simple `impl`.

r? @nrc
2017-09-14 22:32:37 -04:00
Corey Farwell 5255ab7e2a Rollup merge of #44430 - steveklabnik:update-mdbook, r=alexcrichton
update mdbook

This eliminates some warnings

r? @alexcrichton
2017-09-14 22:32:37 -04:00
Corey Farwell eb45c0ac7f Rollup merge of #44388 - tbu-:pr_doc_udp_connect_multiple, r=frewsxcv
Clarify the behavior of UDP sockets wrt. multiple addresses in `connect`

CC @frewsxcv #22569 #44209
2017-09-14 22:32:36 -04:00
Corey Farwell 64690fe92e Rollup merge of #44378 - frehberg:rustdoc, r=dtolnay
rustdoc: extend UdpSocket API doc (#657)

see  https://github.com/carllerche/mio/issues/657
2017-09-14 22:32:35 -04:00
Corey Farwell 3ef792a035 Rollup merge of #44374 - jsheard:threadname, r=alexcrichton
Implement named threads on Windows (v2)

https://msdn.microsoft.com/en-us/library/windows/desktop/mt774976(v=vs.85).aspx

Windows 10 version 1607 finally added a sensible API for naming threads, so we can now implement named threads without having to use MSVC compiler extensions like before. VS2017s debugger and the WPA profiler already use this API where available, but other tools may need some time to catch up.

![thread](https://user-images.githubusercontent.com/3153547/30133438-c92a3cda-934b-11e7-9668-915d53e8d860.png)
2017-09-14 22:32:34 -04:00
Corey Farwell 9761a8dc14 Rollup merge of #44368 - ollie27:rustdoc_pulldown_ids, r=QuietMisdreavus
rustdoc: Don't counts ids twice when using --enable-commonmark

cc @GuillaumeGomez
r? @QuietMisdreavus
2017-09-14 22:32:33 -04:00
Corey Farwell 4e646ba713 Rollup merge of #44254 - GuillaumeGomez:const-fix-rustdoc, r=QuietMisdreavus
Fix rendering of const keyword for functions

Fixes #44187.

r? @QuietMisdreavus
2017-09-14 22:32:32 -04:00
Corey Farwell 76799d1ea3 Rollup merge of #44131 - smaeul:openssl-perl, r=Mark-Simulacrum
Explicitly run perl for OpenSSL Configure

OpenSSL's Configure script is missing a shebang. On some platforms,
execve falls back to execution with the shell. Some other platforms,
like musl, will fail with an exec format error. Avoid this by calling
perl explicitly (since it's a perl script).
2017-09-14 22:32:31 -04:00
Douglas Campos 3fe4612d14 bring Ty into scope 2017-09-14 21:54:21 -04:00
J. Cliff Dyer 9d5b0e1ff5 Add unstable attributes for Ipv?Addr constructors. 2017-09-14 21:30:36 -04:00
Douglas Campos 2bde6949f9 bring TyCtxt into scope 2017-09-14 21:26:06 -04:00
Alex Crichton ddd321df91 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-14 13:17:25 -07:00
Corey Farwell 258ef37f8e Clarify return type of `String::from_utf16_lossy`.
Fixes https://github.com/rust-lang/rust/issues/32874
2017-09-14 15:47:37 -04:00
bors 2d288a5ae5 Auto merge of #44502 - alexcrichton:remove-session-dep-graph, r=michaelwoerister
rustc: Remove `Session::dep_graph`

This commit removes the `dep_graph` field from the `Session` type according to
issue #44390. Most of the fallout here was relatively straightforward and the
`prepare_session_directory` function was rejiggered a bit to reuse the results
in the later-called `load_dep_graph` function.

Closes #44390
2017-09-14 19:37:11 +00:00
Alex Crichton 1cf956f2ba rustc: Remove `Session::dep_graph`
This commit removes the `dep_graph` field from the `Session` type according to
issue #44390. Most of the fallout here was relatively straightforward and the
`prepare_session_directory` function was rejiggered a bit to reuse the results
in the later-called `load_dep_graph` function.

Closes #44390
2017-09-14 10:40:50 -07:00
est31 168f624c7c "avoid" is a better word here than "disable" 2017-09-14 17:23:47 +02:00
Michal Budzynski 199cb82597 stabilize tcpstream_connect_timeout (closes #43079) 2017-09-14 16:18:49 +02:00