Commit Graph

63531 Commits

Author SHA1 Message Date
Ariel Ben-Yehuda
25834dcb9b Rollup merge of #41493 - scottmcm:fix-step-replace, r=sfackler
Step::replace_one should put a one, not a zero (Issue #41492)

Turns out all six of the replace_* impls were backwards.
2017-04-26 22:11:04 +00:00
Ariel Ben-Yehuda
639000ea2e Rollup merge of #41456 - jessicah:haiku-support, r=alexcrichton
Haiku: fix initial platform support
2017-04-26 22:11:03 +00:00
Ariel Ben-Yehuda
a3dde0b457 Rollup merge of #41370 - malbarbo:android-bootstrap, r=alexcrichton
Add bootstrap support for android
2017-04-26 22:11:02 +00:00
bors
036983201d Auto merge of #41420 - alexcrichton:mingw-6.3.0, r=petrochenkov
appveyor: Upgrade to gcc for mingw 6.3.0

This commit sort of brings back #40777 by upgrading back to 6.3.0. While
investigating #40546 it was discovered that 6.3.0 appears to not spurious
fail in the same way that 6.2.0 does (which we're currently using). The
workaround for #40184 contained in #40777 did not work so this commit also
contains a different workaround for the gdb issue. We will not download the
6.2.0 version of gdb and use that instead of the default version that comes with
6.3.0.

I'm going to optimistically say...

Closes #40546
2017-04-26 15:12:30 +00:00
Alex Crichton
d1db74b63e appveyor: Upgrade to gcc for mingw 6.3.0
This commit sort of brings back #40777 by upgrading back to 6.3.0. While
investigating #40546 it was discovered that 6.3.0 appears to not spurious
fail in the same way that 6.2.0 does (which we're currently using). The
workaround for #40184 contained in #40777 did not work so this commit also
contains a different workaround for the gdb issue. We will not download the
6.2.0 version of gdb and use that instead of the default version that comes with
6.3.0.

I'm going to optimistically say...

Closes #40546
2017-04-26 06:58:50 -07:00
bors
0ee56f686d Auto merge of #41352 - kennytm:macos-sanitizers, r=alexcrichton
Support AddressSanitizer and ThreadSanitizer on x86_64-apple-darwin

[ASan](https://clang.llvm.org/docs/AddressSanitizer.html#supported-platforms) and [TSan](https://clang.llvm.org/docs/ThreadSanitizer.html#supported-platforms) are supported on macOS, and this commit enables their support.

The sanitizers are always built as `*.dylib` on Apple platforms, so they cannot be statically linked into the corresponding `rustc_?san.rlib`. The dylibs are directly copied to `lib/rustlib/x86_64-apple-darwin/lib/` instead.

Note, although Xcode also ships with their own copies of ASan/TSan dylibs, we cannot use them due to version mismatch.

----

~~There is a caveat: the sanitizer libraries are linked as `@rpath/` (due to https://reviews.llvm.org/D6018), so the user needs to additionally pass `-C rpath`:~~

**Edit:** Passing rpath is now automatic.
2017-04-26 12:34:45 +00:00
bors
b0a4074c5e Auto merge of #41504 - eddyb:query-api, r=nikomatsakis
Improve the librustc on-demand/query API ergonomics.

Queries are now performed through these two forms:
* `tcx.type_of(def_id)` (the most common usage)
* `tcx.at(span).type_of(def_id)` (to provide a more specific location in the cycle stack)

Several queries were renamed to work better as method names, i.e. by suffixing with `_of`.

r? @nikomatsakis
2017-04-26 09:54:11 +00:00
bors
dad9814eb0 Auto merge of #41258 - clarcharr:str_box_extras, r=Kimundi
More methods for str boxes. (reduce Box<[u8]> ↔ Box<str> transmutes)

This is a follow-up to #41096 that adds safer methods for converting between `Box<str>` and `Box<[u8]>`. They're gated under a different feature from the `&mut str` methods because they may be too niche to include in public APIs, although having them internally helps reduce the number of transmutes the standard library uses.

What's added:

* `From<Box<str>> for Box<[u8]>`
* `<Box<str>>::into_boxed_bytes` (just calls `Into::into`)
* `alloc::str` (new module)
* `from_boxed_utf8` and `from_boxed_utf8_unchecked`, defined in `alloc:str`, exported in `collections::str`
* exports `from_utf8_mut` in `collections::str` (missed from previous PR)
2017-04-26 06:18:17 +00:00
bors
4512424391 Auto merge of #41551 - frewsxcv:rollup, r=frewsxcv
Rollup of 9 pull requests

- Successful merges: #39983, #41442, #41463, #41500, #41518, #41527, #41528, #41530, #41535
- Failed merges:
2017-04-26 03:26:12 +00:00
Corey Farwell
1fd8ba9088 Rollup merge of #41535 - steveklabnik:gh37746, r=alexcrichton
Fix up vec guarnatee around capacity

Fixes #37746

r? @rust-lang/libs
2017-04-25 23:06:01 -04:00
Corey Farwell
e2a04678da Rollup merge of #41530 - GuillaumeGomez:vec-from, r=aturon
Implement From<&mut [T]> for Vec

Fixes #41386.
2017-04-25 23:06:00 -04:00
Corey Farwell
9ae413c386 Rollup merge of #41528 - steveklabnik:gh33269, r=frewsxcv
Clarify "side effect" in peek's docs

Fixes #33269

/cc @tshepang
2017-04-25 23:05:59 -04:00
Corey Farwell
e7f1c4fd14 Rollup merge of #41527 - steveklabnik:gh41285, r=frewsxcv
Clarify the doc index

With regards to the unstable book, the reference, and the
processes involved.

Also, fix up a link by pointing to the new tracking issue rather than
the older one.

Fixes #41285

r? @frewsxcv
2017-04-25 23:05:58 -04:00
Corey Farwell
997593f16c Rollup merge of #41518 - tbu-:pr_fix_cp_error, r=sfackler
Fix a copy-paste error in `Instant::sub_duration`

Fixes #41514.
2017-04-25 23:05:58 -04:00
Corey Farwell
41933c315c Rollup merge of #41500 - steveklabnik:gh37866, r=frewsxcv
use the word 'length' in Vec::len's docs

Fixes #37866
2017-04-25 23:05:57 -04:00
Corey Farwell
5f62b2716f Rollup merge of #41463 - SergioBenitez:master, r=alexcrichton
Add internal accessor methods to io::{Chain, Take}.

Resolves #29067.
2017-04-25 23:05:56 -04:00
Corey Farwell
2a320c32ed Rollup merge of #41442 - tbu-:pr_writeall_interrupted, r=aturon
Specify behavior of `write_all` for `ErrorKind::Interrupted` errors

Also spell out that read and write operations should be retried on
`ErrorKind::Interrupted` errors.

Fixes #38494.
2017-04-25 23:05:55 -04:00
Corey Farwell
27fbe8cbca Rollup merge of #39983 - AndrewGaspar:rust-windbg, r=brson
Adds rust-windbg.cmd script

Adds rust-gdb/rust-lldb equivalent for windbg that loads the Rust .natvis files on start.

This change modifies the bootstrap code to add rust-windbg to bin and the .natvis files to lib/rustlib/etc.

Example usage from cmd or PowerShell:
```
rust-windbg -c "bu rs_f442289d74765418!rs::main;g" target\debug\rs.exe
```
2017-04-25 23:05:54 -04:00
bors
7e7114fe2e Auto merge of #41332 - petrochenkov:privti, r=eddyb
Check privacy of trait items in all contexts

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

This is a sufficiently rare scenario and it's currently guarded by `private_in_public` lint, so it shouldn't be a [breaking-change] in practice.
2017-04-25 23:46:37 +00:00
Vadim Petrochenkov
4bd417e438 Fix object safety violations in the test 2017-04-25 22:38:39 +03:00
Vadim Petrochenkov
1883b8d715 privacy: Rename and cleanup PrivacyVisitor 2017-04-25 22:38:39 +03:00
Vadim Petrochenkov
82e030322b Check privacy of trait items in all contexts 2017-04-25 22:38:39 +03:00
bors
2b4c911581 Auto merge of #41362 - alexcrichton:run-cargot-ests, r=aturon
Run tests for the cargo submodule in tree

Previously the `cargotest` suite would run some arbitrary revision of Cargo's
test suite, but now that we're bundling it in tree we should be running the
Cargo submodule's test suite instead.
2017-04-25 15:51:40 +00:00
steveklabnik
19b7272dbc Fix up vec guarnatee around capacity
Fixes #37746
2017-04-25 10:41:17 -04:00
Guillaume Gomez
e70a266b3b Implement From<&mut [T]> for Vec 2017-04-25 12:34:45 +02:00
kennytm
164fd696bf
Do not check if libclang_rt.?san_*_dynamic.dylib is an unstable crate.
These are not even crates...
2017-04-25 18:34:21 +08:00
bors
c7e724a148 Auto merge of #40434 - mattico:splice-update, r=alexcrichton
Implement Vec::splice and String::splice (RFC 1432)

RFC: rust-lang/rfcs#1432, tracking issue: #32310
A rebase of https://github.com/rust-lang/rust/pull/32355 with a few more tests.

Let me know if you have any ideas for more tests.

cc @SimonSapin
2017-04-25 10:34:07 +00:00
steveklabnik
696df71d0c Clarify "side effect" in peek's docs
Fixes #33269
2017-04-25 05:38:26 -04:00
steveklabnik
dce33e96bc Clarify the doc index
With regards to the unstable book, the reference, and the
processes involved.

Also, fix up a link by pointing to the new tracking issue rather than
the older one.

Fixes #41285
2017-04-25 05:35:51 -04:00
kennytm
86747a9952
Force link with an absolute rpath when using sanitizer on macOS. 2017-04-25 10:31:01 +08:00
kennytm
00dff0aa59
Support AddressSanitizer and ThreadSanitizer on x86_64-apple-darwin.
ASan and TSan are supported on macOS, and this commit enables their
support.

The sanitizers are always built as *.dylib on Apple platforms, so they
cannot be statically linked into the corresponding `rustc_?san.rlib`. The
dylibs are directly copied to `lib/rustlib/x86_64-apple-darwin/lib/`
instead.

Note, although Xcode also ships with their own copies of ASan/TSan dylibs,
we cannot use them due to version mismatch.

There is a caveat: the sanitizer libraries are linked as @rpath, so the
user needs to additionally pass `-C rpath`:

    rustc -Z sanitizer=address -C rpath file.rs
                               ^~~~~~~~

Otherwise there will be a runtime error:

    dyld: Library not loaded: @rpath/libclang_rt.asan_osx_dynamic.dylib
      Referenced from: /path/to/executable
      Reason: image not found
    Abort trap: 6

The next commit includes a temporary change in compiler to force the linker
to emit a usable @rpath.
2017-04-25 10:31:01 +08:00
kennytm
93d57d64b8
Pass --format-version 1 to cargo metadata.
Suppress warning introduced by rust-lang/cargo#3841.
2017-04-25 10:31:00 +08:00
Sergio Benitez
c168d8bb07 Add cautions to io::get_mut method documentation. 2017-04-24 17:12:42 -07:00
Sergio Benitez
76397aea50 Reference tracking issue for more_io_inner_methods. 2017-04-24 17:12:38 -07:00
Sergio Benitez
aab87e3e9e Add more_io_inner_methods feature to unstable book. 2017-04-24 16:36:50 -07:00
Sergio Benitez
a765dcaf53 Add internal accessor methods to io::{Chain, Take}.
Resolves #29067.
2017-04-24 16:36:50 -07:00
Andrew Gaspar
70e673952e Adds rust-windbg.cmd script 2017-04-24 16:26:00 -07:00
Tobias Bucher
957d51aecb Fix a copy-paste error in Instant::sub_duration
Fixes #41514.
2017-04-25 01:02:59 +02:00
bors
0777c757a6 Auto merge of #40123 - TimNN:llvm40, r=alexcrichton
LLVM 4.0 Upgrade

Since nobody has done this yet, I decided to get things started:

**Todo:**

* [x] push the relevant commits to `rust-lang/llvm` and `rust-lang/compiler-rt`
* [x] cleanup `.gitmodules`
* [x] Verify if there are any other commits from `rust-lang/llvm` which need backporting
* [x] Investigate / fix debuginfo ("`<optimized out>`") failures
* [x] Use correct emscripten version in docker image

---

Closes #37609.

---

**Test results:**

Everything is green 🎉
2017-04-24 22:18:16 +00:00
Clar Charr
c66c6e9697 More methods for str boxes. 2017-04-24 17:51:49 -04:00
Alex Crichton
009f45f8f1 Run tests for the cargo submodule in tree
Previously the `cargotest` suite would run some arbitrary revision of Cargo's
test suite, but now that we're bundling it in tree we should be running the
Cargo submodule's test suite instead.
2017-04-24 08:08:40 -07:00
Eduard-Mihai Burtescu
decf7598ef rustc: use tcx.at(span) to set the location of a query. 2017-04-24 18:06:39 +03:00
Matt Ickstadt
feae5a08a2 Add Splice forget test 2017-04-24 09:49:29 -05:00
Jessica Hamilton
0d63f13378 Haiku: add missing cases of using LIBRARY_PATH 2017-04-24 14:29:39 +00:00
Eduard-Mihai Burtescu
9bde6b6d96 rustc: expose the common DUMMY_SP query case as tcx methods. 2017-04-24 17:23:43 +03:00
bors
63c77214c1 Auto merge of #40634 - GuillaumeGomez:refcell-docs, r=steveklabnik
Add more explanation on RefCell::get_mut

Fixes #40203.

r? @rust-lang/docs
2017-04-24 13:09:35 +00:00
Guillaume Gomez
3ad844cfe2 Add more explanation on RefCell::get_mut 2017-04-24 15:08:39 +02:00
Eduard-Mihai Burtescu
612bb1f54e rustc: rename some of the queries to match tcx methods. 2017-04-24 15:20:52 +03:00
steveklabnik
f852e3fcbc use the word 'length' in Vec::len's docs
Fixes #37866
2017-04-24 07:47:05 -04:00
bors
846891aeff Auto merge of #41494 - withoutboats:associated-consts-are-not-object-safe, r=eddyb
Associated consts are not object safe.

fixes #26847

r? @eddyb
2017-04-24 10:06:41 +00:00