Commit Graph

63485 Commits

Author SHA1 Message Date
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
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
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
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
Matt Ickstadt feae5a08a2 Add Splice forget test 2017-04-24 09:49:29 -05: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
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
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
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
bors 2bd4b5c6db Auto merge of #41485 - arielb1:dtorck-constraint, r=eddyb
cache dtorck constraints on ADTs

This avoids visiting the fields of all structs multiple times, improving item-bodies checking time by 10% (!).

Not sure whether we want this in 1.18 or 1.19. It's a big-ish patch, but the 10% win is very tempting.

r? @eddyb
2017-04-23 20:11: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 67560f6fae FIN: switch appveryor to mingw with posix threads 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 5bd4e27db2 FIN: update appveyor mingw description 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
bors 23de823e93 Auto merge of #41408 - eddyb:poly-const-eval, r=arielb1
rustc: generalize monomorphic_const_eval to polymorphic constants.

With the addition of `Substs` to the query key, we can now evaluate *and cache* polymorphic constants.

Fixes #23898 by replacing the crippled explicit-discriminant-only local-crate-only `lookup_variant_by_id` with `ConstVal::Variant` which can describe variants irrespective of their discriminant.

Fixes #41394 by fixing #23898 (for the original testcase) and by not looping past the first discriminant.
2017-04-23 08:35:00 +00: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