Commit graph

17702 commits

Author SHA1 Message Date
Fedor Indutny
db1a274bf5 io: handle fread() errors
When, occasionally, trying to read directory instead of file, `fread()`
returns `EISDIR` error. And, considering, absence of error handling,
`read_whole_stream()` just loops indefinitely.
2013-05-08 01:04:41 +04:00
bors
452817b854 auto merge of #6292 : thestinger/rust/cleanup, r=brson 2013-05-07 12:42:41 -07:00
bors
5063928300 auto merge of #6290 : brson/rust/issue-3707, r=thestinger
This issue has been fixed in passing.
2013-05-07 11:33:44 -07:00
bors
19d2ba3383 auto merge of #6254 : alexcrichton/rust/issues-5311-4490-better-foldl, r=graydon
Closes #5311 and #4490.

This doesn't change `vec.foldl` because that's still part of `old_iter`, although I could change that as well if necessary.
2013-05-07 10:12:40 -07:00
bors
7b3e036252 auto merge of #6282 : alexcrichton/rust/issue-5517-add-test, r=thestinger
It appears the cause of #5517 was fixed in 0dc6c414, so adding a test so the issue can be closed.
2013-05-07 09:03:42 -07:00
bors
38a6a7a394 auto merge of #6276 : brson/rust/issue-6122, r=graydon 2013-05-07 06:06:42 -07:00
bors
154f3b00e0 auto merge of #6271 : pnkfelix/rust/issue6009-condition-pub-priv-variants, r=graydon
@brson: r?  [please ignore the other one that was accidentally based off master due to back-button-bugs in github.com]

My goal is to resolve the question of whether we want to encourage (by example) consistent use of pub to make identifiers publicly-accessible, even in syntax extensions. (If people don't want that, then we can just let this pull request die.)

This is part one of two. Part two, whose contents should be clear from the FIXME's in this commit, would land after this gets incorporated into a snapshot.

(The eventual goal is to address issue #6009 , which was implied by my choice of branch name, but not mentioned in the pull request, so github did not notice it.)
2013-05-07 05:06:39 -07:00
bors
4023f54deb auto merge of #6255 : brson/rust/nobreakpoint, r=graydon
These breakpoints make it difficult to debug coretest
2013-05-07 03:24:37 -07:00
bors
bdb52e58b4 auto merge of #6251 : thestinger/rust/non_owned, r=pcwalton
Also fixed the docstring on `TC_ONCE_CLOSURE` (was accidentally the same as `TC_MUTABLE`) and shifted the `TC_EMPTY_ENUM` bit left by one since whatever previously used that bit has been removed.
2013-05-07 01:27:38 -07:00
bors
7b2020f2c3 auto merge of #6245 : youknowone/rust/match-range-static, r=graydon
Fix unintended error problem of:
````
static s: int = 1;
static e: int = 42;

fn main() {
    match 7 {
        s..e => (),
         ^~                 error: expected `=>` but found `..`
        _ => (),
    }
}
````
2013-05-07 00:18:37 -07:00
bors
3225870191 auto merge of #6236 : alexcrichton/rust/more-map-methods, r=thestinger
Closes #5392 and #5393

I implemented the pop/swap methods for TrieMap/TreeMap/SmallIntMap, and I also updated all of them such that pop isn't just a remove/insert, but rather it's all done in one operation.

One thing I did notice is that with default methods it'd be really nice to define `insert` and `remove` in terms of `pop` and `swap` (or vice versa, just to have them available).
2013-05-06 23:06:36 -07:00
Alex Crichton
393a409b5d Add pop() and swap() to the Map trait 2013-05-07 01:16:04 -04:00
bors
bf748e5001 auto merge of #6241 : thestinger/rust/rc, r=pcwalton
To provide a reference counted pointer type with deterministic
destruction once managed boxes are switched over to a garbage
collector. Unlike managed boxes, these can be moved instead of just
copied/cloned which is helpful for avoiding reference counts.

Needs #5601 to be fixed in order for safety to be provided without the current ugly workaround of making the pointers contain `Option<@()>` and `Option<@mut ()>` (which are just set to `None`).

@brson: r?
2013-05-06 22:00:37 -07:00
Daniel Micay
d800147abb minor automatic whitespace fixes 2013-05-06 23:57:35 -04:00
Daniel Micay
ebe35f3873 remove borrowck workarounds from the containers 2013-05-06 23:56:36 -04:00
bors
d2f0235a2c auto merge of #6228 : brson/rust/run-destroy, r=brson
These cause valgrind errors in subprocesses. I don't *think* these errors
lead to actual test failures but they are very confusing.
2013-05-06 20:12:37 -07:00
bors
4b6864f219 auto merge of #6226 : alexcrichton/rust/issue-6199, r=brson
I just removed `pub mod` from `core.rc` and then got everything to compile again. One thing I'm worried about is an import like this:

```rust
use a;
use a::b;

mod a {
  pub type b = int;
}
mod b {
  use a;    // bad
  use a::b; // good
}
```

I'm not sure if `use a::b` being valid is a bug or intended behavior (same question about `use a`). If it's intended behavior, then I got around these modules not being public by only importing the specific members that are necessary. Otherwise that probably needs an open issue.
2013-05-06 18:57:40 -07:00
Brian Anderson
4f436a8b85 Enable test for #3707 2013-05-06 18:50:21 -07:00
bors
05460fcd5a auto merge of #6286 : nikomatsakis/rust/issue-5910-dyna-freeze, r=nikomatsakis
This rather sprawling branch refactors the borrow checker and much of the region code, addressing a number of outstanding issues. I will close them manually after validating that there are test cases for each one, but here is a (probably partial) list:

  - #4903: Flow sensitivity
  - #3387: Moves in overloaded operators
  - #3850: Region granularity
  - #4666: Odd loaning errors
  - #6021: borrow check errors with hashmaps
  - #5910: @mut broken

cc #5047

(take 5)
2013-05-06 17:52:52 -07:00
Niko Matsakis
39a119074a appease the tidy gods with respect to a FIXME 2013-05-06 20:27:59 -04:00
Niko Matsakis
cd164cf8b5 Merge remote-tracking branch 'mozilla/incoming' into issue-5910-dyna-freeze 2013-05-06 20:15:27 -04:00
Niko Matsakis
ce45f390dd Remove debug_mem since @graydon said it conflicted with GC changes 2013-05-06 20:14:54 -04:00
Niko Matsakis
8b32bde408 add rust_take_task_borrow_list and rust_set_task_borrow_list to rustrt.def.in 2013-05-06 20:10:19 -04:00
Alex Crichton
d0827e3d36 Add a test for issue 5517 2013-05-06 19:17:55 -04:00
Daniel Micay
3d526d1af3 add task-local reference counted smart pointers
To provide a reference counted pointer type with deterministic
destruction once managed boxes are switched over to a garbage
collector. Unlike managed boxes, these can be moved instead of just
copied/cloned which is helpful for avoiding reference counts.
2013-05-06 17:03:20 -04:00
bors
bd5fd6e42a auto merge of #6150 : yichoi/rust/arm-test-pull, r=brson
Support #5297

install.mk : install-runtime-target added for conveneice
                 automatically push runtime library to android device

test.mk : expanded to support android test automation with adb

compiletest : expanded to support android test automation with adb
2013-05-06 13:15:38 -07:00
Niko Matsakis
2e4790ca06 Merge remote-tracking branch 'mozilla/incoming' into issue-5910-dyna-freeze 2013-05-06 16:10:31 -04:00
Brian Anderson
de8071234f Move core::run tests of process killing into standalone run-pass tests
These cause valgrind errors in subprocesses. I don't *think* these errors
lead to actual test failures but they are very confusing.
2013-05-06 12:50:08 -07:00
Brian Anderson
3cafe905a4 std: Workaround bustage on incoming. #6122 2013-05-06 12:28:51 -07:00
bors
a5891bebc1 auto merge of #6265 : sanxiyn/rust/xc-packed, r=nikomatsakis 2013-05-06 11:30:48 -07:00
Niko Matsakis
0ef4e860da Replace NOTE with FIXME 2013-05-06 14:02:28 -04:00
Felix S. Klock II
1cbf0a84dc Step one for 'proper' pub condition: support pub keyword in form. 2013-05-06 19:05:36 +02:00
bors
b6dea9d41d auto merge of #6263 : bjz/rust/approx-eq, r=erickt
Moving the trait into `core` allows it to be added to the `num::Float` trait.

I have also added and `assert_approx_eq!` macro. This is useful fo making approximate assertions on types that implement the `ApproxEq` trait.

Examples:

~~~rust
// using the default epsilon value
assert_approx_eq!(1.0000001f, 1.0f);

// using a custom epsilon value
assert_approx_eq!(1.000001f, 1.0f, 1.0e-5);

// fails with: "left: 1.00001 does not approximately equal right: 1"
assert_approx_eq!(1.00001f, 1.0f);
~~~
2013-05-06 09:12:37 -07:00
Niko Matsakis
c50a9d5b66 Use rust_try_get_task for compat with new rt, and strenghten assumptions about borrow list 2013-05-06 11:18:59 -04:00
Seo Sanghyeon
502817a9c1 Fix cross-crate packed structs 2013-05-06 23:35:27 +09:00
Niko Matsakis
84f7ecce5c Adust arena test: can no longer allocate recursively 2013-05-06 09:56:17 -04:00
Niko Matsakis
6c0c3a44bd Merge remote-tracking branch 'mozilla/incoming' into issue-5910-dyna-freeze 2013-05-06 09:00:50 -04:00
Niko Matsakis
2ea52a38e5 refinement to technique used to not run regionck 2013-05-06 09:00:37 -04:00
Brendan Zabarauskas
0e2242f6d6 Add assert_approx_eq! macro 2013-05-06 21:51:48 +10:00
Brendan Zabarauskas
0211833008 Move FuzzyEq trait into core::cmp and rename it to 'ApproxEq' 2013-05-06 21:51:07 +10:00
Niko Matsakis
e235f6ca53 remove some unused mut decls and vars 2013-05-06 05:18:23 -04:00
Niko Matsakis
4dc62dfcf3 do not run regionck if there have been type errors 2013-05-06 05:17:36 -04:00
Alex Crichton
44c1e46ef5 Improve lifetimes on foldl/foldr and lift the Copy requirement 2013-05-06 02:21:01 -04:00
Brian Anderson
24de5bb649 core: Remove a call to breakpoint from a test
These breakpoints make it difficult to debug coretest
2013-05-05 20:13:32 -07:00
Niko Matsakis
7b36e34c89 Fix two more write guard failures 2013-05-05 21:05:37 -04:00
Daniel Micay
e7f6c4c754 compile-fail tests for #[non_owned] and #[mutable] 2013-05-05 15:55:32 -04:00
Daniel Micay
bc52224d47 factor out the has_attr checks 2013-05-05 15:50:10 -04:00
Daniel Micay
66842c8576 mark Cell as non-Const with #[mutable] 2013-05-05 15:42:03 -04:00
Daniel Micay
58c0df2af6 add #[non_owned] and #[mutable] attributes 2013-05-05 15:36:26 -04:00
Niko Matsakis
4300d4d2fa Merge remote-tracking branch 'mozilla/incoming' into issue-5910-dyna-freeze
Conflicts:
	src/libcore/core.rc
	src/libcore/hashmap.rs
	src/libcore/num/f32.rs
	src/libcore/num/f64.rs
	src/libcore/num/float.rs
	src/libcore/num/int-template.rs
	src/libcore/num/num.rs
	src/libcore/num/strconv.rs
	src/libcore/num/uint-template.rs
	src/libcore/ops.rs
	src/libcore/os.rs
	src/libcore/prelude.rs
	src/libcore/rt/mod.rs
	src/libcore/unstable/lang.rs
	src/librustc/driver/session.rs
	src/librustc/middle/astencode.rs
	src/librustc/middle/borrowck/check_loans.rs
	src/librustc/middle/borrowck/gather_loans.rs
	src/librustc/middle/borrowck/loan.rs
	src/librustc/middle/borrowck/preserve.rs
	src/librustc/middle/liveness.rs
	src/librustc/middle/mem_categorization.rs
	src/librustc/middle/region.rs
	src/librustc/middle/trans/base.rs
	src/librustc/middle/trans/inline.rs
	src/librustc/middle/trans/reachable.rs
	src/librustc/middle/typeck/check/_match.rs
	src/librustc/middle/typeck/check/regionck.rs
	src/librustc/util/ppaux.rs
	src/libstd/arena.rs
	src/libstd/ebml.rs
	src/libstd/json.rs
	src/libstd/serialize.rs
	src/libstd/std.rc
	src/libsyntax/ast_map.rs
	src/libsyntax/parse/parser.rs
	src/test/compile-fail/borrowck-uniq-via-box.rs
	src/test/compile-fail/regions-infer-borrow-scope-within-loop.rs
	src/test/run-pass/borrowck-nested-calls.rs
2013-05-05 15:11:04 -04:00