Commit Graph

17833 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
45ae3402e0 auto merge of #6294 : sonwow/rust/renamed-test, r=thestinger
Renamed test
2013-05-07 13:57:42 -07:00
Brian Anderson
6bcc3a6c57 Add some tests for local data + borrowed pointers 2013-05-07 13:53:25 -07:00
bors
452817b854 auto merge of #6292 : thestinger/rust/cleanup, r=brson 2013-05-07 12:42:41 -07:00
Brian Anderson
3b6a32d7c9 core::rt: Add a test that rng works with new tasks 2013-05-07 12:08:03 -07:00
Brian Anderson
21aaa7fb13 rt: Eliminate the dependency on rust_kernel from rust_rng 2013-05-07 12:08:03 -07:00
Brian Anderson
4cd51c416b rt: Move win32_require out of the rust_kernel type
This is only used on rust_rng, which I am trying to extricate from
the kernel.
2013-05-07 12:08:00 -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
Seo Sanghyeon
0ed4495ac4 Generate LLVM SIMD vector types 2013-05-08 02:09:19 +09:00
Daniel Micay
96eb1e50a4 arc: mark RWARC as non-Const 2013-05-07 13:03:40 -04:00
Daniel Micay
43165b54e0 rc: remove the managed pointer workaround 2013-05-07 13:02:56 -04: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
Seo Sanghyeon
784e8369ca Remove trailing whitespace 2013-05-08 01:01:31 +09:00
Niko Matsakis
6af447a271 Add test for #4666, which didn't *quite* seem to be covered by
existing tests. The bug itself was fixed as part of recent borrowck
reform.

Fixes #4666.
2013-05-07 11:59:38 -04:00
Niko Matsakis
11f7cb26c2 When autoborrowing a fn in trans, adjust the type of the datum to be &fn.
Fixes #6141.
2013-05-07 11:41:27 -04:00
Seo Sanghyeon
0e052f5685 Add SIMD vector type tests 2013-05-07 23:35:33 +09:00
Seo Sanghyeon
c5a7be624a Add core::simd and define SIMD vector types 2013-05-07 23:35:33 +09:00
Seo Sanghyeon
f3217a5c9c Check SIMD vector types 2013-05-07 23:35:33 +09:00
Seo Sanghyeon
8e0c6fa5b6 Port IRBuilder::CreateVectorSplat 2013-05-07 23:29:19 +09: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
Brendan Zabarauskas
cc51186be0 Add is_normal and classify methods to Float trait 2013-05-07 20:30:51 +10: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
Niko Matsakis
387d6c597a Lift restriction on calling extern C functions, and propagate
the ABI as part of the type of an extern fn. cc #3678
2013-05-07 05:28:39 -04:00
Brendan Zabarauskas
a9ac2b95f4 Add abs_sub method to Signed trait 2013-05-07 19:16:03 +10:00
Brendan Zabarauskas
314b485c9c Fix order of methods 2013-05-07 19:16:03 +10:00
Brendan Zabarauskas
06c5e7f383 Implement exp_m1 and ln_1p as methods for Float
Both expm1 and ln1p have been renamed to exp_m1 and ln_1p in order to be consistent with the underscore usage elsewhere.

The exp_m1 method is used for increased accuracy when doing floating point calculations, so this has been moved from the more general 'Exponential' trait into 'Float'.
2013-05-07 19:16:02 +10:00
Brendan Zabarauskas
9b09dce3e1 Switch to using 'ln' for the natural logarithm and 'log' for arbitrary base logarithms 2013-05-07 19:16:02 +10: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
Sangeun Kim
7455f986a8 Make lint_table static 2013-05-07 16:28:58 +09: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
Young-il Choi
930908aa90 mk: target.mk host.mk fix for duplicated rules of mingw32 after #6235 2013-05-07 15:29:05 +09:00
Young-il Choi
db38ab9ad9 mk: rt.mk regression patch for mingw32 after #6176 2013-05-07 15:26:55 +09: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
Youngsoo Son
dfe608dc99 renamed tests 2013-05-07 14:07:56 +09: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