]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoPrint a friendly error for the if-let construct without an else block
Barosl Lee [Fri, 19 Dec 2014 16:42:21 +0000 (01:42 +0900)]
Print a friendly error for the if-let construct without an else block

Fixes #19991.

9 years agoauto merge of #19463 : kali/rust/master, r=alexcrichton
bors [Fri, 19 Dec 2014 20:22:17 +0000 (20:22 +0000)]
auto merge of #19463 : kali/rust/master, r=alexcrichton

parse_ty() no longer takes a boolean parameter. quote_ty! implementation has not yet been modified accordingly.

As a matter of fact, quote_ty! was not covered by tests. One test (called qquotes) references it, but it has been ignored for nearly one year and now need heavy refactoring.

quote_token.rs seemed like a good place to test quote_ty!, many other quote_*! macros were asserted there.

9 years agoauto merge of #19867 : japaric/rust/deriving-copy, r=acrichto
bors [Fri, 19 Dec 2014 16:02:31 +0000 (16:02 +0000)]
auto merge of #19867 : japaric/rust/deriving-copy, r=acrichto

r? @alexcrichton

9 years agowindows: remove unused import
Jorge Aparicio [Fri, 19 Dec 2014 13:09:11 +0000 (08:09 -0500)]
windows: remove unused import

9 years agolibtime: use `#[deriving(Copy)]`
Jorge Aparicio [Mon, 15 Dec 2014 04:34:36 +0000 (23:34 -0500)]
libtime: use `#[deriving(Copy)]`

9 years agolibtest: use `#[deriving(Copy)]`
Jorge Aparicio [Mon, 15 Dec 2014 04:34:08 +0000 (23:34 -0500)]
libtest: use `#[deriving(Copy)]`

9 years agolibterm: use `#[deriving(Copy)]`
Jorge Aparicio [Mon, 15 Dec 2014 04:33:35 +0000 (23:33 -0500)]
libterm: use `#[deriving(Copy)]`

9 years agolibsyntax: use `#[deriving(Copy)]`
Jorge Aparicio [Mon, 15 Dec 2014 04:32:24 +0000 (23:32 -0500)]
libsyntax: use `#[deriving(Copy)]`

9 years agolibstd: use `#[deriving(Copy)]`
Jorge Aparicio [Mon, 15 Dec 2014 04:24:36 +0000 (23:24 -0500)]
libstd: use `#[deriving(Copy)]`

9 years agolibserialize: use `#[deriving(Copy)]`
Jorge Aparicio [Mon, 15 Dec 2014 04:20:43 +0000 (23:20 -0500)]
libserialize: use `#[deriving(Copy)]`

9 years agolibrustrt: use `#[deriving(Copy)]`
Jorge Aparicio [Mon, 15 Dec 2014 04:19:48 +0000 (23:19 -0500)]
librustrt: use `#[deriving(Copy)]`

9 years agolibrustdoc: use `#[deriving(Copy)]`
Jorge Aparicio [Mon, 15 Dec 2014 04:17:42 +0000 (23:17 -0500)]
librustdoc: use `#[deriving(Copy)]`

9 years agolibrustc_typeck: use `#[deriving(Copy)]`
Jorge Aparicio [Mon, 15 Dec 2014 04:16:06 +0000 (23:16 -0500)]
librustc_typeck: use `#[deriving(Copy)]`

9 years agolibrustc_trans: use `#[deriving(Copy)]`
Jorge Aparicio [Mon, 15 Dec 2014 04:14:38 +0000 (23:14 -0500)]
librustc_trans: use `#[deriving(Copy)]`

9 years agolibrustc_llvm: use `#[deriving(Copy)]`
Jorge Aparicio [Mon, 15 Dec 2014 04:09:35 +0000 (23:09 -0500)]
librustc_llvm: use `#[deriving(Copy)]`

9 years agolibrustc_driver: use `#[deriving(Copy)]`
Jorge Aparicio [Mon, 15 Dec 2014 04:07:14 +0000 (23:07 -0500)]
librustc_driver: use `#[deriving(Copy)]`

9 years agolibrustc_borrowck: use `#[deriving(Copy)]`
Jorge Aparicio [Mon, 15 Dec 2014 04:06:50 +0000 (23:06 -0500)]
librustc_borrowck: use `#[deriving(Copy)]`

9 years agolibrustc: use `#[deriving(Copy)]`
Jorge Aparicio [Mon, 15 Dec 2014 04:03:34 +0000 (23:03 -0500)]
librustc: use `#[deriving(Copy)]`

9 years agolibregex: use `#[deriving(Copy)]`
Jorge Aparicio [Mon, 15 Dec 2014 03:46:59 +0000 (22:46 -0500)]
libregex: use `#[deriving(Copy)]`

9 years agolibrbml: use `#[deriving(Copy)]`
Jorge Aparicio [Mon, 15 Dec 2014 03:46:05 +0000 (22:46 -0500)]
librbml: use `#[deriving(Copy)]`

9 years agolibrand: use `#[deriving(Copy)]`
Jorge Aparicio [Mon, 15 Dec 2014 03:45:18 +0000 (22:45 -0500)]
librand: use `#[deriving(Copy)]`

9 years agoliblog: use `#[deriving(Copy)]`
Jorge Aparicio [Mon, 15 Dec 2014 03:43:43 +0000 (22:43 -0500)]
liblog: use `#[deriving(Copy)]`

9 years agolibgetopts: use `#[deriving(Copy)]`
Jorge Aparicio [Mon, 15 Dec 2014 03:37:29 +0000 (22:37 -0500)]
libgetopts: use `#[deriving(Copy)]`

9 years agolibfmt_macros: use `#[deriving(Copy)]`
Jorge Aparicio [Mon, 15 Dec 2014 03:36:39 +0000 (22:36 -0500)]
libfmt_macros: use `#[deriving(Copy)]`

9 years agolibcore: use `#[deriving(Copy)]`
Jorge Aparicio [Mon, 15 Dec 2014 03:35:22 +0000 (22:35 -0500)]
libcore: use `#[deriving(Copy)]`

9 years agolibcollections: use `#[deriving(Copy)]`
Jorge Aparicio [Mon, 15 Dec 2014 03:26:17 +0000 (22:26 -0500)]
libcollections: use `#[deriving(Copy)]`

9 years agoack parser.parse_ty change in quote_ty! (+ test)
Mathieu Poumeyrol [Tue, 2 Dec 2014 16:10:07 +0000 (17:10 +0100)]
ack parser.parse_ty change in quote_ty! (+ test)

9 years agoauto merge of #19884 : nikomatsakis/rust/issue-19730-perfect-forwarding, r=pnkfelix
bors [Fri, 19 Dec 2014 13:22:10 +0000 (13:22 +0000)]
auto merge of #19884 : nikomatsakis/rust/issue-19730-perfect-forwarding, r=pnkfelix

Rewrite how the HRTB algorithm matches impls against obligations. Instead of impls providing higher-ranked trait-references, impls now once again only have early-bound regions. The skolemization checks are thus moved out into trait matching itself. This allows to implement "perfect forwarding" impls like those described in #19730. This PR builds on a previous PR that was already reviewed by @pnkfelix.

r? @pnkfelix

Fixes #19730

9 years agoThree random test cases that seem to produce more errors now. I've
Niko Matsakis [Fri, 19 Dec 2014 03:17:16 +0000 (22:17 -0500)]
Three random test cases that seem to produce more errors now.  I've
not dug deeply into what is going on here, although the errors ARE
somewhat surprising.

9 years agoModify the `Bytes` type so that it remains cloneable even
Niko Matsakis [Fri, 19 Dec 2014 03:16:48 +0000 (22:16 -0500)]
Modify the `Bytes` type so that it remains cloneable even
though it includes a `fn()`. This is really a more general
problem but I wanted to ensures that `bytes` in particular
remains working due to #12677.

9 years agoCorrect comment on Binder.
Niko Matsakis [Thu, 18 Dec 2014 15:13:13 +0000 (10:13 -0500)]
Correct comment on Binder.

9 years agoKill some warnings about shadowed lifetimes
Niko Matsakis [Tue, 16 Dec 2014 22:34:47 +0000 (17:34 -0500)]
Kill some warnings about shadowed lifetimes

9 years agoWork around #19982 by rewriting test impls to not use anonymous
Niko Matsakis [Tue, 16 Dec 2014 01:20:15 +0000 (20:20 -0500)]
Work around #19982 by rewriting test impls to not use anonymous
lifetimes. This currently causes an ICE; it should (ideally) work, but
failing that at least give a structured error. For the purposes of
this PR, though, workaround is fine.

9 years agoDocument new algorithm at a high-level.
Niko Matsakis [Mon, 15 Dec 2014 16:40:11 +0000 (11:40 -0500)]
Document new algorithm at a high-level.

9 years agoRemove text on method matching, which is now out of date.
Niko Matsakis [Mon, 15 Dec 2014 10:45:14 +0000 (05:45 -0500)]
Remove text on method matching, which is now out of date.

9 years agoConvert gigantic comment away from `//!` form. It is annoying to
Niko Matsakis [Mon, 15 Dec 2014 10:44:59 +0000 (05:44 -0500)]
Convert gigantic comment away from `//!` form. It is annoying to
read (`//!` is intrusive) and annoying to edit (must maintain a prefix
on every line). Since the only purpose of a `doc.rs` file is to have a
bunch of text, using `/*!` and `*/` without indentations seems
appropriate.

9 years agoImplement "perfect forwarding" for HR impls (#19730).
Niko Matsakis [Sun, 14 Dec 2014 12:17:23 +0000 (07:17 -0500)]
Implement "perfect forwarding" for HR impls (#19730).

9 years agoMake all predicates higher-ranked, not just trait references.
Niko Matsakis [Sat, 13 Dec 2014 10:34:34 +0000 (05:34 -0500)]
Make all predicates higher-ranked, not just trait references.

9 years agoMove `leak_check` into its own method, and ensure that all higher-ranked code is in
Niko Matsakis [Fri, 12 Dec 2014 19:55:07 +0000 (14:55 -0500)]
Move `leak_check` into its own method, and ensure that all higher-ranked code is in
`higher_ranked.rs`.

9 years agoCentralize on using `Binder` to introduce new binding levels, rather than having...
Niko Matsakis [Fri, 12 Dec 2014 16:28:35 +0000 (11:28 -0500)]
Centralize on using `Binder` to introduce new binding levels, rather than having FnSig carry an implicit binding level.  This means that we be more typesafe in general, since things that instantiate bound regions can drop the Binder to reflect that.

9 years agoAdd (currently unused) helper routine for skolemizing bound regions.
Niko Matsakis [Fri, 12 Dec 2014 11:37:42 +0000 (06:37 -0500)]
Add (currently unused) helper routine for skolemizing bound regions.

9 years agoRename the code that replaces unbound variables to "freshen" rather than "skolemize...
Niko Matsakis [Fri, 12 Dec 2014 11:13:42 +0000 (06:13 -0500)]
Rename the code that replaces unbound variables to "freshen" rather than "skolemize" -- strictly speaking, this is not skolemization, because it is not discharging quantifiers. Also, the trait selection code will still be doing true skolemization, so it would be a confusing overlap of names.

9 years agoCreate distinct types for a PolyTraitRef (with bindings) and a normal TraitRef.
Niko Matsakis [Thu, 11 Dec 2014 18:37:37 +0000 (13:37 -0500)]
Create distinct types for a PolyTraitRef (with bindings) and a normal TraitRef.

9 years agoFix a bug in the opt-in-copy work: it was failing to liberate the regions bound in...
Niko Matsakis [Thu, 11 Dec 2014 00:11:15 +0000 (19:11 -0500)]
Fix a bug in the opt-in-copy work: it was failing to liberate the regions bound in the impl before searching for `Copy` implements for all fields, leading to problems in the "copyability check". Basically the copyability check would wind up looking for an impl of `for<'tcx> Foo<&'tcx T>`. The impl that exists however is `impl<T> Copy for Foo<T>` and the current rules do not consider that a match (something I would like to revise in a later PR).

9 years agoExtract leak check into a distinct subroutine.
Niko Matsakis [Wed, 10 Dec 2014 23:27:04 +0000 (18:27 -0500)]
Extract leak check into a distinct subroutine.

9 years agoExtract skolemize_regions() helper function.
Niko Matsakis [Wed, 10 Dec 2014 23:09:50 +0000 (18:09 -0500)]
Extract skolemize_regions() helper function.

9 years agoRecycle skolemization counts and add some comments.
Niko Matsakis [Wed, 10 Dec 2014 16:12:48 +0000 (11:12 -0500)]
Recycle skolemization counts and add some comments.

9 years agoPropagate expected type more widely so that we can rewrite the
Niko Matsakis [Tue, 2 Dec 2014 18:59:27 +0000 (13:59 -0500)]
Propagate expected type more widely so that we can rewrite the
issue-14039 test in a more natural way. Previously the "type we will
cast to" was hidden unless it was an integer.

9 years agoDelete tests that passed in error. We currently do not support a Clone
Niko Matsakis [Tue, 2 Dec 2014 18:58:38 +0000 (13:58 -0500)]
Delete tests that passed in error. We currently do not support a Clone
impl for fn pointer types including bound regions, unfortunately.

9 years agoCleanup type resolution to use type folding infrastructure and not
Niko Matsakis [Mon, 1 Dec 2014 17:27:27 +0000 (12:27 -0500)]
Cleanup type resolution to use type folding infrastructure and not
have such a silly over-engineered interface.

9 years agoFix bug in higher-ranked code that would sometimes leak skolemized regions and/or...
Niko Matsakis [Mon, 1 Dec 2014 15:11:59 +0000 (10:11 -0500)]
Fix bug in higher-ranked code that would sometimes leak skolemized regions and/or cause incorrect results.

9 years agoAdd tests for sub relationship on free/bound regions, revealing a bug.
Niko Matsakis [Sat, 29 Nov 2014 13:06:42 +0000 (08:06 -0500)]
Add tests for sub relationship on free/bound regions, revealing a bug.

9 years agoauto merge of #19654 : aturon/rust/merge-rt, r=alexcrichton
bors [Fri, 19 Dec 2014 08:28:52 +0000 (08:28 +0000)]
auto merge of #19654 : aturon/rust/merge-rt, r=alexcrichton

This PR substantially narrows the notion of a "runtime" in Rust, and allows calling into Rust code directly without any setup or teardown.

After this PR, the basic "runtime support" in Rust will consist of:

* Unwinding and backtrace support
* Stack guards

Other support, such as helper threads for timers or the notion of a "current thread" are initialized automatically upon first use.

When using Rust in an embedded context, it should now be possible to call a Rust function directly as a C function with absolutely no setup, though in that case panics will cause the process to abort. In this regard, the C/Rust interface will look much like the C/C++ interface.

In more detail, this PR:

* Merges `librustrt` back into `std::rt`, undoing the facade. While doing so, it removes a substantial amount of redundant functionality (such as mutexes defined in the `rt` module). Code using `librustrt` can now call into `std::rt` to e.g. start executing Rust code with unwinding support.

* Allows all runtime data to be initialized lazily, including the "current thread", the "at_exit" infrastructure, and the "args" storage.

* Deprecates and largely removes `std::task` along with the widespread requirement that there be a "current task" for many APIs in `std`. The entire task infrastructure is replaced with `std::thread`, which provides a more standard API for manipulating and creating native OS threads. In particular, it's possible to join on a created thread, and to get a handle to the currently-running thread. In addition, threads are equipped with some basic blocking support in the form of `park`/`unpark` operations (following a tradition in some OSes as well as the JVM). See the `std::thread` documentation for more details.

* Channels are refactored to use a new internal blocking infrastructure that itself sits on top of `park`/`unpark`.

One important change here is that a Rust program ends when its main thread does, following most threading models. On the other hand, threads will often be created with an RAII-style join handle that will re-institute blocking semantics naturally (and with finer control).

This is very much a:

[breaking-change]

Closes #18000
r? @alexcrichton

9 years agoDisable at_exit handlers
Aaron Turon [Fri, 19 Dec 2014 07:29:30 +0000 (23:29 -0800)]
Disable at_exit handlers

The [final step](https://github.com/rust-lang/rust/pull/19654) of
runtime removal changes the threading/process model so that the process
shuts down when the main thread exits. But several shared resources,
like the helper thread for timeouts, are shut down when the main thread
exits (but before the process ends), and they are not prepared to be
used after shut down, but other threads may try to access them during
the shutdown sequence of the main thread.

As an interim solution, the `at_exit` cleanup routine is simply skipped.

Ultimately, these resources should be made to safely handle asynchronous
shutdown, usually by panicking if called from a detached thread when the
main thread is ending.

See issue for details https://github.com/rust-lang/rust/issues/20012

This is a [breaking-change] for anyone relying on `at_exit`.

9 years agoRebasing fixes.
Aaron Turon [Fri, 19 Dec 2014 03:41:20 +0000 (19:41 -0800)]
Rebasing fixes.

9 years agoDisable stack overflow test on android, which seems to be failing spuriously.
Aaron Turon [Fri, 19 Dec 2014 02:56:28 +0000 (18:56 -0800)]
Disable stack overflow test on android, which seems to be failing spuriously.

cc https://github.com/rust-lang/rust/issues/20004

9 years agoDelete rest of rustrt
Aaron Turon [Wed, 17 Dec 2014 23:41:16 +0000 (15:41 -0800)]
Delete rest of rustrt

... and address other rebasing fallout.

9 years agostd: Move the panic flag to its own thread local
Alex Crichton [Wed, 17 Dec 2014 22:59:20 +0000 (14:59 -0800)]
std: Move the panic flag to its own thread local

This flag is somewhat tied to the `unwind` module rather than the `thread_info`
module, so this commit moves it into that module as well as allowing the same OS
thread to call `unwind::try` multiple times. Previously once a thread panicked
its panic flag was never reset, even after exiting the panic handler.

9 years agostd: Lower abstractions for thread_local/at_exit
Alex Crichton [Wed, 17 Dec 2014 22:37:38 +0000 (14:37 -0800)]
std: Lower abstractions for thread_local/at_exit

The current implementations use `std::sync` primitives, but these primitives
currently end up relying on `thread_info` and a local `Thread` being available
(mainly for checking the panicking flag).

To get around this, this commit lowers the abstractions used by the windows
thread_local implementation as well as the at_exit_imp module. Both of these
modules now use a `sys::Mutex` and a `static mut` and manage the
allocation/locking manually.

9 years agoRevise std::thread API to join by default
Aaron Turon [Sun, 14 Dec 2014 08:05:32 +0000 (00:05 -0800)]
Revise std::thread API to join by default

This commit is part of a series that introduces a `std::thread` API to
replace `std::task`.

In the new API, `spawn` returns a `JoinGuard`, which by default will
join the spawned thread when dropped. It can also be used to join
explicitly at any time, returning the thread's result. Alternatively,
the spawned thread can be explicitly detached (so no join takes place).

As part of this change, Rust processes now terminate when the main
thread exits, even if other detached threads are still running, moving
Rust closer to standard threading models. This new behavior may break code
that was relying on the previously implicit join-all.

In addition to the above, the new thread API also offers some built-in
support for building blocking abstractions in user space; see the module
doc for details.

Closes #18000

[breaking-change]

9 years agoUpdate doc comment for std::rt
Aaron Turon [Mon, 15 Dec 2014 06:52:55 +0000 (22:52 -0800)]
Update doc comment for std::rt

9 years agoAvoid .take().unwrap() with FnOnce closures
Alex Crichton [Wed, 10 Dec 2014 15:49:45 +0000 (07:49 -0800)]
Avoid .take().unwrap() with FnOnce closures

9 years agoTweak the startup routine to pass on linux
Alex Crichton [Wed, 10 Dec 2014 15:37:56 +0000 (07:37 -0800)]
Tweak the startup routine to pass on linux

We need to be sure to init thread_info before we init args for example because
args is grabbing locks which may entail looking at the local thread eventually.

9 years agoFix compilation on linux
Alex Crichton [Wed, 10 Dec 2014 15:37:33 +0000 (07:37 -0800)]
Fix compilation on linux

9 years agoFix the capture_stderr test
Alex Crichton [Wed, 10 Dec 2014 15:36:33 +0000 (07:36 -0800)]
Fix the capture_stderr test

There's always a fun time having two sets of standard libraries when testing!

9 years agoDisable capture_stderr test for now
Aaron Turon [Tue, 9 Dec 2014 01:01:34 +0000 (17:01 -0800)]
Disable capture_stderr test for now

9 years agoFallout from new thread API
Aaron Turon [Sun, 7 Dec 2014 02:34:37 +0000 (18:34 -0800)]
Fallout from new thread API

9 years agoRevise rt::unwind
Aaron Turon [Sun, 7 Dec 2014 08:32:50 +0000 (00:32 -0800)]
Revise rt::unwind

9 years agoRemove rt::{mutex, exclusive}
Aaron Turon [Mon, 1 Dec 2014 16:49:32 +0000 (08:49 -0800)]
Remove rt::{mutex, exclusive}

9 years agoAdd blocking support module for channels
Aaron Turon [Mon, 1 Dec 2014 16:14:35 +0000 (08:14 -0800)]
Add blocking support module for channels

9 years agoRemove rt::{local, local_data, thread_local_storage}
Aaron Turon [Tue, 25 Nov 2014 01:59:15 +0000 (17:59 -0800)]
Remove rt::{local, local_data, thread_local_storage}

9 years agoIntroduce std::thread
Aaron Turon [Tue, 25 Nov 2014 16:52:10 +0000 (08:52 -0800)]
Introduce std::thread

Also removes:

* `std::task`
* `std::rt::task`
* `std::rt::thread`

Notes for the new API are in a follow-up commit.

Closes #18000

9 years agoRemove rt::bookkeeping
Aaron Turon [Tue, 25 Nov 2014 01:33:37 +0000 (17:33 -0800)]
Remove rt::bookkeeping

This commit removes the runtime bookkeeping previously used to ensure
that all Rust tasks were joined before the runtime was shut down.

This functionality will be replaced by an RAII style `Thread` API, that
will also offer a detached mode.

Since this changes the semantics of shutdown, it is a:

[breaking-change]

9 years agoMake at_exit initialize lazily
Aaron Turon [Tue, 25 Nov 2014 01:22:40 +0000 (17:22 -0800)]
Make at_exit initialize lazily

9 years agoAllow args to work without rt initialization
Aaron Turon [Tue, 25 Nov 2014 00:38:06 +0000 (16:38 -0800)]
Allow args to work without rt initialization

9 years agoRefactor std::os to use sys::os
Aaron Turon [Tue, 25 Nov 2014 00:21:39 +0000 (16:21 -0800)]
Refactor std::os to use sys::os

9 years agolibs: merge librustrt into libstd
Aaron Turon [Mon, 24 Nov 2014 03:21:17 +0000 (19:21 -0800)]
libs: merge librustrt into libstd

This commit merges the `rustrt` crate into `std`, undoing part of the
facade. This merger continues the paring down of the runtime system.

Code relying on the public API of `rustrt` will break; some of this API
is now available through `std::rt`, but is likely to change and/or be
removed very soon.

[breaking-change]

9 years agoauto merge of #19899 : japaric/rust/unops-by-value, r=nikomatsakis
bors [Fri, 19 Dec 2014 06:12:01 +0000 (06:12 +0000)]
auto merge of #19899 : japaric/rust/unops-by-value, r=nikomatsakis

- The following operator traits now take their argument by value: `Neg`, `Not`. This breaks all existing implementations of these traits.

- The unary operation `OP a` now "desugars" to `OpTrait::op_method(a)` and consumes its argument.

[breaking-change]

---

r? @nikomatsakis This PR is very similar to the binops-by-value PR
cc @aturon

9 years agoauto merge of #19955 : Gankro/rust/kill-all-code, r=aturon
bors [Fri, 19 Dec 2014 02:52:01 +0000 (02:52 +0000)]
auto merge of #19955 : Gankro/rust/kill-all-code, r=aturon

EnumSet lives on in libcollections so that librustc can still use it. This adds a direct dependency on libcollections to librustc and libserialize.

Should not be merged until https://github.com/rust-lang/rfcs/pull/509 is accepted.

All of these collections have already been moved to collect-rs where they will ideally be maintained and experimented with, or will be replaced by something better: https://github.com/Gankro/collect-rs/

[breaking-change]

r? @aturon @alexcrichton

9 years agoenumset fallout
Alexis Beingessner [Wed, 17 Dec 2014 15:16:10 +0000 (10:16 -0500)]
enumset fallout

9 years agos/Tree/BTree
Alexis Beingessner [Wed, 17 Dec 2014 04:09:16 +0000 (23:09 -0500)]
s/Tree/BTree

9 years agoremove TreeMap, TreeSet, TrieMap, TrieSet, LruCache. deprecate EnumSet's std re-export
Alexis Beingessner [Wed, 17 Dec 2014 03:33:13 +0000 (22:33 -0500)]
remove TreeMap, TreeSet, TrieMap, TrieSet, LruCache. deprecate EnumSet's std re-export

9 years agoauto merge of #19896 : ktossell/rust/allow-nodoc-install, r=alexcrichton
bors [Thu, 18 Dec 2014 20:32:07 +0000 (20:32 +0000)]
auto merge of #19896 : ktossell/rust/allow-nodoc-install, r=alexcrichton

If you configure with `--disable-docs`, the `doc` directory does not get generated, so the
`cp -r doc dist/` step fails when you `make dist{,-tar-bins,-doc}` or `make install`.

9 years agoAddress Niko's comments
Jorge Aparicio [Wed, 17 Dec 2014 00:40:57 +0000 (19:40 -0500)]
Address Niko's comments

9 years agoTest unop move semantics
Jorge Aparicio [Mon, 15 Dec 2014 23:24:33 +0000 (18:24 -0500)]
Test unop move semantics

9 years agoFix run pass tests
Jorge Aparicio [Mon, 15 Dec 2014 23:24:07 +0000 (18:24 -0500)]
Fix run pass tests

9 years agolibstd: convert `Duration` unops to by value
Jorge Aparicio [Mon, 15 Dec 2014 22:06:34 +0000 (17:06 -0500)]
libstd: convert `Duration` unops to by value

9 years agolibstd: convert `BitFlags` unops to by value
Jorge Aparicio [Mon, 15 Dec 2014 22:06:10 +0000 (17:06 -0500)]
libstd: convert `BitFlags` unops to by value

9 years agolibcore: convert unop traits to by value
Jorge Aparicio [Mon, 15 Dec 2014 21:24:24 +0000 (16:24 -0500)]
libcore: convert unop traits to by value

9 years agoTell regionck that user unops are by value
Jorge Aparicio [Mon, 15 Dec 2014 21:18:17 +0000 (16:18 -0500)]
Tell regionck that user unops are by value

9 years agoTell expr_use_visitor that user unops are by value
Jorge Aparicio [Mon, 15 Dec 2014 21:16:48 +0000 (16:16 -0500)]
Tell expr_use_visitor that user unops are by value

9 years agoTell trans that user unops are by value
Jorge Aparicio [Mon, 15 Dec 2014 21:14:25 +0000 (16:14 -0500)]
Tell trans that user unops are by value

9 years agoTell typeck that user unops are by value
Jorge Aparicio [Mon, 15 Dec 2014 21:11:34 +0000 (16:11 -0500)]
Tell typeck that user unops are by value

9 years agosyntax/ast_util: add `is_by_value_unop()`
Jorge Aparicio [Mon, 15 Dec 2014 20:49:41 +0000 (15:49 -0500)]
syntax/ast_util: add `is_by_value_unop()`

9 years agoauto merge of #19984 : japaric/rust/macro-expressions, r=alexcrichton
bors [Thu, 18 Dec 2014 17:32:07 +0000 (17:32 +0000)]
auto merge of #19984 : japaric/rust/macro-expressions, r=alexcrichton

followed by a semicolon.

This allows code like `vec![1i, 2, 3].len();` to work.

This breaks code that uses macros as statements without putting
semicolons after them, such as:

    fn main() {
        ...
        assert!(a == b)
        assert!(c == d)
        println(...);
    }

It also breaks code that uses macros as items without semicolons:

    local_data_key!(foo)

    fn main() {
        println("hello world")
    }

Add semicolons to fix this code. Those two examples can be fixed as
follows:

    fn main() {
        ...
        assert!(a == b);
        assert!(c == d);
        println(...);
    }

    local_data_key!(foo);

    fn main() {
        println("hello world")
    }

RFC #378.

Closes #18635.

[breaking-change]

---

Rebased version of #18958
r? @alexcrichton
cc @pcwalton

9 years agolibrustc: Always parse `macro!()`/`macro![]` as expressions if not
Patrick Walton [Fri, 14 Nov 2014 17:18:10 +0000 (09:18 -0800)]
librustc: Always parse `macro!()`/`macro![]` as expressions if not
followed by a semicolon.

This allows code like `vec![1i, 2, 3].len();` to work.

This breaks code that uses macros as statements without putting
semicolons after them, such as:

    fn main() {
        ...
        assert!(a == b)
        assert!(c == d)
        println(...);
    }

It also breaks code that uses macros as items without semicolons:

    local_data_key!(foo)

    fn main() {
        println("hello world")
    }

Add semicolons to fix this code. Those two examples can be fixed as
follows:

    fn main() {
        ...
        assert!(a == b);
        assert!(c == d);
        println(...);
    }

    local_data_key!(foo);

    fn main() {
        println("hello world")
    }

RFC #378.

Closes #18635.

[breaking-change]

9 years agoauto merge of #19819 : vadimcn/rust/fix-demangle, r=alexcrichton
bors [Thu, 18 Dec 2014 14:42:06 +0000 (14:42 +0000)]
auto merge of #19819 : vadimcn/rust/fix-demangle, r=alexcrichton

Windows dbghelp strips leading underscores from symbols, and I could not find a way to turn this off.  So let's accept  "ZN...E" form too.
Also, print PC displacement from symbols.  This is helpful in gauging whether the PC was indeed within the function displayed in the backtrace, or whether it just happened to be the closest public symbol in the module.

9 years agoauto merge of #19780 : jakub-/rust/e-needstest, r=alexcrichton
bors [Thu, 18 Dec 2014 12:21:57 +0000 (12:21 +0000)]
auto merge of #19780 : jakub-/rust/e-needstest, r=alexcrichton

Closes #5988.
Closes #10176.
Closes #10456.
Closes #12744.
Closes #13264.
Closes #13324.
Closes #14182.
Closes #15381.
Closes #15444.
Closes #15480.
Closes #15756.
Closes #16822.
Closes #16966.
Closes #17351.
Closes #17503.
Closes #17545.
Closes #17771.
Closes #17816.
Closes #17897.
Closes #17905.
Closes #18188.
Closes #18232.
Closes #18345.
Closes #18389.
Closes #18400.
Closes #18502.
Closes #18611.
Closes #18783.
Closes #19009.
Closes #19081.
Closes #19098.
Closes #19127.
Closes #19135.

9 years agoauto merge of #19769 : nick29581/rust/coerce-if, r=nikomatsakis
bors [Thu, 18 Dec 2014 06:41:59 +0000 (06:41 +0000)]
auto merge of #19769 : nick29581/rust/coerce-if, r=nikomatsakis

r? @nikomatsakis

We discussed coercions for `if` and `match` expressions. `if` seems to work already, was there some specific behaviour which wasn't working?

9 years agoPropagate coercions through match expressions.
Nick Cameron [Fri, 12 Dec 2014 05:48:44 +0000 (18:48 +1300)]
Propagate coercions through match expressions.