]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agorollup merge of #20268: mdinger/pretty
Alex Crichton [Tue, 30 Dec 2014 00:36:34 +0000 (16:36 -0800)]
rollup merge of #20268: mdinger/pretty

For consistency with the documentation, *options* should be before *filenames*.

9 years agorollup merge of #20266: nick29581/dxr-use
Alex Crichton [Tue, 30 Dec 2014 00:36:32 +0000 (16:36 -0800)]
rollup merge of #20266: nick29581/dxr-use

r? @huonw

9 years agorollup merge of #20265: nicholasbishop/bishop_add_missing_bitflags_methods
Alex Crichton [Tue, 30 Dec 2014 00:36:30 +0000 (16:36 -0800)]
rollup merge of #20265: nicholasbishop/bishop_add_missing_bitflags_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.

9 years agorollup merge of #20264: nagisa/threadrng
Alex Crichton [Tue, 30 Dec 2014 00:36:29 +0000 (16:36 -0800)]
rollup merge of #20264: nagisa/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!

This is a breaking change. If a breaking change for consistency is not desired, feel free to close.

9 years agorollup merge of #20263: crhino/lifetime-elision-help
Alex Crichton [Tue, 30 Dec 2014 00:36:27 +0000 (16:36 -0800)]
rollup merge of #20263: crhino/lifetime-elision-help

Fixes #19707.

In terms of output, it currently uses the form `argument #1`, `argument #2`, etc. If anyone has any better suggestions I would be glad to consider them.

9 years agorollup merge of #20262: arturoc/fix-scoped_thread_local
Alex Crichton [Tue, 30 Dec 2014 00:36:25 +0000 (16:36 -0800)]
rollup merge of #20262: arturoc/fix-scoped_thread_local

was missing a couple of semicolons and applications using it failed to compile

9 years agorollup merge of #20252: huonw/doc-no-ignore
Alex Crichton [Tue, 30 Dec 2014 00:36:24 +0000 (16:36 -0800)]
rollup merge of #20252: huonw/doc-no-ignore

9 years agorollup merge of #20250: ipetkov/deriving
Alex Crichton [Tue, 30 Dec 2014 00:36:22 +0000 (16:36 -0800)]
rollup merge of #20250: ipetkov/deriving

* Both enums already derived `Copy`, but storing them in any
  struct/container would prevent implementing `Clone` for said
  struct/container even though they should be clonable.
* Also add PartialEq and Eq for good measure.

9 years agorollup merge of #20248: steveklabnik/gh20038
Alex Crichton [Tue, 30 Dec 2014 00:36:20 +0000 (16:36 -0800)]
rollup merge of #20248: steveklabnik/gh20038

A part of #20038

This is just the beginning of what needs to be done, but it's some of it.

/cc @aturon

9 years agorollup merge of #20245: fhahn/make-lexer-tests-runable-again
Alex Crichton [Tue, 30 Dec 2014 00:36:18 +0000 (16:36 -0800)]
rollup merge of #20245: fhahn/make-lexer-tests-runable-again

I would like to look into some issues related to the model lexer  #15883.

I stumbled upon 2 minor problems when I tried running the lexer tests:

* antlr did not put the generated files in the correct directory
* grammer/verify.rs did not work with the most recent version of rust

With these changes (and setting CLASSPATH=/usr/share/java/antlr-4.4-complete.jar:$CLASSPATH) I was able to execute the tests.

Note that I just fixed the syntax errors and added `None` as 2. argument of `Literal`. I am not sure if this is correct however. I still have to take a closer look at what verify.rs actually does. Are there any helpful pointers?

9 years agorollup merge of #20243: bombless/patch-1
Alex Crichton [Tue, 30 Dec 2014 00:36:17 +0000 (16:36 -0800)]
rollup merge of #20243: bombless/patch-1

9 years agorollup merge of #20242: sanxiyn/break-from-fn
Alex Crichton [Tue, 30 Dec 2014 00:36:15 +0000 (16:36 -0800)]
rollup merge of #20242: sanxiyn/break-from-fn

Fix #19331.

9 years agorollup merge of #20239: YawarRaza7349/patch-1
Alex Crichton [Tue, 30 Dec 2014 00:36:14 +0000 (16:36 -0800)]
rollup merge of #20239: YawarRaza7349/patch-1

9 years agorollup merge of #20231: fhahn/issue-20226-eexist
Alex Crichton [Tue, 30 Dec 2014 00:36:12 +0000 (16:36 -0800)]
rollup merge of #20231: fhahn/issue-20226-eexist

I've created a patch for #20226, which maps `EEXIST` to the `PathAlreadyExists` error on Unix. To test this, I use `mkdir`, which raises `EEXIST` if the directory already exists.

On Windows, I map `ERROR_ALREADY_EXISTS` to `PathAlreadyExist`, but I am note sure if `mkdir` on Windows raises `ERROR_ALREADY_EXISTS` and do not have a Windows installation handy for testing.

And I noticed another thing. No error seems to map to `IoErrorKind::PathDoesntExist` and I am wondering what the difference to `FileNotFound` is?

9 years agorollup merge of #20230: bheesham/noshard
Alex Crichton [Tue, 30 Dec 2014 00:36:11 +0000 (16:36 -0800)]
rollup merge of #20230: bheesham/noshard

I forgot to do this in my previous PR. This should close #19145 .

9 years agorollup merge of #20223: aochagavia/typo
Alex Crichton [Tue, 30 Dec 2014 00:36:09 +0000 (16:36 -0800)]
rollup merge of #20223: aochagavia/typo

9 years agorollup merge of #20216: sfackler/fix-mangling
Alex Crichton [Tue, 30 Dec 2014 00:36:07 +0000 (16:36 -0800)]
rollup merge of #20216: sfackler/fix-mangling

Closes #20209

r? @alexcrichton

9 years agorollup merge of #20215: csouth3/hashmap-rename
Alex Crichton [Tue, 30 Dec 2014 00:36:06 +0000 (16:36 -0800)]
rollup merge of #20215: csouth3/hashmap-rename

Rename struct `Entries` to `Iter` in hash/table.rs and hash/map.rs, to match the naming convention of rust-lang/rfcs#344.

This is a [breaking-change].

9 years agorollup merge of #20214: bluss/fix-hashmap-example
Alex Crichton [Tue, 30 Dec 2014 00:36:05 +0000 (16:36 -0800)]
rollup merge of #20214: bluss/fix-hashmap-example

The example derived Hash + Eq on a type that was used as *values* for
a hashmap.. for the example to make sense, we have to use a custom *key*
type.

Write a slightly more involved example, still using Vikings, but this
time as key.

I preferred using String over &str here, since that's the typical usage
and we might want to lead users down that path.

9 years agorollup merge of #20210: tshepang/patch-5
Alex Crichton [Tue, 30 Dec 2014 00:36:04 +0000 (16:36 -0800)]
rollup merge of #20210: tshepang/patch-5

9 years agorollup merge of #20207: jroesch/issue-18906-testcase
Alex Crichton [Tue, 30 Dec 2014 00:36:03 +0000 (16:36 -0800)]
rollup merge of #20207: jroesch/issue-18906-testcase

Closes issue #18906. This is what we talked about last night/early this morning. r? @nikomatsakis.

9 years agorollup merge of #20205: tshepang/patch-4
Alex Crichton [Tue, 30 Dec 2014 00:36:01 +0000 (16:36 -0800)]
rollup merge of #20205: tshepang/patch-4

The paragraph following this removed one has the same info, only better.

9 years agorollup merge of #20195: nagisa/unused-typo
Alex Crichton [Tue, 30 Dec 2014 00:36:00 +0000 (16:36 -0800)]
rollup merge of #20195: nagisa/unused-typo

9 years agorollup merge of #20194: nick29581/dst-syntax
Alex Crichton [Tue, 30 Dec 2014 00:35:59 +0000 (16:35 -0800)]
rollup merge of #20194: nick29581/dst-syntax

Part of #19607.

r? @nikomatsakis

9 years agorollup merge of #20191: lifthrasiir/double-debug_assert
Alex Crichton [Tue, 30 Dec 2014 00:35:57 +0000 (16:35 -0800)]
rollup merge of #20191: lifthrasiir/double-debug_assert

Yes, really. That definition wouldn't work anyway.

This also fixes repeated entries for `debug_assert!` from libcore docs. Maybe we should warn such macro definitions in the first place?

9 years agorollup merge of #20182: brianloveswords/patch-2
Alex Crichton [Tue, 30 Dec 2014 00:35:56 +0000 (16:35 -0800)]
rollup merge of #20182: brianloveswords/patch-2

Treemap should be BTreeMap

9 years agorollup merge of #20165: tamird/needstest-tests
Alex Crichton [Tue, 30 Dec 2014 00:35:54 +0000 (16:35 -0800)]
rollup merge of #20165: tamird/needstest-tests

@alexcrichton @jakub-

9 years agorollup merge of #20160: nick29581/ranges2
Alex Crichton [Tue, 30 Dec 2014 00:35:53 +0000 (16:35 -0800)]
rollup merge of #20160: nick29581/ranges2

The first six commits are from an earlier PR (#19858) and have already been reviewed. This PR makes an awful hack in the compiler to accommodate slices both natively and in the index a range form. After a snapshot we can hopefully add the new Index impls and then we can remove these awful hacks.

r? @nikomatsakis (or anyone who knows the compiler, really)

9 years agorollup merge of #20042: alexcrichton/second-pass-ptr
Alex Crichton [Tue, 30 Dec 2014 00:35:51 +0000 (16:35 -0800)]
rollup merge of #20042: alexcrichton/second-pass-ptr

This commit performs a second pass for stabilization over the `std::ptr` module.
The specific actions taken were:

* The `RawPtr` trait was renamed to `PtrExt`
* The `RawMutPtr` trait was renamed to `PtrMutExt`
* The module name `ptr` is now stable.
* These functions were all marked `#[stable]` with no modification:
  * `null`
  * `null_mut`
  * `swap`
  * `replace`
  * `read`
  * `write`
  * `PtrExt::is_null`
  * `PtrExt::is_not_null`
  * `PtrExt::offset`
* These functions remain unstable:
  * `as_ref`, `as_mut` - the return value of an `Option` is not fully expressive
                         as null isn't the only bad value, and it's unclear
                         whether we want to commit to these functions at this
                         time. The reference/lifetime semantics as written are
                         also problematic in how they encourage arbitrary
                         lifetimes.
  * `zero_memory` - This function is currently not used at all in the
                    distribution, and in general it plays a broader role in the
                    "working with unsafe pointers" story. This story is not yet
                    fully developed, so at this time the function remains
                    unstable for now.
  * `read_and_zero` - This function remains unstable for largely the same
                      reasons as `zero_memory`.
* These functions are now all deprecated:
  * `PtrExt::null` - call `ptr::null` or `ptr::null_mut` instead.
  * `PtrExt::to_uint` - use an `as` expression instead.

9 years agorollup merge of #19661: alexcrichton/mutex-result
Alex Crichton [Tue, 30 Dec 2014 00:35:50 +0000 (16:35 -0800)]
rollup merge of #19661: alexcrichton/mutex-result

All of the current std::sync primitives have poisoning enable which means that
when a task fails inside of a write-access lock then all future attempts to
acquire the lock will fail. This strategy ensures that stale data whose
invariants are possibly not upheld are never viewed by other tasks to help
propagate unexpected panics (bugs in a program) among tasks.

Currently there is no way to test whether a mutex or rwlock is poisoned. One
method would be to duplicate all the methods with a sister foo_catch function,
for example. This pattern is, however, against our [error guidelines][errors].
As a result, this commit exposes the fact that a task has failed internally
through the return value of a `Result`.

[errors]: https://github.com/rust-lang/rfcs/blob/master/text/0236-error-conventions.md#do-not-provide-both-result-and-fail-variants

All methods now return a `LockResult<T>` or a `TryLockResult<T>` which
communicates whether the lock was poisoned or not. In a `LockResult`, both the
`Ok` and `Err` variants contains the `MutexGuard<T>` that is being returned in
order to allow access to the data if poisoning is not desired. This also means
that the lock is *always* held upon returning from `.lock()`.

A new type, `PoisonError`, was added with one method `into_guard` which can
consume the assertion that a lock is poisoned to gain access to the underlying
data.

This is a breaking change because the signatures of these methods have changed,
often incompatible ways. One major difference is that the `wait` methods on a
condition variable now consume the guard and return it in as a `LockResult` to
indicate whether the lock was poisoned while waiting. Most code can be updated
by calling `.unwrap()` on the return value of `.lock()`.

[breaking-change]

9 years agorollup merge of #19457: reem/remove-is-lang-item
Alex Crichton [Tue, 30 Dec 2014 00:35:49 +0000 (16:35 -0800)]
rollup merge of #19457: reem/remove-is-lang-item

Removes a FIXME on closed issue #15064. This flag is no
longer needed or used since reflection is gone.

9 years agoRebasing and reviewer changes
Nick Cameron [Tue, 23 Dec 2014 03:23:11 +0000 (16:23 +1300)]
Rebasing and reviewer changes

9 years agoFallout from mut slices
Nick Cameron [Thu, 18 Dec 2014 23:44:24 +0000 (12:44 +1300)]
Fallout from mut slices

9 years agoRemove ExprSlice by hacking the compiler
Nick Cameron [Thu, 18 Dec 2014 22:47:48 +0000 (11:47 +1300)]
Remove ExprSlice by hacking the compiler

[breaking-change]

The `mut` in slices is now redundant. Mutability is 'inferred' from position. This means that if mutability is only obvious from the type, you will need to use explicit calls to the slicing methods.

9 years agoAdd hypothetical support for ranges with only an upper bound
Nick Cameron [Thu, 18 Dec 2014 04:55:04 +0000 (17:55 +1300)]
Add hypothetical support for ranges with only an upper bound

Note that this doesn't add the surface syntax.

9 years agostd: Second pass stabilization for `ptr`
Alex Crichton [Fri, 19 Dec 2014 16:57:12 +0000 (08:57 -0800)]
std: Second pass stabilization for `ptr`

This commit performs a second pass for stabilization over the `std::ptr` module.
The specific actions taken were:

* The `RawPtr` trait was renamed to `PtrExt`
* The `RawMutPtr` trait was renamed to `MutPtrExt`
* The module name `ptr` is now stable.
* These functions were all marked `#[stable]` with no modification:
  * `null`
  * `null_mut`
  * `swap`
  * `replace`
  * `read`
  * `write`
  * `PtrExt::is_null`
  * `PtrExt::offset`
* These functions remain unstable:
  * `as_ref`, `as_mut` - the return value of an `Option` is not fully expressive
                         as null isn't the only bad value, and it's unclear
                         whether we want to commit to these functions at this
                         time. The reference/lifetime semantics as written are
                         also problematic in how they encourage arbitrary
                         lifetimes.
  * `zero_memory` - This function is currently not used at all in the
                    distribution, and in general it plays a broader role in the
                    "working with unsafe pointers" story. This story is not yet
                    fully developed, so at this time the function remains
                    unstable for now.
  * `read_and_zero` - This function remains unstable for largely the same
                      reasons as `zero_memory`.
* These functions are now all deprecated:
  * `PtrExt::null` - call `ptr::null` or `ptr::null_mut` instead.
  * `PtrExt::to_uint` - use an `as` expression instead.
  * `PtrExt::is_not_null` - use `!p.is_null()` instead.

9 years agostd: Stabilization pass for mutex/rwlock/condvar
Alex Crichton [Mon, 29 Dec 2014 18:01:38 +0000 (10:01 -0800)]
std: Stabilization pass for mutex/rwlock/condvar

This commit performs a stabilization pass over the sync::{mutex, rwlock,
condvar} modules, marking the following items as stable:

* Mutex
* Mutex::new
* Mutex::lock
* Mutex::try_lock
* MutexGuard
* RWLock
* RWLock::new
* RWLock::read
* RWLock::try_read
* RWLock::write
* RWLock::try_write
* RWLockReadGuard
* RWLockWriteGuard
* Condvar
* Condvar::new
* Condvar::wait
* Condvar::notify_one
* Condvar::notify_all
* PoisonError
* TryLockError
* TryLockError::Poisoned
* TryLockError::WouldBlock
* LockResult
* TryLockResult

The following items remain unstable to explore future possibilities of unifying
the static/non-static variants of the types:

* StaticMutex
* StaticMutex::new
* StaticMutex::lock
* StaticMutex::try_lock
* StaticMutex::desroy
* StaticRWLock
* StaticRWLock::new
* StaticRWLock::read
* StaticRWLock::try_read
* StaticRWLock::write
* StaticRWLock::try_write
* StaticRWLock::destroy

The following items were removed in favor of `Guard<'static, ()>` instead.

* StaticMutexGuard
* StaticRWLockReadGuard
* StaticRWLockWriteGuard

9 years agoauto merge of #20101 : alexcrichton/rust/issue-20096, r=aturon
bors [Mon, 29 Dec 2014 20:19:53 +0000 (20:19 +0000)]
auto merge of #20101 : alexcrichton/rust/issue-20096, r=aturon

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

9 years agoUpdate grammer/verify.rs to work with recent master
Florian Hahn [Fri, 26 Dec 2014 19:49:36 +0000 (20:49 +0100)]
Update grammer/verify.rs to work with recent master

9 years agoFix output directory for generated antlr code
Florian Hahn [Fri, 26 Dec 2014 19:49:20 +0000 (20:49 +0100)]
Fix output directory for generated antlr code

9 years agoauto merge of #20058 : Kimundi/rust/str_pattern_pre, r=alexcrichton
bors [Mon, 29 Dec 2014 18:02:30 +0000 (18:02 +0000)]
auto merge of #20058 : Kimundi/rust/str_pattern_pre, r=alexcrichton

This stabilizes most methods on `&str` working with patterns in a way that is forwards-compatible with a generic string pattern matching API:
- Methods that are using the primary name for their operation are marked as `#[stable]`, as they can be upgraded to a full `Pattern` API later without existing code breaking. Example: `contains(&str)`
- Methods that are using a more specific name in order to not clash with the primary one are marked as `#[unstable]`, as they will likely be removed once their functionality is merged into the primary one. Example: `contains_char<C: CharEq>(C)`
- The method docs got changed to consistently refer to the pattern types as a pattern.
- Methods whose names do not match in the context of the more generic API got renamed. Example: `trim_chars -> trim_matches`

Additionally, all methods returning iterators got changed to return unique new types with changed names in accordance with the new naming guidelines.

See also https://github.com/rust-lang/rfcs/pull/528

Due to some deprecations and type changes, this is a

[breaking-change]

9 years agostd: Return Result from RWLock/Mutex methods
Alex Crichton [Tue, 9 Dec 2014 04:20:03 +0000 (20:20 -0800)]
std: Return Result from RWLock/Mutex methods

All of the current std::sync primitives have poisoning enable which means that
when a task fails inside of a write-access lock then all future attempts to
acquire the lock will fail. This strategy ensures that stale data whose
invariants are possibly not upheld are never viewed by other tasks to help
propagate unexpected panics (bugs in a program) among tasks.

Currently there is no way to test whether a mutex or rwlock is poisoned. One
method would be to duplicate all the methods with a sister foo_catch function,
for example. This pattern is, however, against our [error guidelines][errors].
As a result, this commit exposes the fact that a task has failed internally
through the return value of a `Result`.

[errors]: https://github.com/rust-lang/rfcs/blob/master/text/0236-error-conventions.md#do-not-provide-both-result-and-fail-variants

All methods now return a `LockResult<T>` or a `TryLockResult<T>` which
communicates whether the lock was poisoned or not. In a `LockResult`, both the
`Ok` and `Err` variants contains the `MutexGuard<T>` that is being returned in
order to allow access to the data if poisoning is not desired. This also means
that the lock is *always* held upon returning from `.lock()`.

A new type, `PoisonError`, was added with one method `into_guard` which can
consume the assertion that a lock is poisoned to gain access to the underlying
data.

This is a breaking change because the signatures of these methods have changed,
often incompatible ways. One major difference is that the `wait` methods on a
condition variable now consume the guard and return it in as a `LockResult` to
indicate whether the lock was poisoned while waiting. Most code can be updated
by calling `.unwrap()` on the return value of `.lock()`.

[breaking-change]

9 years agoauto merge of #19549 : huonw/rust/middle-ty-2, r=nikomatsakis
bors [Mon, 29 Dec 2014 13:32:19 +0000 (13:32 +0000)]
auto merge of #19549 : huonw/rust/middle-ty-2, r=nikomatsakis

This takes building `librustc/lib.rs` from using 696 MB to 588 (`rustc --no-trans`), and 1.99 GB to 1.87 (`rustc -O`). It also reduces `sty` down to 32 bytes on platforms with 64-bit pointers, at the expense of some more side-tables in `ctxt`. I'm sure there's more gains to be had from reducing the size of the side tables (e.g. by making the actual things they're storing smaller).

r? @nikomatsakis

9 years agoMore rebase fixes.
Huon Wilson [Fri, 26 Dec 2014 11:33:56 +0000 (22:33 +1100)]
More rebase fixes.

9 years agoUpdate rustc_driver tests.
Huon Wilson [Fri, 26 Dec 2014 06:52:57 +0000 (17:52 +1100)]
Update rustc_driver tests.

9 years agoRebase fixes.
Huon Wilson [Fri, 12 Dec 2014 04:01:28 +0000 (21:01 -0700)]
Rebase fixes.

I've totally mangled the history with these rebases; sorry, future programmer!

9 years agoAdd the -Z print-enum-sizes flag for displaying enum info.
Huon Wilson [Fri, 5 Dec 2014 19:49:07 +0000 (11:49 -0800)]
Add the -Z print-enum-sizes flag for displaying enum info.

This replaces required the RUST_LOG=... invocation to make it much more
user friendly.

9 years agoFix rebase artifacts.
Huon Wilson [Fri, 5 Dec 2014 19:48:50 +0000 (11:48 -0800)]
Fix rebase artifacts.

9 years agoSlash the ast::Stmt type from 104 to 24 bytes.
Huon Wilson [Fri, 5 Dec 2014 09:10:22 +0000 (01:10 -0800)]
Slash the ast::Stmt type from 104 to 24 bytes.

(on platforms with 64-bit pointers.)

The StmtMac variant is rather large and also fairly rare, so let's
optimise the common case.

9 years agoPrint info from the barefn and region interners in the tcx.
Huon Wilson [Fri, 5 Dec 2014 05:46:17 +0000 (21:46 -0800)]
Print info from the barefn and region interners in the tcx.

9 years agoIntern Region in tcx.
Huon Wilson [Fri, 5 Dec 2014 00:52:57 +0000 (16:52 -0800)]
Intern Region in tcx.

This makes sty only 32 bytes on machines with 64-bit pointers.

9 years agoCollect tcx arenas into a single struct.
Huon Wilson [Fri, 5 Dec 2014 00:25:29 +0000 (16:25 -0800)]
Collect tcx arenas into a single struct.

This allows expanding how many arenas exist without users having to
care, since they are all created with CtxtArena::new().

9 years agoIntern BareFnTys to make sty slightly smaller.
Huon Wilson [Thu, 4 Dec 2014 22:52:20 +0000 (14:52 -0800)]
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.

9 years agoSwitch Region information from uint to u32.
Huon Wilson [Thu, 4 Dec 2014 20:06:42 +0000 (12:06 -0800)]
Switch Region information from uint to u32.

This reduces memory use for building librustc with -O from 1.88 to 1.76
GB.

9 years agoIntern substs before storing them in the tcx.
Huon Wilson [Thu, 4 Dec 2014 06:20:51 +0000 (22:20 -0800)]
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).

9 years agoStore Substs in an arena in the tcx.
Huon Wilson [Thu, 4 Dec 2014 00:01:29 +0000 (16:01 -0800)]
Store Substs in an arena in the tcx.

This current inflates memory use more than 3 times.

9 years agoImplement debug printing for tcx interner sty's.
Huon Wilson [Thu, 4 Dec 2014 00:04:17 +0000 (16:04 -0800)]
Implement debug printing for tcx interner sty's.

9 years agoauto merge of #19765 : luqmana/rust/nonzero-lang-item, r=nikomatsakis
bors [Mon, 29 Dec 2014 08:06:20 +0000 (08:06 +0000)]
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.

9 years agoMarked find and rfind as stable
Marvin Löbel [Mon, 29 Dec 2014 07:54:51 +0000 (08:54 +0100)]
Marked find and rfind as stable

9 years agoauto merge of #19227 : johshoff/rust/master, r=brson
bors [Mon, 29 Dec 2014 05:22:26 +0000 (05:22 +0000)]
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.

9 years agolibcollections: impl Send/Sync for Vec.
Luqman Aden [Sun, 28 Dec 2014 19:36:45 +0000 (14:36 -0500)]
libcollections: impl Send/Sync for Vec.

9 years agolibcoretest: Add tests for NonZero.
Luqman Aden [Tue, 23 Dec 2014 20:52:02 +0000 (15:52 -0500)]
libcoretest: Add tests for NonZero.

9 years agolibcore: Use Zeroable trait to try to limit what types may be used with NonZero.
Luqman Aden [Mon, 22 Dec 2014 03:43:36 +0000 (22:43 -0500)]
libcore: Use Zeroable trait to try to limit what types may be used with NonZero.

9 years agolibrustc_trans: Get rid of unnecessary allocation in finding discriminant field.
Luqman Aden [Mon, 22 Dec 2014 03:21:53 +0000 (22:21 -0500)]
librustc_trans: Get rid of unnecessary allocation in finding discriminant field.

9 years agolibcore: Don't impl RawPtr* traits for NonZero.
Luqman Aden [Mon, 22 Dec 2014 02:40:20 +0000 (21:40 -0500)]
libcore: Don't impl RawPtr* traits for NonZero.

9 years agoDon't expose NonZero through libstd.
Luqman Aden [Fri, 12 Dec 2014 03:29:24 +0000 (22:29 -0500)]
Don't expose NonZero through libstd.

9 years agoAdd tests for NonZero.
Luqman Aden [Fri, 5 Dec 2014 19:52:38 +0000 (14:52 -0500)]
Add tests for NonZero.

9 years agolibcore: Make it unsafe to create NonZero and impl Deref.
Luqman Aden [Thu, 4 Dec 2014 19:58:21 +0000 (14:58 -0500)]
libcore: Make it unsafe to create NonZero and impl Deref.

9 years agoliballoc: Use NonZero in Arc.
Luqman Aden [Thu, 4 Dec 2014 18:29:47 +0000 (13:29 -0500)]
liballoc: Use NonZero in Arc.

9 years agoliballoc: Use NonZero in Rc.
Luqman Aden [Thu, 4 Dec 2014 17:59:28 +0000 (12:59 -0500)]
liballoc: Use NonZero in Rc.

9 years agolibcollections: Use NonZero in Vec.
Luqman Aden [Wed, 3 Dec 2014 22:22:11 +0000 (17:22 -0500)]
libcollections: Use NonZero in Vec.

9 years agolibcore: Add NonZero lang item and implement some methods.
Luqman Aden [Wed, 3 Dec 2014 22:21:51 +0000 (17:21 -0500)]
libcore: Add NonZero lang item and implement some methods.

9 years agolibrustc: Add NonZero lang item and use it if possible for nullable pointer enum...
Luqman Aden [Thu, 4 Dec 2014 21:56:57 +0000 (16:56 -0500)]
librustc: Add NonZero lang item and use it if possible for nullable pointer enum opt.

9 years agoAdd tests.
Luqman Aden [Fri, 5 Dec 2014 19:41:28 +0000 (14:41 -0500)]
Add tests.

9 years agolibrustc: Try looking in fixed sized arrays for nullable enum opt.
Luqman Aden [Thu, 4 Dec 2014 21:56:26 +0000 (16:56 -0500)]
librustc: Try looking in fixed sized arrays for nullable enum opt.

9 years agolibrustc: Try looking in tuple fields for nullable enum opt.
Luqman Aden [Thu, 4 Dec 2014 21:55:56 +0000 (16:55 -0500)]
librustc: Try looking in tuple fields for nullable enum opt.

9 years agolibrustc: Traverse arbitrarily deep for nullable enum opt.
Luqman Aden [Thu, 4 Dec 2014 21:44:51 +0000 (16:44 -0500)]
librustc: Traverse arbitrarily deep for nullable enum opt.

9 years agoMake lifetime elision help more useful on type signatures.
crhino [Wed, 24 Dec 2014 07:57:35 +0000 (02:57 -0500)]
Make lifetime elision help more useful on type signatures.

Fixes #19707.

9 years agosrc/libstd/thread_local/scoped.rs: fixes scoped_thread_local! macro
arturo [Sat, 27 Dec 2014 20:08:47 +0000 (21:08 +0100)]
src/libstd/thread_local/scoped.rs: fixes scoped_thread_local! macro

was missing a ;

9 years agoRegression test for #17740
Tamir Duberstein [Tue, 23 Dec 2014 05:20:31 +0000 (21:20 -0800)]
Regression test for #17740

Closes #17740.

9 years agoRegression test for #17728
Tamir Duberstein [Tue, 23 Dec 2014 05:20:31 +0000 (21:20 -0800)]
Regression test for #17728

Closes #17728.

9 years agoRegression test for #16538
Tamir Duberstein [Tue, 23 Dec 2014 05:20:31 +0000 (21:20 -0800)]
Regression test for #16538

Closes #16538.

9 years agomk: Stop generating docs for deprecated crates
Alex Crichton [Sun, 21 Dec 2014 07:29:59 +0000 (23:29 -0800)]
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

9 years agoRegression test for #15034
Tamir Duberstein [Tue, 23 Dec 2014 05:20:31 +0000 (21:20 -0800)]
Regression test for #15034

Closes #15034.

9 years agoRegression test for #14227
Tamir Duberstein [Tue, 23 Dec 2014 05:20:31 +0000 (21:20 -0800)]
Regression test for #14227

Closes #14227.

9 years agoRegression test for #14386
Tamir Duberstein [Tue, 23 Dec 2014 05:20:31 +0000 (21:20 -0800)]
Regression test for #14386

Closes #14386.

9 years agoRegression tests for #13853
Tamir Duberstein [Tue, 23 Dec 2014 05:20:31 +0000 (21:20 -0800)]
Regression tests for #13853

Closes #13853, #14889.

9 years agoRegression test for #13808
Tamir Duberstein [Tue, 23 Dec 2014 05:20:31 +0000 (21:20 -0800)]
Regression test for #13808

Closes #13808.

9 years agoRegression test for #13665
Tamir Duberstein [Tue, 23 Dec 2014 05:20:31 +0000 (21:20 -0800)]
Regression test for #13665

Closes #13665.

9 years agoRegression test for #13655
Tamir Duberstein [Tue, 23 Dec 2014 05:09:40 +0000 (21:09 -0800)]
Regression test for #13655

Closes #13655.

9 years agoRegression test for simple case of #9197
Tamir Duberstein [Tue, 23 Dec 2014 04:21:43 +0000 (20:21 -0800)]
Regression test for simple case of #9197

9 years agoRegression test for #8874
Tamir Duberstein [Tue, 23 Dec 2014 04:15:43 +0000 (20:15 -0800)]
Regression test for #8874

Closes #8874.

9 years agoUpdate test for #5543
Tamir Duberstein [Tue, 23 Dec 2014 02:45:18 +0000 (18:45 -0800)]
Update test for #5543

Closes #5543.

9 years agoRegression test for #3902
Tamir Duberstein [Mon, 22 Dec 2014 20:38:04 +0000 (12:38 -0800)]
Regression test for #3902

Closes #3902.

9 years agoauto merge of #20185 : csouth3/rust/dlist-deprecate, r=alexcrichton
bors [Sun, 28 Dec 2014 16:21:58 +0000 (16:21 +0000)]
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.

9 years agoSplit overly long line
Johannes Hoff [Sun, 28 Dec 2014 11:59:19 +0000 (12:59 +0100)]
Split overly long line

9 years agoRename TaskRng to ThreadRng
Simonas Kazlauskas [Sun, 28 Dec 2014 00:20:47 +0000 (02:20 +0200)]
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]

9 years agoauto merge of #20136 : eddyb/rust/format-args, r=alexcrichton
bors [Sun, 28 Dec 2014 03:11:48 +0000 (03:11 +0000)]
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.

9 years ago`man rustc` and `rustc --help` say options go first
mdinger [Sun, 28 Dec 2014 03:07:56 +0000 (22:07 -0500)]
`man rustc` and `rustc --help` say options go first

9 years agosave-analysis: fix spans for paths to struct variants
Nick Cameron [Sun, 28 Dec 2014 01:37:08 +0000 (14:37 +1300)]
save-analysis: fix spans for paths to struct variants