Commit Graph

35861 Commits

Author SHA1 Message Date
Huon Wilson
ce3c949115 Intern BareFnTys to make sty slightly smaller.
This cuts the ty_bare_fn variant to 48 bytes rather than 56. There
doesn't seem to be a noticable memory usage decrease from this.
2014-12-29 23:55:24 +11:00
Huon Wilson
a33a7d20de Switch Region information from uint to u32.
This reduces memory use for building librustc with -O from 1.88 to 1.76
GB.
2014-12-29 23:55:24 +11:00
Huon Wilson
a548f8917b Intern substs before storing them in the tcx.
This cuts memory use dramatically from the previous commit, and reduces
use overall. E.g. the memory usage of `rustc -O librustc/lib.rs` seems
to drop 100MB from 1.98GB to 1.88GB (on one run anyway).
2014-12-29 23:55:24 +11:00
Huon Wilson
4f2b0f032a Store Substs in an arena in the tcx.
This current inflates memory use more than 3 times.
2014-12-29 23:55:24 +11:00
Huon Wilson
7cd6bf67a2 Implement debug printing for tcx interner sty's. 2014-12-29 23:55:24 +11:00
bors
25fb12b8a5 auto merge of #19765 : luqmana/rust/nonzero-lang-item, r=nikomatsakis
This extends the nullable enum opt to traverse beyond just the first level to find possible fields to use as the discriminant. So now, it'll work through structs, tuples, and fixed sized arrays. This also introduces a new lang item, NonZero, that you can use to wrap raw pointers or integral types to indicate to rustc that the underlying value is known to never be 0/NULL. We then use this in Vec, Rc and Arc to have them also benefit from the nullable enum opt.

As per https://github.com/rust-lang/rfcs/pull/499 NonZero is not exposed via the `libstd` facade.

```
x86_64 Linux:
                        T       Option<T> (Before)      Option<T> (After)
----------------------------------------------------------------------------------
Vec<int>                24          32                      24
String                  24          32                      24
Rc<int>                 8           16                      8
Arc<int>                8           16                      8
[Box<int>, ..2]         16          24                      16
(String, uint)          32          40                      32
```

Fixes #19419.
Fixes #13194.
Fixes #9378.
Fixes #7576.
2014-12-29 08:06:20 +00:00
Marvin Löbel
c1f3acaa64 Marked find and rfind as stable 2014-12-29 08:54:51 +01:00
bors
03a1188cf3 auto merge of #19227 : johshoff/rust/master, r=brson
Using the current directory may not always be appropriate, for example in
the case where it will unnecessarily trigger a backup to be made.

The only risk with this change is that systems might not have a mktemp.
I am not aware of such a system, but have not tested on Windows. It is
working on a basic Ubuntu and OS X installation.
2014-12-29 05:22:26 +00:00
Luqman Aden
766a71922f libcollections: impl Send/Sync for Vec. 2014-12-28 19:40:48 -05:00
Luqman Aden
0e039ada55 libcoretest: Add tests for NonZero. 2014-12-28 19:40:48 -05:00
Luqman Aden
94f1261573 libcore: Use Zeroable trait to try to limit what types may be used with NonZero. 2014-12-28 19:40:48 -05:00
Luqman Aden
27617a10f6 librustc_trans: Get rid of unnecessary allocation in finding discriminant field. 2014-12-28 19:40:48 -05:00
Luqman Aden
c15df8e68f libcore: Don't impl RawPtr* traits for NonZero. 2014-12-28 19:40:48 -05:00
Luqman Aden
b44d7cb89c Don't expose NonZero through libstd. 2014-12-28 19:40:48 -05:00
Luqman Aden
e83272b628 Add tests for NonZero. 2014-12-28 19:40:48 -05:00
Luqman Aden
466135bfef libcore: Make it unsafe to create NonZero and impl Deref. 2014-12-28 19:40:48 -05:00
Luqman Aden
4af50548b9 liballoc: Use NonZero in Arc. 2014-12-28 19:40:47 -05:00
Luqman Aden
0d48f76224 liballoc: Use NonZero in Rc. 2014-12-28 19:40:47 -05:00
Luqman Aden
bb44737748 libcollections: Use NonZero in Vec. 2014-12-28 19:40:47 -05:00
Luqman Aden
ef5da14edb libcore: Add NonZero lang item and implement some methods. 2014-12-28 19:40:47 -05:00
Luqman Aden
46e7376489 librustc: Add NonZero lang item and use it if possible for nullable pointer enum opt. 2014-12-28 19:40:47 -05:00
Luqman Aden
6d91419f27 Add tests. 2014-12-28 19:40:47 -05:00
Luqman Aden
5fb1e6b1e2 librustc: Try looking in fixed sized arrays for nullable enum opt. 2014-12-28 19:40:47 -05:00
Luqman Aden
e6b6234e66 librustc: Try looking in tuple fields for nullable enum opt. 2014-12-28 19:40:47 -05:00
Luqman Aden
e954fc4385 librustc: Traverse arbitrarily deep for nullable enum opt. 2014-12-28 19:40:46 -05:00
crhino
ba177596d3 Make lifetime elision help more useful on type signatures.
Fixes #19707.
2014-12-28 16:26:00 -08:00
arturo
a4549972f2 src/libstd/thread_local/scoped.rs: fixes scoped_thread_local! macro
was missing a ;
2014-12-28 19:43:04 +01:00
Tamir Duberstein
252423f8b7 Regression test for #17740
Closes #17740.
2014-12-28 09:43:57 -08:00
Tamir Duberstein
2d100212a9 Regression test for #17728
Closes #17728.
2014-12-28 09:43:57 -08:00
Tamir Duberstein
01cdf00c2f Regression test for #16538
Closes #16538.
2014-12-28 09:43:54 -08:00
Alex Crichton
48048419b1 mk: Stop generating docs for deprecated crates
These crates are all deprecated for their rust-lang/$crate equivalents and by
generating docs we're generating broken links. The documentation for these
crates are generated out-of-tree and are managed separately, so we're not losing
the documentation altogether, just the links from the main distribution's docs.

Closes #20096
2014-12-28 09:34:38 -08:00
Tamir Duberstein
d1438f50cf Regression test for #15034
Closes #15034.
2014-12-28 09:22:54 -08:00
Tamir Duberstein
b745a4f944 Regression test for #14227
Closes #14227.
2014-12-28 09:22:54 -08:00
Tamir Duberstein
1fd491c3b4 Regression test for #14386
Closes #14386.
2014-12-28 09:22:53 -08:00
Tamir Duberstein
9cd7864147 Regression tests for #13853
Closes #13853, #14889.
2014-12-28 09:22:53 -08:00
Tamir Duberstein
7a758d188a Regression test for #13808
Closes #13808.
2014-12-28 09:22:53 -08:00
Tamir Duberstein
885d7de975 Regression test for #13665
Closes #13665.
2014-12-28 09:22:53 -08:00
Tamir Duberstein
0579d5846b Regression test for #13655
Closes #13655.
2014-12-28 09:22:53 -08:00
Tamir Duberstein
ee6b97d5af Regression test for simple case of #9197 2014-12-28 09:22:52 -08:00
Tamir Duberstein
dd8fdff4fb Regression test for #8874
Closes #8874.
2014-12-28 09:22:52 -08:00
Tamir Duberstein
5e9a2ab846 Update test for #5543
Closes #5543.
2014-12-28 09:22:52 -08:00
Tamir Duberstein
37250679bc Regression test for #3902
Closes #3902.
2014-12-28 09:22:52 -08:00
bors
6366631721 auto merge of #20185 : csouth3/rust/dlist-deprecate, r=alexcrichton
This PR deprecates the `DList::ListInsertion` trait, in accordance with rust-lang/rfcs#509.  The functions which were previously part of the ListInsertion impl for `DList::IterMut` have been moved to be inherent methods on the iterator itself, and appropriate doctests have been added.
2014-12-28 16:21:58 +00:00
Johannes Hoff
0e2b5d99af Split overly long line 2014-12-28 12:59:19 +01:00
Simonas Kazlauskas
1e89bbcb67 Rename TaskRng to ThreadRng
Since runtime is removed, rust has no tasks anymore and everything is moving
from being task-* to thread-*. Let’s rename TaskRng as well!

* Rename TaskRng to ThreadRng
* Rename task_rng to thread_rng

[breaking-change]
2014-12-28 13:46:35 +02:00
bors
3e6b29f8ad auto merge of #20136 : eddyb/rust/format-args, r=alexcrichton
We have the technology: no longer do you need to write closures to use `format_args!`.
This is a `[breaking-change]`, as it forces you to clean up old hacks - if you had code like this:
```rust
format_args!(fmt::format, "{} {} {}", a, b, c)
format_args!(|args| { w.write_fmt(args) }, "{} {} {}", x, y, z)
```
change it to this: 
```rust
fmt::format(format_args!("{} {} {}", a, b, c))
w.write_fmt(format_args!("{} {} {}", x, y, z))
```
To allow them to be called with `format_args!(...)` directly, several functions were modified to
take `fmt::Arguments` by value instead of by reference. Also, `fmt::Arguments` derives `Copy`
now in order to preserve all usecases that were previously possible.
2014-12-28 03:11:48 +00:00
Nicholas Bishop
ad39c0a8a1 Update docstring for bitflags macro to cover all generated methods
The methods `from_bits` and `from_bits_truncate` were missing from the
list of generated methods. Didn't see a useful way to abbreviate, so
added with the same docstrings used in the macro definition.
2014-12-27 20:13:32 -05:00
Eduard Burtescu
647e54d6d1 Fallout of changing format_args!(f, args) to f(format_args!(args)). 2014-12-27 23:57:43 +02:00
Eduard Burtescu
fc3f22bf25 syntax: change format_args! to produce fmt::Arguments instead of calling a function with them. 2014-12-27 23:55:14 +02:00
Eduard Burtescu
3961adcaf0 syntax: use std::string::String unqualified in format. 2014-12-27 23:55:14 +02:00