Commit Graph

22397 Commits

Author SHA1 Message Date
Erick Tryzelaar
43aba856b4 std: Remove Zero impl from vec
Vecs are not numeric types, so it doesn't make sense for them to
implement Zero.
2013-09-12 18:54:13 -07:00
Erick Tryzelaar
a0e123eb6e syntax: add #[deriving(Default)] syntax extension 2013-09-12 18:54:13 -07:00
Erick Tryzelaar
ca47eebb44 std: Add a bunch of Default impls 2013-09-12 18:54:13 -07:00
Erick Tryzelaar
38f97ea103 std: Rename {Option,Result}::chain{,_err}* to {and_then,or_else} 2013-09-12 18:54:13 -07:00
Erick Tryzelaar
e03d60e9eb std: Add ToEither/IntoEither/AsEither 2013-09-12 18:54:12 -07:00
Erick Tryzelaar
12e0d7ecf0 std: Add ToResult/IntoResult/AsResult 2013-09-12 18:54:12 -07:00
Erick Tryzelaar
ff34740a29 std: Add ToOption/IntoOption/AsOption 2013-09-12 18:54:12 -07:00
Erick Tryzelaar
b8a284e873 std: fix a warning 2013-09-12 18:54:12 -07:00
Erick Tryzelaar
d625d4a598 std: Add Option.{and,and_then,or,or_else} 2013-09-12 18:54:12 -07:00
Erick Tryzelaar
7380b1ce7f std: Add Option.unwrap_or_else and a couple tests 2013-09-12 18:54:12 -07:00
Erick Tryzelaar
2bd87ad432 std: Add Default implementation for vecs 2013-09-12 18:54:12 -07:00
Erick Tryzelaar
e6c11313c8 std: Add Option.{result_or_default,or_default} that uses Default 2013-09-12 18:54:12 -07:00
Erick Tryzelaar
f1374a7044 libsyntax: add Default implementation to OptVec 2013-09-12 18:54:12 -07:00
Erick Tryzelaar
4a73c8eac7 std: add default implementations to Option 2013-09-12 18:54:12 -07:00
Erick Tryzelaar
653400a7f0 std: add default implementations to HashMap 2013-09-12 18:54:12 -07:00
Erick Tryzelaar
45c62c08f9 std: rename Option::unwrap_or_default() to unwrap_or() 2013-09-12 18:54:11 -07:00
bors
19c0735231 auto merge of #9132 : catamorphism/rust/rustpkg-recursive-deps, r=catamorphism,metajack
r? @metajack ...recursive dependencies

Closes #8524
2013-09-12 17:45:45 -07:00
Tim Chevalier
91e64d0407 rustpkg: Search RUST_PATH properly for dependencies, and add a test for recursive dependencies
Closes #8524
2013-09-12 17:20:58 -07:00
Jakub
3d14e82be7 Fix rustpkg install for git repositories 2013-09-12 23:31:45 +00:00
Florian Hahn
2b5f4b55c0 Convert rust_crate_map.cpp to Rust
Conflicts:
	src/libstd/rt/logging.rs
2013-09-13 00:47:30 +02:00
Brian Anderson
0c89183e80 rustc: Fix cstack lint for default methods. Closes #8753 2013-09-12 15:21:01 -07:00
bors
761ae00357 auto merge of #9146 : catamorphism/rust/rustpkg-sub-package-ids, r=brson,catamorphism
r? @brson Package IDs can now refer to a subdirectory of a particular source
tree, and not just a top-level directory with a src/ directory as its
parent.

For example, referring to the package ID a/b/c/d , in workspace W,
if W/src/a is a package, will build the sources for the package in
a/b/c/d (and not other crates in W/src/a).

Closes #6408
2013-09-12 14:50:43 -07:00
Tim Chevalier
3226a804ad rustpkg: Support sub-package-IDs
Package IDs can now refer to a subdirectory of a particular source
tree, and not just a top-level directory with a src/ directory as its
parent.

For example, referring to the package ID a/b/c/d , in workspace W,
if W/src/a is a package, will build the sources for the package in
a/b/c/d (and not other crates in W/src/a).

Closes #6408
2013-09-12 14:11:25 -07:00
bors
cabba6b4d3 auto merge of #9136 : thestinger/rust/ptr, r=alexcrichton
This is mostly for consistency, as you can now compare raw pointers in
constant expressions or without the standard library.

It also reduces the number of `ptrtoint` instructions in the IR, making
tracking down culprits of what's usually an anti-pattern easier.
2013-09-12 13:10:55 -07:00
bors
a6be8d353b auto merge of #9140 : alexcrichton/rust/issue-9119, r=huonw
Closes #9119
2013-09-12 11:56:00 -07:00
bors
248765a746 auto merge of #9135 : jbclements/rust/let-var-hygiene, r=erickt
Fixes issue #9110, changes field_ty element to Name, adds test case, improves fail error message
2013-09-12 09:51:02 -07:00
bors
5f97dbe092 auto merge of #9134 : luqmana/rust/i7617, r=alexcrichton 2013-09-12 08:41:03 -07:00
bors
137b31e2fe auto merge of #8908 : tikue/rust/master, r=anasazi
SyncChan blocks after sending a message until the SyncPort acknowledges receipt of the message.
2013-09-12 07:26:04 -07:00
bors
3c17903c36 auto merge of #9131 : Dretch/rust/glob-range-patterns, r=alexcrichton
This feature was overlooked in the original pull request (#8914).

r? @alexcrichton
2013-09-12 06:06:04 -07:00
bors
0a2d3c5a6f auto merge of #9096 : huonw/rust/linenoise, r=brson
- Wrap calls into linenoise in a mutex so that the functions don't have to be `unsafe` any more (fixes #3921)
- Stop leaking every line that linenoise reads.
- Handle the situation of `rl::complete(some_function); do spawn { rl::read(""); }` which would crash (`fail!` that turned into an abort, possibly due to failing with the lock locked) when the user attempted to tab-complete anything.
- Add a test for the various functions; it has to be run by hand to verify anything works, but it won't bitrot.
2013-09-12 04:36:06 -07:00
bors
4825db44c8 auto merge of #9012 : alexcrichton/rust/format-args, r=huonw
The purpose of this macro is to further reduce the number of allocations which
occur when dealing with formatting strings. This macro will perform all of the
static analysis necessary to validate that a format string is safe, and then it
will wrap up the "format string" into an opaque struct which can then be passed
around.

Two safe functions are added (write/format) which take this opaque argument
structure, unwrap it, and then call the unsafe version of write/format (in an
unsafe block). Other than these two functions, it is not intended for anyone to
ever look inside this opaque struct.

The macro looks a bit odd, but mostly because of rvalue lifetimes this is the
only way for it to be safe that I know of.

Example use-cases of this are:

* third-party libraries can use the default formatting syntax without any
  forced allocations
* the fail!() macro can avoid allocating the format string
* the logging macros can avoid allocation any strings

I plan on transitioning the standard logging/failing to using these macros soon. This is currently blocking on inner statics being usable in cross-crate situations (still tracking down bugs there), but this will hopefully be coming soon!

Additionally, I'd rather settle on a name now than later, so if anyone has a better suggestion other than `format_args`, I'm not attached to the name at all :)
2013-09-12 03:21:08 -07:00
bors
68125359cd auto merge of #9138 : alexcrichton/rust/dynamic-lib-not-threadsafe, r=thestinger
The library isn't thread-safe, cc #9137
2013-09-12 01:16:08 -07:00
Alex Crichton
a018a5c343 Parse underscores in identifiers for format!
Closes #9119
2013-09-12 01:07:10 -07:00
Alex Crichton
68a9137eac Rewrite fileinput tests to use std::rt::io
These tests are being very flaky on the bots, and the reason is that files are
being created and then when attempted to get read they actually don't exist. I'm
not entirely sure why this is happening, but I also don't fully trust the
std::io implemention using @-boxes to close/flush/write files at the right time.

This moves the tests to using std::rt::io which is hopefully more robust and
something that we can actually reason about. Sadly, due to #8810, these tests
fail on windows, so they're all ignored on windows right now.
2013-09-12 01:04:39 -07:00
Alex Crichton
9a5f95a82c Implement a format_args!() macro
The purpose of this macro is to further reduce the number of allocations which
occur when dealing with formatting strings. This macro will perform all of the
static analysis necessary to validate that a format string is safe, and then it
will wrap up the "format string" into an opaque struct which can then be passed
around.

Two safe functions are added (write/format) which take this opaque argument
structure, unwrap it, and then call the unsafe version of write/format (in an
unsafe block). Other than these two functions, it is not intended for anyone to
ever look inside this opaque struct.

The macro looks a bit odd, but mostly because of rvalue lifetimes this is the
only way for it to be safe that I know of.

Example use-cases of this are:

* third-party libraries can use the default formatting syntax without any
  forced allocations
* the fail!() macro can avoid allocating the format string
* the logging macros can avoid allocation any strings
2013-09-12 00:36:54 -07:00
Huon Wilson
a9184975da Add linenoise lock helpers to rustrt.def.in. 2013-09-12 17:07:24 +10:00
Alex Crichton
645b83d712 Flag the dynamic_lib tests as ignored
The library isn't thread-safe, cc #9137
2013-09-11 23:22:52 -07:00
bors
03ca1befb3 auto merge of #9114 : sfackler/rust/flush-fix, r=brson 2013-09-11 23:11:04 -07:00
Daniel Micay
b7435cf447 implement raw pointer comparisons in librustc
This is mostly for consistency, as you can now compare raw pointers in
constant expressions or without the standard library.

It also reduces the number of `ptrtoint` instructions in the IR, making
tracking down culprits of what's usually an anti-pattern easier.
2013-09-12 01:58:39 -04:00
John Clements
de5b9b9a0b added run-pass test from issue #9110 2013-09-11 22:18:45 -07:00
John Clements
e9832d44df ident->name cleanup 2013-09-11 22:18:45 -07:00
John Clements
f576ed0c76 fix for bug #9110 2013-09-11 22:18:45 -07:00
John Clements
b9a8b3700b more helpful error message for ident comparison failure 2013-09-11 22:18:45 -07:00
Luqman Aden
cbe79bbbd3 librust: Remove unnecessary workaround. Closes #7617 2013-09-12 00:25:08 -04:00
bors
62166611e7 auto merge of #9061 : jakub-/rust/pretty-print-empty-impl, r=huonw 2013-09-11 19:16:00 -07:00
Tim Kuehn
a835995488 Rendezvous stream for synchronous channel messaging 2013-09-11 22:03:54 -04:00
Jakub
de799722dc Fix the empty-impl tests
Use an existing type so that it compiles.
2013-09-11 23:58:30 +00:00
bors
91ab8a3f52 auto merge of #9014 : dcrewi/rust/convert-between-bigints, r=anasazi 2013-09-11 16:46:00 -07:00
Gareth Smith
ef08b2339d Support character range patterns (e.g. [0-9], [a-z]), like other globs do. 2013-09-11 23:46:33 +01:00
bors
7f0d261ae2 auto merge of #9064 : SiegeLord/rust/external_struct_variants, r=luqmana
Fixes issues #5557 and #8746.

This patch adds an additional family for struct-like variants, and encodes some struct-like aspects of such variants that can then be properly decoded by resolve.

Note that I am not 100% sure how this fix works, but it fixes the issue without breaking any of the tests on my machine.
2013-09-11 14:56:00 -07:00