Commit Graph

56156 Commits

Author SHA1 Message Date
Corey Farwell
0c9ff54139 Migrate ItemType::from_type_kind to convert::From. 2016-08-24 23:25:26 -07:00
Corey Farwell
30397aee0d Migrate ItemType::from_item to convert::From. 2016-08-24 23:25:26 -07:00
Corey Farwell
7dc411667a Migrate Context::maybe_ignore_item method to standalone function.
The method wasn't using any `self` data from Context, so it seemed
miseading to implement it as a method.
2016-08-24 23:25:26 -07:00
Corey Farwell
28ecfb691d Move ItemEnum → Generics logic into method on ItemEnum. 2016-08-24 23:25:26 -07:00
bors
012f45eaf7 Auto merge of #35854 - nikomatsakis:incr-comp-cache-hash-35549, r=mw
compute and cache HIR hashes at beginning

This avoids the compile-time overhead of computing them twice.  It also fixes
an issue where the hash computed after typeck is differen than the hash before,
because typeck mutates the def-map in place.

Fixes #35549.
Fixes #35593.

Some performance measurements suggest this `HashesMap` is very small in memory (unobservable via `-Z time-passes`) and very cheap to construct. I do see some (very minor) performance wins in the incremental case after the first run -- the first run costs more because loading the dep-graph didn't have any hashing to do in that case. Example timings from two runs  of `libsyntex-syntax` -- the (1) indicates first run, (2) indicates second run, and (*) indicates both together:

| Phase | Master | Branch |
| ---- | ---- | ---- |
| compute_hashes_map (1) | N/A | 0.343 |
| load_dep_graph (1) | 0 | 0 |
| serialize dep graph (1) | 4.190 | 3.920 |
| total (1) | 4.190 | 4.260 |
| compute_hashes_map (2) | N/A | 0.344 |
| load_dep_graph (2) | 0.592 | 0.252 |
| serialize dep graph (2) | 4.119 | 3.779 |
| total (2) | 4.71 | 4.375 |
| total (*) | 8.9 | 8.635 |

r? @michaelwoerister
2016-08-23 11:53:17 -07:00
Niko Matsakis
1cc7c9010c fix stray comment 2016-08-23 13:29:28 -04:00
Niko Matsakis
c21fa64dbb pacify the mercilous tidy 2016-08-23 13:28:55 -04:00
Niko Matsakis
ea2d90e903 consider DepNode::Krate to be an input
This seems not only more correct but allows us to write tests that check
whether the krate hash as a whole is clean/dirty
2016-08-23 11:57:27 -04:00
bors
0bd99f9d5c Auto merge of #35656 - Stebalien:fused, r=alexcrichton
Implement 1581 (FusedIterator)

* [ ] Implement on patterns. See https://github.com/rust-lang/rust/issues/27721#issuecomment-239638642.
* [ ] Handle OS Iterators. A bunch of iterators (`Args`, `Env`, etc.) in libstd wrap platform specific iterators. The current ones all appear to be well-behaved but can we assume that future ones will be?
* [ ] Does someone want to audit this? On first glance, all of the iterators on which I implemented `FusedIterator` appear to be well-behaved but there are a *lot* of them so a second pair of eyes would be nice.
* I haven't touched rustc internal iterators (or the internal rand) because rustc doesn't actually call `fuse()`.
* `FusedIterator` can't be implemented on `std::io::{Bytes, Chars}`.

Closes: #35602 (Tracking Issue)
Implements: rust-lang/rfcs#1581
2016-08-23 07:46:52 -07:00
Niko Matsakis
c42e0a3451 make svh independent of item ordering 2016-08-23 10:42:46 -04:00
Niko Matsakis
f923083308 cache def-path hashes across all items
This seems like approx a 2x win on syntex_syntax.
2016-08-23 10:33:56 -04:00
Niko Matsakis
484da37845 rename HashesMap to IncrementalHashesMap 2016-08-23 07:47:14 -04:00
Niko Matsakis
226e1e5ded add regression test for #35593
Fixes #35593
2016-08-23 07:40:53 -04:00
bors
43204fff5d Auto merge of #35627 - apasel422:coerce-cell, r=alexcrichton
Implement `CoerceUnsized` for `{Cell, RefCell, UnsafeCell}`

These impls are analogous to the one for `NonZero`. It's occasionally useful to be able to coerce the cell types when they're being used inside another abstraction. See Manishearth/rust-gc#17 for an example.

r? @eddyb
2016-08-23 04:16:28 -07:00
bors
599f1b96b1 Auto merge of #35766 - brson:bump, r=alexcrichton
Upgrade bootstrap compiler to 1.12

r? @alexcrichton
2016-08-22 20:51:54 -07:00
Brian Anderson
144cc7285f Update cargo bootstrap rev and add fix for cargo#3005 2016-08-23 00:05:33 +00:00
bors
d0da7f6af9 Auto merge of #35908 - jonathandturner:rollup, r=jonathandturner
Rollup of 20 pull requests

- Successful merges: #35360, #35526, #35809, #35817, #35820, #35824, #35835, #35841, #35842, #35858, #35860, #35861, #35864, #35878, #35879, #35881, #35882, #35889, #35891, #35901
- Failed merges: #35395
2016-08-22 16:59:28 -07:00
Jonathan Turner
8ea2936659 Rollup merge of #35901 - terrynsun:configs, r=steveklabnik
Add sublime-rust to CONFIGS.md.

Just noticed it was missing!

r? @steveklabnik
2016-08-22 15:34:23 -07:00
Jonathan Turner
d5deb118f9 Rollup merge of #35891 - munyari:book, r=steveklabnik
Add reference to `Self` in traits chapter (book)

Addresses #31891

"r? @steveklabnik
2016-08-22 15:34:22 -07:00
Jonathan Turner
766b04ec5e Rollup merge of #35889 - alevy:patch-1, r=GuillaumeGomez
Minor type in CONTRIBUTING.md

A single missing article
2016-08-22 15:34:22 -07:00
Jonathan Turner
252f3c5a1a Rollup merge of #35882 - petrochenkov:patch-2, r=eddyb
rustc: Fix outdated comment

cc https://github.com/rust-lang/rust/issues/35870#issuecomment-241282692

r? @eddyb
2016-08-22 15:34:22 -07:00
Jonathan Turner
375695c956 Rollup merge of #35881 - matthew-piziak:rc-would-unwrap-example, r=GuillaumeGomez
add example for `Rc::would_unwrap`

Part of #29372

r? @steveklabnik
2016-08-22 15:34:22 -07:00
Jonathan Turner
b560f5a7bc Rollup merge of #35879 - CryZe:patch-2, r=apasel422
Fix "Furthermore" Typo in String Docs

It used to say "Furtheremore" instead of "Furthermore".
2016-08-22 15:34:22 -07:00
Jonathan Turner
19f30d3f86 Rollup merge of #35878 - matthew-piziak:ptr-assertions, r=GuillaumeGomez
replace `println!` statements with `assert!`ions in `std::ptr` examples

r? @steveklabnik
2016-08-22 15:34:21 -07:00
Jonathan Turner
36b8322a8c Rollup merge of #35864 - matthew-piziak:index-example, r=GuillaumeGomez
replace `Index` example with something more evocative of indexing

r? @steveklabnik
2016-08-22 15:34:21 -07:00
Jonathan Turner
61f62ec595 Rollup merge of #35861 - matthew-piziak:rem-example, r=GuillaumeGomez
replace `Rem` example with something more evocative

r? @steveklabnik
2016-08-22 15:34:21 -07:00
Jonathan Turner
21c3287478 Rollup merge of #35860 - matthew-piziak:mul-example, r=GuillaumeGomez
replace `Mul` example with something more evocative of multiplication

I may have gone a bit overboard on this one. Numbers are fun.
2016-08-22 15:34:21 -07:00
Jonathan Turner
0c84ac124a Rollup merge of #35858 - shyaamsundhar:patch-1, r=GuillaumeGomez
E0435, E0437 & E0438 New Error Format

Part of #35801 , #35802 and #35803
r? @GuillaumeGomez

Hi! Please review the changes.
2016-08-22 15:34:21 -07:00
Jonathan Turner
7c2fba6d4d Rollup merge of #35842 - apasel422:typo, r=GuillaumeGomez
Fix typos in unix/rwlock.rs

r? @steveklabnik
2016-08-22 15:34:20 -07:00
Jonathan Turner
cc51d1c21d Rollup merge of #35841 - kyrias:new-error-E0424, r=GuillaumeGomez
Update E0424 to the new error format

Fixes #35797.
Part of #35233.

r? @GuillaumeGomez
2016-08-22 15:34:20 -07:00
Jonathan Turner
ae83225afc Rollup merge of #35835 - crypto-universe:E0426, r=jonathandturner
New format for E0426

Issue #35799 as a part of issue #35233
r? jonathandturner
2016-08-22 15:34:20 -07:00
Jonathan Turner
025c5e7311 Rollup merge of #35824 - GuillaumeGomez:err_codes, r=jonathandturner
Err codes

r? @jonathandturner
2016-08-22 15:34:19 -07:00
Jonathan Turner
5523db8f2e Rollup merge of #35820 - knight42:update-error-msg, r=jonathandturner
Updated E0054, E0423 & E0432 to new error format

Fixes #35791, #35796 and #35344, as part of #35233

r? @jonathandturner
2016-08-22 15:34:19 -07:00
Jonathan Turner
40f40e6cd9 Rollup merge of #35817 - wesleywiser:fix_35703, r=jonathandturner
Update E0503 to the new format

Fixes #35703
Part of #35233

r? @jonathandturner
2016-08-22 15:34:19 -07:00
Jonathan Turner
b6950492c2 Rollup merge of #35809 - matthew-piziak:bitwise-and-example, r=GuillaumeGomez
replace `BitAnd` example with something more evocative of bitwise AND
2016-08-22 15:34:19 -07:00
Jonathan Turner
f46438c71a Rollup merge of #35526 - munyari:e0033, r=jonathandturner
Update E0033 to the new error format

Part of #35233

Addresses #35498
"r? @jonathandturner
2016-08-22 15:34:19 -07:00
Jonathan Turner
ab734210f0 Rollup merge of #35360 - medzin:E0388, r=jonathandturner
Updated error message E0388

Fixes #35339 as part of #35233.

r? @GuillaumeGomez
2016-08-22 15:34:18 -07:00
Adam Medziński
bfbdff0e2d Updated error message E0388 2016-08-22 23:22:40 +02:00
Matthew Piziak
9f88f8ae48 replace BitAnd example with something more evocative of bitwise AND
reformat method chain according to ubsan Rustic Style Guide

https://ubsan.github.io/style/
2016-08-22 17:04:18 -04:00
Matthew Piziak
38f0bca865 replace Mul example with something more evocative of multiplication
I may have gone a bit overboard on this one. Numbers are fun.

tone down the error message
2016-08-22 16:50:46 -04:00
Panashe M. Fundira
3da5f9327a
Correct failing book test 2016-08-22 12:10:02 -04:00
bors
3c5a0fa45b Auto merge of #35871 - bluss:cstring-new, r=alexcrichton
cstring: avoid excessive growth just to 0-terminate

Based on following what happens in CString::new("string literal"):

1. Using `Into<Vec<u8>>`, a Vec is allocated with capacity exactly equal
   to the string's input length.
2. By `v.push(0)`, the Vec is grown to twice capacity, since it was full.
3. By `v.into_boxed_slice()`, the Vec capacity is shrunk to fit the length again.

If we use `.reserve_exact(1)` just before the push, then we avoid the
capacity doubling that we're going to have to shrink anyway.

Growing by just 1 byte means that the step (2) is less likely to have to
move the memory to a larger allocation chunk, and that the step (3) does
not have to reallocate.

Addresses part of #35838
2016-08-22 08:29:41 -07:00
ggomez
cdb4af848b Remove E0455 test (for now) 2016-08-22 14:53:28 +02:00
bors
57a1f684cd Auto merge of #35848 - Mark-Simulacrum:make-tidy-in-tree, r=alexcrichton
Check that executable file is in-tree before failing tidy check

I silenced stdout and stderr for ls-files, not sure if that's appropriate (is `make tidy` intended to give debugging information)? Otherwise it prints each file it find to stdout/stderr, which currently prints nothing (only executable files are checked).

I have not done major testing regarding the behavior of ls-files when the file is ignored, but judging by the man page everything should be fine.

I've duplicated the code which makes the path git-friendly from the `Cargo.lock` checking code; I can extract that into a common helper if wanted (it's only two lines).

Fixes #35689.
2016-08-22 05:39:53 -07:00
Knight
8fdc531446 Updated E0423 to new format 2016-08-22 13:57:37 +08:00
Knight
a4c6307a15 Updated E0432 to new format 2016-08-22 13:57:10 +08:00
Knight
820c810107 Updated E0054 to new format 2016-08-22 13:51:21 +08:00
bors
c44534ef5a Auto merge of #35821 - nbaksalyar:solaris-trans-fix, r=alexcrichton
Fix linker on Solaris/Illumos

This patch provides a fix for the `GnuLinker::export_symbols` function that currently relies on a `--retain-symbols-file` option which is not supported by the Solaris & Illumos linker.

Instead, a [version script](https://www.gnu.org/software/gnulib/manual/html_node/LD-Version-Scripts.html) is used on this platform to achieve the same goal. Here's an example of a similar approach in LLVM's CMake script: https://github.com/llvm-mirror/llvm/blob/master/cmake/modules/AddLLVM.cmake#L88-L94.

Perhaps other platforms like OpenBSD could benefit from this as well. /cc @semarie
2016-08-21 22:30:46 -07:00
Terry Sun
1d78f9eb89 Add sublime-rust to CONFIGS.md. 2016-08-22 01:24:01 -04:00
Panashe M. Fundira
a5a5c1074e
Add reference to Self in traits chapter (book) 2016-08-21 23:45:26 -04:00