]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoauto merge of #9160 : alexcrichton/rust/local-data-docs, r=huonw
bors [Sat, 14 Sep 2013 09:30:59 +0000 (02:30 -0700)]
auto merge of #9160 : alexcrichton/rust/local-data-docs, r=huonw

Remove references to local_data::Key and only mention the macro for how to
construct new keys into local data.

10 years agoauto merge of #9156 : sfackler/rust/buffered-fix, r=huonw
bors [Sat, 14 Sep 2013 08:16:00 +0000 (01:16 -0700)]
auto merge of #9156 : sfackler/rust/buffered-fix, r=huonw

This is a workaround for #9155. Currently, any uses of BufferedStream
outside of libstd ICE.

10 years agoauto merge of #9115 : erickt/rust/master, r=erickt
bors [Sat, 14 Sep 2013 07:01:04 +0000 (00:01 -0700)]
auto merge of #9115 : erickt/rust/master, r=erickt

This is a series of patches to modernize option and result. The highlights are:

* rename `.unwrap_or_default(value)` and etc to `.unwrap_or(value)`
* add `.unwrap_or_default()` that uses the `Default` trait
* add `Default` implementations for vecs, HashMap, Option
* add  `Option.and(T) -> Option<T>`, `Option.and_then(&fn() -> Option<T>) -> Option<T>`, `Option.or(T) -> Option<T>`, and `Option.or_else(&fn() -> Option<T>) -> Option<T>`
* add `option::ToOption`, `option::IntoOption`, `option::AsOption`, `result::ToResult`, `result::IntoResult`, `result::AsResult`, `either::ToEither`, and `either::IntoEither`, `either::AsEither`
* renamed `Option::chain*` and `Result::chain*` to `and_then` and `or_else` to avoid the eventual collision with `Iterator.chain`.
* Added a bunch of impls of `Default`
* Added a `#[deriving(Default)]` syntax extension
* Removed impls of `Zero` for `Option<T>` and vecs.

10 years agoauto merge of #9185 : alexcrichton/rust/less-changing-directories, r=huonw
bors [Sat, 14 Sep 2013 05:16:03 +0000 (22:16 -0700)]
auto merge of #9185 : alexcrichton/rust/less-changing-directories, r=huonw

While usage of change_dir_locked is synchronized against itself, it's not
synchronized against other relative path usage, so I'm of the opinion that it
just really doesn't help in running tests. In order to prevent the problems that
have been cropping up, this completely removes the function.

All existing tests (except one) using it have been moved to run-pass tests where
they get their own process and don't need to be synchronized with anyone else.

There is one now-ignored rustpkg test because when I moved it to a run-pass test
apparently run-pass isn't set up to have 'extern mod rustc' (it ends up having
linkage failures).

10 years agoRemove all usage of change_dir_locked
Alex Crichton [Sat, 14 Sep 2013 04:41:28 +0000 (21:41 -0700)]
Remove all usage of change_dir_locked

While usage of change_dir_locked is synchronized against itself, it's not
synchronized against other relative path usage, so I'm of the opinion that it
just really doesn't help in running tests. In order to prevent the problems that
have been cropping up, this completely removes the function.

All existing tests (except one) using it have been moved to run-pass tests where
they get their own process and don't need to be synchronized with anyone else.

There is one now-ignored rustpkg test because when I moved it to a run-pass test
apparently run-pass isn't set up to have 'extern mod rustc' (it ends up having
linkage failures).

10 years agoauto merge of #9176 : brson/rust/issue-9129, r=catamorphism
bors [Sat, 14 Sep 2013 04:06:02 +0000 (21:06 -0700)]
auto merge of #9176 : brson/rust/issue-9129, r=catamorphism

Servo is hitting this problem, so this is a workaround for lack of a real solution.

No tests because I couldn't actually reproduce the problem with either of the testcases in #9129

10 years agoauto merge of #9173 : thestinger/rust/offset, r=alexcrichton
bors [Sat, 14 Sep 2013 01:00:58 +0000 (18:00 -0700)]
auto merge of #9173 : thestinger/rust/offset, r=alexcrichton

This was intended to always use inbounds pointer arithmetic now.

10 years agoWork around a compiler crash folding labeled break. #9129
Brian Anderson [Fri, 13 Sep 2013 23:00:18 +0000 (16:00 -0700)]
Work around a compiler crash folding labeled break. #9129

Servo is hitting this problem, so this is a workaround for a lack of a real solution.

10 years agoptr: fix offset intrinsic
Daniel Micay [Fri, 13 Sep 2013 21:13:17 +0000 (17:13 -0400)]
ptr: fix offset intrinsic

This was intended to always use inbounds pointer arithmetic now.

10 years agoauto merge of #9158 : thestinger/rust/extern, r=alexcrichton
bors [Fri, 13 Sep 2013 21:10:52 +0000 (14:10 -0700)]
auto merge of #9158 : thestinger/rust/extern, r=alexcrichton

Since function pointers do not carry along the function attributes with
them in the type, this needs to be set on the call instruction itself.

Closes #9152

10 years agoauto merge of #9151 : catamorphism/rust/rustpkg-target-specific-subdirectory, r=brson
bors [Fri, 13 Sep 2013 19:55:54 +0000 (12:55 -0700)]
auto merge of #9151 : catamorphism/rust/rustpkg-target-specific-subdirectory, r=brson

r? @brson As per rustpkg.md, rustpkg now builds in a target-specific
subdirectory of build/, and installs libraries into a target-specific
subdirectory of lib.

Closes #8672

10 years agoauto merge of #9170 : alexcrichton/rust/flaky-fileinput, r=erickt
bors [Fri, 13 Sep 2013 18:45:56 +0000 (11:45 -0700)]
auto merge of #9170 : alexcrichton/rust/flaky-fileinput, r=erickt

The glob tests cannot change the current working directory because the other tests (namely the fileinput ones) depend on the current working directory not changing.

10 years agoMove glob tests to a run-pass test
Alex Crichton [Fri, 13 Sep 2013 16:37:45 +0000 (09:37 -0700)]
Move glob tests to a run-pass test

The normal unit tests cannot change the current working directory because it
messes with the other tests which depend on a particular working directory.

10 years agorustc/rustpkg: Use a target-specific subdirectory in build/ and lib/
Tim Chevalier [Fri, 13 Sep 2013 02:29:21 +0000 (19:29 -0700)]
rustc/rustpkg: Use a target-specific subdirectory in build/ and lib/

As per rustpkg.md, rustpkg now builds in a target-specific
subdirectory of build/, and installs libraries into a target-specific
subdirectory of lib.

Closes #8672

10 years agoset sret attribute as needed on call instructions
Daniel Micay [Fri, 13 Sep 2013 03:23:44 +0000 (23:23 -0400)]
set sret attribute as needed on call instructions

Since function pointers do not carry along the function attributes with
them in the type, this needs to be set on the call instruction itself.

Closes #9152

10 years agostd: Fix another windows problem with the unwrap_or_default rename
Erick Tryzelaar [Fri, 13 Sep 2013 14:09:32 +0000 (07:09 -0700)]
std: Fix another windows problem with the unwrap_or_default rename

10 years agostd: rename Option.chain to Option.and_then on windows
Erick Tryzelaar [Fri, 13 Sep 2013 13:58:46 +0000 (06:58 -0700)]
std: rename Option.chain to Option.and_then on windows

10 years agoauto merge of #9141 : alexcrichton/rust/ignore-fileinput, r=catamorphism
bors [Fri, 13 Sep 2013 09:25:49 +0000 (02:25 -0700)]
auto merge of #9141 : alexcrichton/rust/ignore-fileinput, r=catamorphism

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.

10 years agoauto merge of #9148 : jakub-/rust/rustpkg-install-mkdir-p, r=catamorphism
bors [Fri, 13 Sep 2013 08:00:50 +0000 (01:00 -0700)]
auto merge of #9148 : jakub-/rust/rustpkg-install-mkdir-p, r=catamorphism

Testing this is a little tricky as an intermediate temporary directory is only used for remote git repositories and therefore that path cannot be reliably exercised in the tests.

10 years agoImprove the local_data docs slightly
Alex Crichton [Fri, 13 Sep 2013 06:26:06 +0000 (23:26 -0700)]
Improve the local_data docs slightly

Remove references to local_data::Key and only mention the macro for how to
construct new keys into local data.

10 years agoauto merge of #9087 : fhahn/rust/rust_crate_map, r=brson
bors [Fri, 13 Sep 2013 06:00:51 +0000 (23:00 -0700)]
auto merge of #9087 : fhahn/rust/rust_crate_map, r=brson

This patch converts the rust_crate_map.cpp to Rust as mentioned at the end of #8880.

10 years agoStop using newtypes in rt::io::buffered
Steven Fackler [Fri, 13 Sep 2013 04:48:47 +0000 (21:48 -0700)]
Stop using newtypes in rt::io::buffered

This is a workaround for #9155. Currently, any uses of BufferedStream
outside of libstd ICE.

10 years agoauto merge of #8796 : brson/rust/cstack, r=pnkfelix
bors [Fri, 13 Sep 2013 04:30:47 +0000 (21:30 -0700)]
auto merge of #8796 : brson/rust/cstack, r=pnkfelix

10 years agoauto merge of #9147 : catamorphism/rust/rustpkg-install-to-rust-path, r=catamorphism...
bors [Fri, 13 Sep 2013 02:30:46 +0000 (19:30 -0700)]
auto merge of #9147 : catamorphism/rust/rustpkg-install-to-rust-path, r=catamorphism,metajack

r? @metajack Install to the first directory in the RUST_PATH if the user set a
RUST_PATH. In the case where RUST_PATH isn't set, the behavior
remains unchanged.

Closes #7402

10 years agorustpkg: Install to RUST_PATH
Tim Chevalier [Thu, 12 Sep 2013 23:13:30 +0000 (16:13 -0700)]
rustpkg: Install to RUST_PATH

Install to the first directory in the RUST_PATH if the user set a
RUST_PATH. In the case where RUST_PATH isn't set, the behavior
remains unchanged.

Closes #7402

10 years agostd: Restore Option::chain{,_mut}_ref as and_then{,_mut}_ref
Erick Tryzelaar [Fri, 13 Sep 2013 01:54:02 +0000 (18:54 -0700)]
std: Restore Option::chain{,_mut}_ref as and_then{,_mut}_ref

10 years agoDocument the Zero trait
Erick Tryzelaar [Thu, 12 Sep 2013 13:39:45 +0000 (06:39 -0700)]
Document the Zero trait

10 years agostd: Remove Zero impl for Option
Erick Tryzelaar [Thu, 12 Sep 2013 05:19:19 +0000 (22:19 -0700)]
std: Remove Zero impl for Option

Options are not numeric types, so it doesn't make sense for them to
implement Zero.

10 years agostd: Remove Zero impl from vec
Erick Tryzelaar [Thu, 12 Sep 2013 05:16:22 +0000 (22:16 -0700)]
std: Remove Zero impl from vec

Vecs are not numeric types, so it doesn't make sense for them to
implement Zero.

10 years agosyntax: add #[deriving(Default)] syntax extension
Erick Tryzelaar [Thu, 12 Sep 2013 04:51:13 +0000 (21:51 -0700)]
syntax: add #[deriving(Default)] syntax extension

10 years agostd: Add a bunch of Default impls
Erick Tryzelaar [Thu, 12 Sep 2013 04:49:25 +0000 (21:49 -0700)]
std: Add a bunch of Default impls

10 years agostd: Rename {Option,Result}::chain{,_err}* to {and_then,or_else}
Erick Tryzelaar [Wed, 11 Sep 2013 19:52:17 +0000 (12:52 -0700)]
std: Rename {Option,Result}::chain{,_err}* to {and_then,or_else}

10 years agostd: Add ToEither/IntoEither/AsEither
Erick Tryzelaar [Wed, 11 Sep 2013 16:33:45 +0000 (09:33 -0700)]
std: Add ToEither/IntoEither/AsEither

10 years agostd: Add ToResult/IntoResult/AsResult
Erick Tryzelaar [Wed, 11 Sep 2013 16:32:09 +0000 (09:32 -0700)]
std: Add ToResult/IntoResult/AsResult

10 years agostd: Add ToOption/IntoOption/AsOption
Erick Tryzelaar [Wed, 11 Sep 2013 16:26:59 +0000 (09:26 -0700)]
std: Add ToOption/IntoOption/AsOption

10 years agostd: fix a warning
Erick Tryzelaar [Wed, 11 Sep 2013 04:16:59 +0000 (21:16 -0700)]
std: fix a warning

10 years agostd: Add Option.{and,and_then,or,or_else}
Erick Tryzelaar [Wed, 11 Sep 2013 16:00:27 +0000 (09:00 -0700)]
std: Add Option.{and,and_then,or,or_else}

10 years agostd: Add Option.unwrap_or_else and a couple tests
Erick Tryzelaar [Wed, 11 Sep 2013 02:03:35 +0000 (19:03 -0700)]
std: Add Option.unwrap_or_else and a couple tests

10 years agostd: Add Default implementation for vecs
Erick Tryzelaar [Tue, 10 Sep 2013 02:32:56 +0000 (19:32 -0700)]
std: Add Default implementation for vecs

10 years agostd: Add Option.{result_or_default,or_default} that uses Default
Erick Tryzelaar [Tue, 10 Sep 2013 02:32:32 +0000 (19:32 -0700)]
std: Add Option.{result_or_default,or_default} that uses Default

10 years agolibsyntax: add Default implementation to OptVec
Erick Tryzelaar [Tue, 10 Sep 2013 02:29:31 +0000 (19:29 -0700)]
libsyntax: add Default implementation to OptVec

10 years agostd: add default implementations to Option
Erick Tryzelaar [Tue, 10 Sep 2013 02:29:11 +0000 (19:29 -0700)]
std: add default implementations to Option

10 years agostd: add default implementations to HashMap
Erick Tryzelaar [Tue, 10 Sep 2013 02:28:05 +0000 (19:28 -0700)]
std: add default implementations to HashMap

10 years agostd: rename Option::unwrap_or_default() to unwrap_or()
Erick Tryzelaar [Tue, 10 Sep 2013 02:57:08 +0000 (19:57 -0700)]
std: rename Option::unwrap_or_default() to unwrap_or()

10 years agoauto merge of #9132 : catamorphism/rust/rustpkg-recursive-deps, r=catamorphism,metajack
bors [Fri, 13 Sep 2013 00:45:45 +0000 (17:45 -0700)]
auto merge of #9132 : catamorphism/rust/rustpkg-recursive-deps, r=catamorphism,metajack

r? @metajack ...recursive dependencies

Closes #8524

10 years agorustpkg: Search RUST_PATH properly for dependencies, and add a test for recursive...
Tim Chevalier [Wed, 11 Sep 2013 06:25:31 +0000 (23:25 -0700)]
rustpkg: Search RUST_PATH properly for dependencies, and add a test for recursive dependencies

Closes #8524

10 years agoFix rustpkg install for git repositories
Jakub [Sun, 8 Sep 2013 22:59:51 +0000 (22:59 +0000)]
Fix rustpkg install for git repositories

10 years agoConvert rust_crate_map.cpp to Rust
Florian Hahn [Mon, 9 Sep 2013 22:04:29 +0000 (00:04 +0200)]
Convert rust_crate_map.cpp to Rust

Conflicts:
src/libstd/rt/logging.rs

10 years agorustc: Fix cstack lint for default methods. Closes #8753
Brian Anderson [Tue, 27 Aug 2013 19:24:50 +0000 (12:24 -0700)]
rustc: Fix cstack lint for default methods. Closes #8753

10 years agoauto merge of #9146 : catamorphism/rust/rustpkg-sub-package-ids, r=brson,catamorphism
bors [Thu, 12 Sep 2013 21:50:43 +0000 (14:50 -0700)]
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

10 years agorustpkg: Support sub-package-IDs
Tim Chevalier [Thu, 12 Sep 2013 20:56:11 +0000 (13:56 -0700)]
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

10 years agoauto merge of #9136 : thestinger/rust/ptr, r=alexcrichton
bors [Thu, 12 Sep 2013 20:10:55 +0000 (13:10 -0700)]
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.

10 years agoauto merge of #9140 : alexcrichton/rust/issue-9119, r=huonw
bors [Thu, 12 Sep 2013 18:56:00 +0000 (11:56 -0700)]
auto merge of #9140 : alexcrichton/rust/issue-9119, r=huonw

Closes #9119

10 years agoauto merge of #9135 : jbclements/rust/let-var-hygiene, r=erickt
bors [Thu, 12 Sep 2013 16:51:02 +0000 (09:51 -0700)]
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

10 years agoauto merge of #9134 : luqmana/rust/i7617, r=alexcrichton
bors [Thu, 12 Sep 2013 15:41:03 +0000 (08:41 -0700)]
auto merge of #9134 : luqmana/rust/i7617, r=alexcrichton

10 years agoauto merge of #8908 : tikue/rust/master, r=anasazi
bors [Thu, 12 Sep 2013 14:26:04 +0000 (07:26 -0700)]
auto merge of #8908 : tikue/rust/master, r=anasazi

SyncChan blocks after sending a message until the SyncPort acknowledges receipt of the message.

10 years agoauto merge of #9131 : Dretch/rust/glob-range-patterns, r=alexcrichton
bors [Thu, 12 Sep 2013 13:06:04 +0000 (06:06 -0700)]
auto merge of #9131 : Dretch/rust/glob-range-patterns, r=alexcrichton

This feature was overlooked in the original pull request (#8914).

r? @alexcrichton

10 years agoauto merge of #9096 : huonw/rust/linenoise, r=brson
bors [Thu, 12 Sep 2013 11:36:06 +0000 (04:36 -0700)]
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.

10 years agoauto merge of #9012 : alexcrichton/rust/format-args, r=huonw
bors [Thu, 12 Sep 2013 10:21:08 +0000 (03:21 -0700)]
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 :)

10 years agoauto merge of #9138 : alexcrichton/rust/dynamic-lib-not-threadsafe, r=thestinger
bors [Thu, 12 Sep 2013 08:16:08 +0000 (01:16 -0700)]
auto merge of #9138 : alexcrichton/rust/dynamic-lib-not-threadsafe, r=thestinger

The library isn't thread-safe, cc #9137

10 years agoParse underscores in identifiers for format!
Alex Crichton [Thu, 12 Sep 2013 07:50:19 +0000 (00:50 -0700)]
Parse underscores in identifiers for format!

Closes #9119

10 years agoRewrite fileinput tests to use std::rt::io
Alex Crichton [Thu, 12 Sep 2013 07:56:49 +0000 (00:56 -0700)]
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.

10 years agoImplement a format_args!() macro
Alex Crichton [Wed, 28 Aug 2013 09:22:45 +0000 (02:22 -0700)]
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

10 years agoAdd linenoise lock helpers to rustrt.def.in.
Huon Wilson [Thu, 12 Sep 2013 07:07:24 +0000 (17:07 +1000)]
Add linenoise lock helpers to rustrt.def.in.

10 years agoFlag the dynamic_lib tests as ignored
Alex Crichton [Thu, 12 Sep 2013 06:22:52 +0000 (23:22 -0700)]
Flag the dynamic_lib tests as ignored

The library isn't thread-safe, cc #9137

10 years agoauto merge of #9114 : sfackler/rust/flush-fix, r=brson
bors [Thu, 12 Sep 2013 06:11:04 +0000 (23:11 -0700)]
auto merge of #9114 : sfackler/rust/flush-fix, r=brson

10 years agoimplement raw pointer comparisons in librustc
Daniel Micay [Thu, 12 Sep 2013 05:01:59 +0000 (01:01 -0400)]
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.

10 years agoadded run-pass test from issue #9110
John Clements [Thu, 12 Sep 2013 05:17:57 +0000 (22:17 -0700)]
added run-pass test from issue #9110

10 years agoident->name cleanup
John Clements [Wed, 11 Sep 2013 23:21:03 +0000 (16:21 -0700)]
ident->name cleanup

10 years agofix for bug #9110
John Clements [Wed, 11 Sep 2013 22:43:24 +0000 (15:43 -0700)]
fix for bug #9110

10 years agomore helpful error message for ident comparison failure
John Clements [Tue, 10 Sep 2013 21:23:35 +0000 (14:23 -0700)]
more helpful error message for ident comparison failure

10 years agolibrust: Remove unnecessary workaround. Closes #7617
Luqman Aden [Thu, 12 Sep 2013 04:25:08 +0000 (00:25 -0400)]
librust: Remove unnecessary workaround. Closes #7617

10 years agoauto merge of #9061 : jakub-/rust/pretty-print-empty-impl, r=huonw
bors [Thu, 12 Sep 2013 02:16:00 +0000 (19:16 -0700)]
auto merge of #9061 : jakub-/rust/pretty-print-empty-impl, r=huonw

10 years agoRendezvous stream for synchronous channel messaging
Tim Kuehn [Sun, 1 Sep 2013 02:02:22 +0000 (22:02 -0400)]
Rendezvous stream for synchronous channel messaging

10 years agoFix the empty-impl tests
Jakub [Wed, 11 Sep 2013 23:58:30 +0000 (23:58 +0000)]
Fix the empty-impl tests

Use an existing type so that it compiles.

10 years agoauto merge of #9014 : dcrewi/rust/convert-between-bigints, r=anasazi
bors [Wed, 11 Sep 2013 23:46:00 +0000 (16:46 -0700)]
auto merge of #9014 : dcrewi/rust/convert-between-bigints, r=anasazi

10 years agoSupport character range patterns (e.g. [0-9], [a-z]), like other globs do.
Gareth Smith [Wed, 11 Sep 2013 22:46:33 +0000 (23:46 +0100)]
Support character range patterns (e.g. [0-9], [a-z]), like other globs do.

10 years agoauto merge of #9064 : SiegeLord/rust/external_struct_variants, r=luqmana
bors [Wed, 11 Sep 2013 21:56:00 +0000 (14:56 -0700)]
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.

10 years agoauto merge of #9038 : singingboyo/rust/with-mem-writer, r=anasazi
bors [Wed, 11 Sep 2013 19:16:01 +0000 (12:16 -0700)]
auto merge of #9038 : singingboyo/rust/with-mem-writer, r=anasazi

This is in many ways a replacement for the current std::io::with_str_writer.

10 years agoxfail-fast the new test for windows compatibility
SiegeLord [Wed, 11 Sep 2013 18:51:27 +0000 (14:51 -0400)]
xfail-fast the new test for windows compatibility

10 years agoFix whitespace in tests
SiegeLord [Tue, 10 Sep 2013 03:22:54 +0000 (23:22 -0400)]
Fix whitespace in tests

10 years agoReplace dashes in the filenames of the new tests with underscores to avoid issues...
SiegeLord [Tue, 10 Sep 2013 03:21:36 +0000 (23:21 -0400)]
Replace dashes in the filenames of the new tests with underscores to avoid issues with Windows

10 years agoAdd a test for cross-crate struct variants
SiegeLord [Mon, 9 Sep 2013 22:44:31 +0000 (18:44 -0400)]
Add a test for cross-crate struct variants

10 years agoRename encode_struct_field_names to encode_struct_fields to reflect what it actually...
SiegeLord [Mon, 9 Sep 2013 22:33:35 +0000 (18:33 -0400)]
Rename encode_struct_field_names to encode_struct_fields to reflect what it actually does

10 years agoProperly encode/decode structural variants.
SiegeLord [Mon, 9 Sep 2013 00:36:01 +0000 (20:36 -0400)]
Properly encode/decode structural variants.

10 years agoauto merge of #8999 : anasazi/rust/multi-threaded-io-tests, r=brson
bors [Wed, 11 Sep 2013 17:21:02 +0000 (10:21 -0700)]
auto merge of #8999 : anasazi/rust/multi-threaded-io-tests, r=brson

Resolves #8685

10 years agoAdd HashSet::with_capacity_and_keys() function
Florian Hahn [Tue, 10 Sep 2013 22:39:26 +0000 (00:39 +0200)]
Add HashSet::with_capacity_and_keys() function

This function can be use to create HashSets before the tls is
initialized.

10 years agoauto merge of #9039 : singingboyo/rust/update-for-expr-docs, r=thestinger
bors [Wed, 11 Sep 2013 14:46:04 +0000 (07:46 -0700)]
auto merge of #9039 : singingboyo/rust/update-for-expr-docs, r=thestinger

The old documentation for for loops/expressions has been quite wrong since the change to iterators.  This updates the docs to make them relevant to how for loops work now, if not very in-depth.  There may be a need for updates giving more depth on how they work, such as detailing what method calls they make, but I don't know enough about the implementation to include that.

10 years agoauto merge of #9097 : michaelwoerister/rust/namespaces, r=jdm
bors [Wed, 11 Sep 2013 13:26:05 +0000 (06:26 -0700)]
auto merge of #9097 : michaelwoerister/rust/namespaces, r=jdm

Who would have thought that namespaces are such a can of worms `:P` This is mostly because of some GDB idiosyncrasies (does not use namespace information but linkage-name attributes for displaying items contained in namespaces, also cannot handle functions lexically nested within functions), monomorphization, and information about external items only available from metadata.

This pull request tries to tackle the problem anyway:
* The `DW_AT_linkage_name` for functions is generated just to make GDB display a proper namespace-enabled function name. To this end, a pseudo-mangled name is generated, not corresponding to the real linkage name. This approach shows some success and could be extended to make GDB also show proper parameter types.
* As GDB won't accept subprogram DIEs nested within other subprogram DIEs, the `debuginfo` module now generates a *companion namespace* for each functions (iff needed). A function `fn abc()` will get a companion namespace with name `abc()`, which contains all items (modules, types, functions) declared within the functions scope. The real, proper solution, in my opinion, would be to faithfully reflect the program's lexical structure within DWARF (which allows arbitrary nesting of DIEs, afaik), but I am not sure LLVM's source level debugging implementation would like that and I am pretty sure GDB won't support this in the foreseeable future.
* Monomorphization leads to functions and companion namespaces like `somelib::some_func<int, float>()::some_other_function<bool, bool, bool>()`, which I think is the desired behaviour. There is some design space here, however. Maybe you people prefer `somelib::some_func()::some_other_function<bool, bool, bool>()` or `somelib::some_func()::some_other_function::<int, float, bool, bool, bool>()`.

The solution will work for now but there are a few things on my 'far future wish list':
* A real specification somewhere, what language constructs are mapped to what DWARF structures.
* Proper tests that directly compare the generated DWARF information to the expected results (possibly using something like [pyelftools](https://github.com/eliben/pyelftools) or llvm-dwarfdump)
* A unified implementation for crate-local and crate-external items (which would possibly involve beefing up `ast_map::path` and metadata a bit)

Any comments are welcome!

Closes #1541
Closes #1542 (there might be other issues with function name prettiness, but this specific issue should be fixed)
Closes #7715 (source locations for structs and enums are now read correctly from the AST)

10 years agoAdd a test for extra::rl.
Huon Wilson [Wed, 11 Sep 2013 11:34:58 +0000 (21:34 +1000)]
Add a test for extra::rl.

This test has to be run by a human, to check inputs etc. Fortunately, it
won't bitrot (syntactically, or type-check-ly; it might bitrot
semantically), as it is designed so that the test runner compiles it with
`--cfg robot_mode`, which is used to disable the actual running of code.

10 years agoextra: improvements & bug fixes to rl.
Huon Wilson [Wed, 11 Sep 2013 11:31:14 +0000 (21:31 +1000)]
extra: improvements & bug fixes to rl.

- Removes a layer of indirection in the storage of the completion
  callback.
- Handles user tab completion in a task in which `complete` hasn't been
  properly. Previously, if `complete` was called in one task, and `read`
  called in another, attempting to get completions would crash. This
  makes the completion handlers non-ambiguously task-local only.
- Fix a mismatch in return values between the Rust code and linenoise.

10 years agoextra: stop rl from leaking each line that is read.
Huon Wilson [Tue, 10 Sep 2013 15:04:13 +0000 (01:04 +1000)]
extra: stop rl from leaking each line that is read.

10 years agoextra: use a mutex to wrap linenoise calls and make them threadsafe.
Huon Wilson [Tue, 10 Sep 2013 14:50:47 +0000 (00:50 +1000)]
extra: use a mutex to wrap linenoise calls and make them threadsafe.

Fixes #3921.

10 years agodebuginfo: Renamed NamespaceTree to NamespaceTreeNode.
Michael Woerister [Wed, 11 Sep 2013 12:19:56 +0000 (14:19 +0200)]
debuginfo: Renamed NamespaceTree to NamespaceTreeNode.

10 years agoauto merge of #9107 : catamorphism/rust/rustpkg-command-line-flags, r=brson
bors [Wed, 11 Sep 2013 12:16:04 +0000 (05:16 -0700)]
auto merge of #9107 : catamorphism/rust/rustpkg-command-line-flags, r=brson

r? @brson rustpkg now accepts most of rustc's command-line arguments and passes
them along to rustc when building or installing.

A few rarely-used arguments aren't implemented yet.

rustpkg doesn't support flags that don't make sense with rustpkg
(for example, --bin and --lib, which get inferred from crate file names).

Closes #8522

10 years agoauto merge of #9007 : dcrewi/rust/random-bigints, r=huonw
bors [Wed, 11 Sep 2013 10:11:05 +0000 (03:11 -0700)]
auto merge of #9007 : dcrewi/rust/random-bigints, r=huonw

10 years agoauto merge of #9093 : pnkfelix/rust/fsk-remove-oldvisit, r=alexcrichton
bors [Wed, 11 Sep 2013 08:46:07 +0000 (01:46 -0700)]
auto merge of #9093 : pnkfelix/rust/fsk-remove-oldvisit, r=alexcrichton

10 years agoauto merge of #9013 : alexcrichton/rust/generated-unsafe-blocks, r=sanxiyn
bors [Wed, 11 Sep 2013 07:36:07 +0000 (00:36 -0700)]
auto merge of #9013 : alexcrichton/rust/generated-unsafe-blocks, r=sanxiyn

This way syntax extensions can generate unsafe blocks without worrying about them generating unnecessary unsafe warnings. Perhaps a special keyword could be added to be used in macros, but I don't think that's the best solution.

Currently if you use `format!` and friends in an `unsafe` block you're guaranteed to get some unused-unsafe warnings which is unfortunate. We normally do want these warnings, but I'm ok ignoring them in the case of compiler-generated unsafe blocks. I tried to do this in the least intrusive way possible, but others may have better ideas about how to do this.

10 years agoFlag unsafe blocks from format! as compiler-generated
Alex Crichton [Fri, 6 Sep 2013 03:50:10 +0000 (20:50 -0700)]
Flag unsafe blocks from format! as compiler-generated

10 years agoImplement the notion of a "generated unsafe block"
Alex Crichton [Thu, 29 Aug 2013 06:47:26 +0000 (23:47 -0700)]
Implement the notion of a "generated unsafe block"

This way syntax extensions can generate unsafe blocks without worrying about
them generating unnecessary unsafe warnings. Perhaps a special keyword could be
added to be used in macros, but I don't think that's the best solution.