Commit Graph

58521 Commits

Author SHA1 Message Date
Michael Woerister 39ffea31df Implement a file-path remapping feature in support of debuginfo and reproducible builds. 2017-04-26 15:44:02 +02: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
steveklabnik 29e6656859 Address platform-specific behavior in TcpStream::shutdown
Fixes #25164
2017-04-26 05:30:35 -04:00
steveklabnik 7b7fe9b5c1 Clean up TcpStream example
Fixes #35950
2017-04-26 05:27:03 -04: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
Michael Wu 27b00ec752 Cherry pick LLVM hexagon fixes 2017-04-26 02:11:49 -04:00
Esteban Küber 1ca1483113 Point at variable moved by closure 2017-04-25 22:03:05 -07:00
Jessica Hamilton 85c2ff1c46 Update num_cpus dependency to 1.x (1.4.0) 2017-04-26 15:25:03 +12: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
Michael Wu 32aeb22f54 Avoid the hexagon backend on old versions of LLVM 2017-04-25 22:59:31 -04:00
Wesley Wiser 9f96d0a7b8 Add a regression test for ICE #33287
Fixes #33287
2017-04-25 22:57:04 -04:00
Josh Stone b9bdb1766d Reduce the contents of the rust-src component 2017-04-25 16:13:46 -07:00
Josh Stone 7248f67f1b Build the rustc-src tarball before the rust-src component 2017-04-25 16:13:45 -07:00
Vadim Petrochenkov d349e87d61 Parse trait object types starting with a lifetime bound 2017-04-25 23:58:05 +03: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
Cameron Hart a510e1df76 Added test for #41479 from @eddyb. 2017-04-25 21:18:30 +10: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
Cameron Hart 72acea0e80 Add missing struct field index adjustments.
Some accesses in OperandPairs were missing. Fixes #41479.
2017-04-25 20:27:29 +10:00
Guillaume Gomez 3f97b2a65c Add ui tests 2017-04-25 12:21:28 +02: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
Michael Wu c558a2ae37 Add Hexagon support
This requires an updated LLVM with D31999 and D32000 to build libcore.

A basic hello world builds and runs successfully on the hexagon simulator.
2017-04-25 01:56:44 -04:00
Gianni Ciccarelli 715811d0be support `default impl` for specialization
pr review
2017-04-25 05:28:22 +00: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
Guillaume Gomez b10c04472b Remove strip prefix 2017-04-24 15:16:52 +02:00
Guillaume Gomez bd880bc6bf Add tests for module suggestions 2017-04-24 15:16:52 +02:00
Guillaume Gomez e482529022 Fix invalid module suggestion 2017-04-24 15:14:15 +02: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
Gianni Ciccarelli b0fca5f790 support `default impl` for specialization
rebase after support for llvm-3.7
2017-04-24 10:08:48 +00:00
Gianni Ciccarelli 6427fdce7a support `default impl` for specialization
fix tidy
2017-04-24 10:08:48 +00:00
Gianni Ciccarelli 116e9831a5 support `default impl` for specialization
this commit implements the first step of the `default impl` feature:
all items in a `default impl` are (implicitly) `default` and hence
specializable.
In order to test this feature I've copied all the tests provided for the
`default` method implementation (in run-pass/specialization and
compile-fail/specialization directories) and moved the `default` keyword
from the item to the impl.
See referenced issue for further info
2017-04-24 10:08:48 +00:00
Without Boats 5dc43d272d Feature gate in test. 2017-04-24 02:42:36 -07:00
Without Boats 95ffda1e9e Style. 2017-04-24 01:40:17 -07:00
Without Boats ed5d09d8f3 Fix type error. 2017-04-24 01:20:36 -07:00
Without Boats bd31498ef6 Add compile-fail test. 2017-04-24 01:19:12 -07:00
Without Boats 86b10671db Associated consts are not object safe. 2017-04-23 22:00:09 -07:00
Scott McMurray f8c6436173 Step::replace_one should put a one, not a zero (Issue #41492)
Turns out all six of these impls are incorrect.
2017-04-23 21:47:09 -07:00
Matt Ickstadt 7b86ba0d8d Add splice to the unstable book. 2017-04-23 21:23:50 -05:00
Matt Ickstadt c3baa8c0a7 Use Vec::splice impl in string::Splice::drop() 2017-04-23 21:23:50 -05:00
Matt Ickstadt cec00bab1d Improve splice docs and tests 2017-04-23 21:23:50 -05:00
Matt Ickstadt b85e2e4735 Update splice impl 2017-04-23 21:23:45 -05:00
Simon Sapin 2111aff682 Add Vec::splice and String::splice 2017-04-23 19:19:38 -05:00
bors 15ce54096a Auto merge of #41486 - arielb1:select-where, r=eddyb
traits::select: quickly filter out predicates from other traits

this improves most pre-trans passes's performance by ~1%.

That missed the spring cleaning PR because I wanted to ship it.

r? @eddyb
2017-04-23 23:06:50 +00:00
Ariel Ben-Yehuda d3476f4b76 cache ADT dtorck results
This avoids visiting the fields of all structs multiple times, improving
item-bodies checking time by 10% (!).
2017-04-23 23:09:21 +03:00
Ariel Ben-Yehuda eadb049799 traits::select: quickly filter out predicates from other traits
this improves most pre-trans passes's performance by ~1%.
2017-04-23 23:05:25 +03:00
Tim Neumann 8994277657 FIN: windows-gnu: statically link gcc_s, pthread with llvm 2017-04-23 22:00:03 +02:00
Tim Neumann f3dda17469 FIN: Compile LLVM with -fno-omit-frame-pointer on 32bit MinGW builds
to work around an apparently bad optimization.
2017-04-23 22:00:03 +02:00
Tim Neumann 6723e69a54 FIN: ignore failing test on emscripten, see #41299 2017-04-23 22:00:02 +02:00
Tim Neumann 5ae4a58c33 FIN: build comiler-rt wihout Thumb on arm 2017-04-23 22:00:02 +02:00
Tim Neumann a146431e4c FIN: disable backtrace printing for panic-runtime/abort* on ARM 2017-04-23 22:00:02 +02:00
Tim Neumann a0ce63be2b FIN: update emscripten builder 2017-04-23 22:00:01 +02:00
Tim Neumann f622542b64 FIN/CRT: adopt all applicable rust compiler-rt patches 2017-04-23 22:00:01 +02:00
Tim Neumann aaa307ce47 FIN/LLVM: new rust patches required for 4.0 2017-04-23 22:00:01 +02:00
Tim Neumann 4fcfab16d3 FIN/LLVM: adopt all applicable rust llvm patches 2017-04-23 22:00:01 +02:00
Tim Neumann 167b7eb8b5 FIN: update to upstream (llvm 4.0.1 + fastcomp 1.37.10) & compiler-rt 4.0 2017-04-23 22:00:00 +02:00
Ariel Ben-Yehuda 5412587910 clean-up adt_sized_constraint now that it uses on-demand 2017-04-23 14:37:18 +03:00
Eduard-Mihai Burtescu 8054377f8f rustc_const_eval: support all unit enum variants. 2017-04-23 11:11:57 +03:00
Eduard-Mihai Burtescu 0ff828baa0 rustc_const_eval: CallOn isn't needed, typeck/const-qualif handle those cases. 2017-04-23 11:11:56 +03:00
Eduard-Mihai Burtescu e22873d912 rustc: make the const-eval cache polymorphic. 2017-04-23 11:11:54 +03:00
bors a94124488a Auto merge of #41437 - cuviper:remove-unstable-deprecated, r=alexcrichton
Remove items that are unstable and deprecated

This removes unstable items that have been deprecated for more than one cycle.

- Since 1.16.0, `#![feature(enumset)]`
    - All of `mod collections::enum_set`
- Since 1.15.0, `#![feature(borrow_state)]`
    - `cell::BorrowState`
    - `RefCell::borrow_state()`
- Since 1.15.0, `#![feature(is_unique)]`
    - `Rc::is_unique()` (made private like `Arc::is_unique()`)
- Since 1.15.0, `#![feature(rc_would_unwrap)]`
    - `Rc::would_wrap()`
- Since 1.13.0, `#![feature(binary_heap_extras)]`
    - `BinaryHeap::push_pop()`
    - `BinaryHeap::replace()`
- Since 1.12.0, `#![feature(as_unsafe_cell)]`
    - `Cell::as_unsafe_cell()`
    - `RefCell::as_unsafe_cell()`
- Since 1.12.0, `#![feature(map_entry_recover_keys)]`
    - `btree_map::OccupiedEntry::remove_pair()`
    - `hash_map::OccupiedEntry::remove_pair()`
- Since 1.11.0, `#![feature(float_extras)]`
    - `Float::nan()`
    - `Float::infinity()`
    - `Float::neg_infinity()`
    - `Float::neg_zero()`
    - `Float::zero()`
    - `Float::one()`
    - `Float::integer_decode()`
    - `f32::integer_decode()`
    - `f32::ldexp()`
    - `f32::frexp()`
    - `f32::next_after()`
    - `f64::integer_decode()`
    - `f64::ldexp()`
    - `f64::frexp()`
    - `f64::next_after()`
- Since 1.11.0, `#![feature(zero_one)]`
    - `num::Zero`
    - `num::One`
2017-04-23 02:13:55 +00:00
Corey Farwell 13d2534fd3 Remove unused import. 2017-04-22 22:13:22 -04:00
bors 252d3da8a6 Auto merge of #41469 - arielb1:rustc-spring-cleaning, r=eddyb
Performance audit, Spring 2017

Fix up some quite important performance "surprises" I've found running callgrind on rustc.
2017-04-22 20:07:01 +00:00
Ariel Ben-Yehuda a660ad84b3 bail out of selection when there are multiple surviving candidates
In some cases (e.g. <[int-var] as Add<[int-var]>>), selection can turn up
a large number of candidates. Bailing out early avoids O(n^2) performance.

This improves item-type checking time by quite a bit, resulting in ~2% of total
time-to-typeck.
2017-04-22 21:02:50 +03:00
Ariel Ben-Yehuda a0f145ba8c add a cache to impl_polarity
this is another one of these things that looks *much* worse on valgrind.
2017-04-22 21:02:41 +03:00
Ariel Ben-Yehuda 81af6fb67c allocate less strings in `symbol_names`
this improves trans performance by *another* 10%.
2017-04-22 21:02:02 +03:00
Ariel Ben-Yehuda 266d36f3b1 weak_lang_items: check for `lang` attribute before calling `value_str`
improves trans performance by *another* 10%.
2017-04-22 21:00:50 +03:00
Ariel Ben-Yehuda ece6c8434b cache attributes of items from foreign crates
this avoids parsing item attributes on each call to `item_attrs`, which takes
off 33% (!) of translation time and 50% (!) of trans-item collection time.
2017-04-22 21:00:50 +03:00
Ariel Ben-Yehuda acd0e40b86 short-cut SharedCrateContext::layout_of
That method is *incredibly* hot, so this ends up saving 10% of trans
time.

BTW, we really should be doing dependency tracking there - and possibly be
taking the respective perf hit (got to find a way to make DTMs fast), but
`layout_cache` is a non-dep-tracking map.
2017-04-22 21:00:50 +03:00
Ariel Ben-Yehuda e1377a4f47 avoid calling `mk_region` unnecessarily
this improves typeck & trans performance by 1%. This looked hotter on
callgrind than it is on a CPU.
2017-04-22 21:00:50 +03:00
Ariel Ben-Yehuda 3bf00450cb remove cleanup branches to the resume block
This improves LLVM performance by 10% lost during the shimmir transition.
2017-04-22 21:00:50 +03:00
bors cb4065b9ce Auto merge of #41431 - GuillaumeGomez:hoedown-default, r=aturon
Re-enable hoedown by default

r? @rust-lang/docs

cc @aturon
2017-04-22 17:37:04 +00:00
bors 9cc77d7690 Auto merge of #41464 - frewsxcv:rollup, r=frewsxcv
Rollup of 3 pull requests

- Successful merges: #41077, #41355, #41450
- Failed merges:
2017-04-22 14:17:36 +00:00
Corey Farwell e282817186 Rollup merge of #41355 - nikomatsakis:incr-comp-refactor-trans-2, r=eddyb
Refactor trans some more to pave way for incremental compilation

Various refactorings paving the way for the newer approach to incremental compilation (And, in particular, to "query-ifying" trans). My partial goal is to remove `SharedCrateContext`; this PR gets about as far as I can easily get before starting to really want the red/green algorithm.

r? @eddyb
cc @michaelwoerister
2017-04-22 09:02:57 -04:00
Corey Farwell 5e1351b17b Rollup merge of #41077 - petrochenkov:boundparen, r=nikomatsakis
syntax: Support parentheses around trait bounds

An implementation for https://github.com/rust-lang/rust/issues/39318#issuecomment-290956826

r? @nikomatsakis
2017-04-22 09:02:56 -04:00
Guillaume Gomez 9c97882055 Fix line display 2017-04-22 14:56:36 +02:00
bors 6d841da4a0 Auto merge of #39999 - bitshifter:struct_align, r=eddyb
Implementation of repr struct alignment RFC 1358.

The main changes around rustc::ty::Layout::struct:
* Added abi_align field which stores abi alignment before repr align is applied
* align field contains transitive repr alignment
* Added padding vec which stores padding required after fields

The main user of this information is rustc_trans::adt::struct_llfields
which determines the LLVM fields to be used by LLVM, including padding
fields.

A possible future optimisation would be to put the padding Vec in an Option, since it will be unused unless you are using repr align.
2017-04-22 11:50:40 +00:00
Guillaume Gomez 91fb6bc1eb Fix tests 2017-04-22 13:25:14 +02:00
Guillaume Gomez d79b511f5c Fix invalid linkage 2017-04-22 13:25:14 +02:00
Guillaume Gomez 295f25b198 Set hoedown to generate error index 2017-04-22 13:25:14 +02:00
Guillaume Gomez 80a2a94d5a Re-enable hoedown by default 2017-04-22 13:25:14 +02:00
Corey Farwell df72158d47 Rollup merge of #41435 - estebank:issue-33884, r=nikomatsakis
Add test for issue 33884

Fix #33884.

r=nikomatsakis
2017-04-21 23:29:15 -04:00
Corey Farwell 48a9d5f6d3 Rollup merge of #41432 - abonander:issue_41211, r=jseyfried
Don't panic if an attribute macro fails to resolve at crate root

Adds temporary regression test; this ideally should work as-is (#41430)

Closes #41211

r? @jseyfried
2017-04-21 23:29:15 -04:00
Corey Farwell aff40e2de3 Rollup merge of #41405 - GuillaumeGomez:rustdoc-warning-improvement, r=steveklabnik
Fix line display for hoedown

Fixes #41401.

r? @rust-lang/docs
2017-04-21 23:29:14 -04:00
Corey Farwell 5da19f2b69 Rollup merge of #37658 - GuillaumeGomez:ref_suggestion, r=nikomatsakis,eddyb
Ref suggestion
2017-04-21 23:29:13 -04:00
Jessica Hamilton e1afddc29c Haiku: fix initial platform support 2017-04-22 13:47:36 +12:00
Niko Matsakis 6d86f81eb1 move the uses of the trans caches into rustc::traits
This makes these routines more readily available for other bits of
code. It also will help when refactoring.
2017-04-21 21:02:14 -04:00
Cameron Hart 946f8e6a59 Use primitive align for tagged enum fill.
Hopefully will fix assert on ARM where vector types are being used as
the fill type for enums containing repr aligned types greater than the
largest possible native type, thus don't match the Layout's alignment
and triggers an assert.
2017-04-22 09:38:23 +10:00
Niko Matsakis 85527456e8 use Symbol/InternedString in the cache 2017-04-21 17:26:53 -04:00
Niko Matsakis f4c183b742 move the trans trait caches into tcx
Arguably these could become custom queries, but I chose not to do that
because the relationship of queries and trait system is not yet fleshed
out enough. For now it seems fine to have them be `DepTrackingMap` using
the memoize pattern.
2017-04-21 17:26:53 -04:00
Niko Matsakis e48a759f51 sort `provide` 2017-04-21 17:26:53 -04:00
Niko Matsakis 264f237f98 make `reachable_set` ref-counted
Once it is computed, no need to deep clone the set.
2017-04-21 17:26:53 -04:00
Niko Matsakis c446cb086b just take `tcx` where we can
The more we can things dependent on just tcx, the easier it will
be to make queries etc later on.
2017-04-21 17:26:53 -04:00
Niko Matsakis 39a58c38a0 introduce the rather simpler symbol-cache in place of symbol-map
The symbol map is not good for incremental: it has inputs from every fn
in existence, and it will change if anything changes. One could imagine
cheating with the symbol-map and exempting it from the usual dependency
tracking, since the results are fully deterministic. Instead, I opted to
just add a per-CGU cache, on the premise that recomputing some symbol
names is not going to be so very expensive.
2017-04-21 17:26:53 -04:00
Niko Matsakis 4c31750cd9 remove `translation_items` from `SharedCrateContext`
If we are going to hash `SharedCrateContext`, we don't want a list of
things that pertain to **every CGU** in there.
2017-04-21 17:26:53 -04:00
Niko Matsakis 8289e5a73e introduce `is_foreign_item` query
This may seem like overkill, but it's exactly what we want/need for
incremental compilation I think. In particular, while generating code
for some codegen unit X, we can wind up querying about any number of
external items, and we only want to be forced to rebuild X is some of
those changed from a foreign item to otherwise. Factoring this into a
query means we would re-run only if some `false` became `true` (or vice
versa).
2017-04-21 17:26:53 -04:00
Guillaume Gomez 7ce1eb77c7 Update ui test 2017-04-21 22:58:15 +02:00
Vadim Petrochenkov 8838cd10f2 Move parse_remaining_bounds into a separate function 2017-04-21 21:32:44 +03:00
Vadim Petrochenkov 6e75def7db Fix issue with single question mark or paren 2017-04-21 21:32:44 +03:00
Vadim Petrochenkov e038f58105 syntax: Support parentheses around trait bounds 2017-04-21 21:32:44 +03:00
bors 1785bca513 Auto merge of #41445 - frewsxcv:rollup, r=frewsxcv
Rollup of 4 pull requests

- Successful merges: #41372, #41376, #41426, #41429
- Failed merges:
2017-04-21 16:36:41 +00:00
Guillaume Gomez 7d3284ebc1 Create a new method to run coercion inside probe 2017-04-21 16:13:26 +02:00
bors 5695c3e943 Auto merge of #41349 - eddyb:ty-contents, r=nikomatsakis
rustc: replace TypeContents with two independent properties (is_freeze / needs_drop).

`InteriorUnsafe` / `interior_unsafe` was replaced with a private lang-item `Freeze` auto trait in libcore.

`OwnsDtor` / `needs_drop` was replaced with a specialized traversal that *doesn't* avoid caching results in case of a cycle, as the only cycles left can only occur in erroneous "types with infinite sizes", references and raw pointers not having destructors. Also, `Copy` is now checked at every step of the recursion.

r? @nikomatsakis
2017-04-21 14:02:37 +00:00
Eduard-Mihai Burtescu 89bd3f39ca Update #[no_core] users with the "freeze" lang item. 2017-04-21 15:48:35 +03:00
Corey Farwell d5bbeb1a0a Rollup merge of #41426 - malbarbo:android-x86_64, r=alexcrichton
Add x86_64-linux-android target
2017-04-21 08:40:35 -04:00
Corey Farwell d983256f36 Rollup merge of #41376 - mbrubeck:docs, r=frewsxcv
Expanded docs and examples for PathBuf::file_name and friends

This addresses some common surprises when `PathBuf::set_file_name` is called on the path of a directory rather than a file.

r? @steveklabnik
2017-04-21 08:40:34 -04:00
Corey Farwell cf11d3c66a Rollup merge of #41372 - nbigaouette:master, r=alexcrichton
Use an (over-writable) environment variable for the `gdb` command

Instead of hard-coding the command to run, using the environment
variable `GDB_CMD` (that defaults to `gdb`) allows using a different
debugger than the default `gdb` executable.

This gives the possibility to use `cgdb` as the debugger, which provides
a nicer user interface. Note that one has to use `GDB_CMD="cgdb --"` to
use cgdb (note the trailing `--`) to let cgdb pass the proper arguments
to `gdb`.
2017-04-21 08:40:33 -04:00
Guillaume Gomez 8fe3a9a8f1 Update tests 2017-04-21 12:28:24 +02:00
Guillaume Gomez d360091e79 Add suggestion for & coercions 2017-04-21 12:28:24 +02:00
Tobias Bucher c49d0906da 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-21 10:32:13 +02:00
bors 4ed95009d8 Auto merge of #41245 - estebank:multiline-trim, r=nikomatsakis
Reduce visual clutter of multiline start when possible

When a span starts on a line with nothing but whitespace to the left,
and there are no other annotations in that line, simplify the visual
representation of the span.

Go from:

```rust
error[E0072]: recursive type `A` has infinite size
 --> file2.rs:1:1
  |
1 |   struct A {
  |  _^ starting here...
2 | |     a: A,
3 | | }
  | |_^ ...ending here: recursive type has infinite size
  |
```

To:

```rust
error[E0072]: recursive type `A` has infinite size
 --> file2.rs:1:1
  |
1 | / struct A {
2 | |     a: A,
3 | | }
  | |_^ recursive type has infinite size
```

Re: #38246.

r? @nikomatsakis CC @jonathandturner
2017-04-21 06:59:25 +00:00
Josh Stone c1aaa60d8d Remove float_extras
[unstable, deprecated since 1.11.0]
2017-04-20 21:16:31 -07:00
Josh Stone c903ac64e5 Remove num::{Zero,One}
[unstable, deprecated since 1.11.0]
2017-04-20 21:16:31 -07:00
Josh Stone 313aab8fbe Remove RefCell::borrow_state
[unstable, deprecated since 1.15.0]
2017-04-20 21:16:31 -07:00
Josh Stone cc605c895e Remove {Cell,RefCell}::as_unsafe_cell
[unstable, deprecated since 1.12.0]
2017-04-20 21:16:31 -07:00
Josh Stone f0c5e8b8fc Privatize Rc::is_unique
[unstable, deprecated since 1.15.0]
2017-04-20 21:16:31 -07:00
Josh Stone f4aaae9bdb Remove Rc::would_wrap
[unstable, deprecated since 1.15.0]
2017-04-20 21:16:31 -07:00
Josh Stone df86cecdd2 Remove OccupiedEntry::remove_pair
[unstable, deprecated since 1.12.0]
2017-04-20 21:16:31 -07:00
Josh Stone a724ff90e7 Remove BinaryHeap::{push_pop,replace}
[unstable, deprecated since 1.13.0]
2017-04-20 21:16:31 -07:00