Commit Graph

21888 Commits

Author SHA1 Message Date
Vadim Chugunov
546e2ae850 Added libstd and libextra unit tests to check-fast target. 2013-08-28 01:44:12 -07:00
Florian Hahn
8557219cd8 Add tests for ref in closure parameter list, closes #5239 2013-08-28 10:12:28 +02:00
Alex Crichton
e3662b1880 Remove offset_inbounds for an unsafe offset function 2013-08-27 23:22:52 -07:00
bors
78c5f97a09 auto merge of #8805 : jfager/rust/remove-hashutil, r=alexcrichton 2013-08-27 23:05:35 -07:00
bors
b8d1fa3994 auto merge of #8645 : alexcrichton/rust/issue-6436-run-non-blocking, r=brson
This overhauls `std::run` to instead run on top of libuv. This is *not* in a mergeable state, I've been attempting to diagnose failures in the compiletest suite. I've managed to find a fair number of bugs so far, but I still  don't seem to be done yet.

Notable changes:
* This requires upgrading libuv. From the discussion on #6567, I took libuv master from a few days ago, applied one patch to fix process spawning with multiple event loops in libuv, and pushed to my own fork
* The build system for libuv has changed since we last used it. There's some extra checkout from a google build system which apparently does all the magic if you don't want to require autotools, and the google system just requires python. I updated the Makefile to get this build system and build libuv with it instead. This is untested on windows and arm, and both will probably need to see some improvement.
* This required adding some pipe bindings to libuv as well. Currently the support is pretty simple and probably completely unsafe for pipes, but you at least get read/write methods. This is necessary for capturing output of processes.
* I didn't redesign `std::run` at all, I simply tried to reimplement all the existing functionality on top of libuv. Some functions ended up dying, but nothing major. All uses of `std::run` in the compiler still work just fine.

I'm not quite sure how the rest of the runtime deals with this, but I marked process structures as `no_send` because the waiting/waking up has to happen in the same event loop right now. If processes start migrating between event loops then very bad things can happen. This may be what threadsafe I/O would fix, and I would be more than willing to rebase on that if it lands first.

Anyway, for now I wanted to put this up for review, I'm still investigating the corruption/deadlock bugs, but this is in an *almost* workable state. Once I find the bugs I'll also rebase on the current master.
2013-08-27 21:55:42 -07:00
klutzy
eaa565829d rustc: Use "main" entry point on Windows
Fixes #8510.
2013-08-28 13:43:11 +09:00
Alex Crichton
06a7195e9e Consolidate local_data implementations, and cleanup
This moves all local_data stuff into the `local_data` module and only that
module alone. It also removes a fair amount of "super-unsafe" code in favor of
just vanilla code generated by the compiler at the same time.

Closes #8113
2013-08-27 21:29:11 -07:00
Alex Crichton
4635644746 Fix merge fallout 2013-08-27 20:53:26 -07:00
Alex Crichton
2ad05ae014 Fix various issues associated with building on windows 2013-08-27 20:46:43 -07:00
Alex Crichton
b89e1c000e Implement process bindings to libuv
Closes #6436
2013-08-27 20:46:43 -07:00
Alex Crichton
ed204257a0 Upgrade libuv to the current master + our patches
There were two main differences with the old libuv and the master version:

1. The uv_last_error function is now gone. The error code returned by each
   function is the "last error" so now a UvError is just a wrapper around a
   c_int.
2. The repo no longer includes a makefile, and the build system has change.
   According to the build directions on joyent/libuv, this now downloads a `gyp`
   program into the `libuv/build` directory and builds using that. This
   shouldn't add any dependences on autotools or anything like that.

Closes #8407
Closes #6567
Closes #6315
2013-08-27 20:46:17 -07:00
bors
f22b4b1698 auto merge of #8697 : kballard/rust/rustpkg-no-args, r=catamorphism
`rustpkg build` et al were only checking one directory up to see if it
was in a dir named "src". Ditch that entirely and instead check if the
cwd is descended from any of the workspace paths. Besides being more
intelligent about whether or not something is a workspace, this also
allows for package ids composed of multiple path components.

r? @catamorphism
2013-08-27 20:45:40 -07:00
bors
578e680477 auto merge of #8802 : pcwalton/rust/compile-speed, r=brson
r? @brson
2013-08-27 19:35:44 -07:00
Patrick Walton
aac9d6eee9 librustc: Fix merge fallout 2013-08-27 19:09:27 -07:00
Kevin Ballard
eafa63f787 Handle rustpkg build, etc. when given no args properly
`rustpkg build` et al were only checking one directory up to see if it
was in a dir named "src". Ditch that entirely and instead check if the
cwd is descended from any of the workspace paths. Besides being more
intelligent about whether or not something is a workspace, this also
allows for package ids composed of multiple path components.
2013-08-27 19:06:38 -07:00
Patrick Walton
2bd46e767c librustc: Fix problem with cross-crate reexported static methods. 2013-08-27 18:47:59 -07:00
Patrick Walton
6c37e3b7f8 librustc: Implement basic lazy implementation loading.
This is only for implementations defined in the same crate as the trait they
implement.
2013-08-27 18:47:59 -07:00
Patrick Walton
ff7b8d6d88 librustc: Implement lazy module loading. 2013-08-27 18:47:58 -07:00
Patrick Walton
1bbb1e06f1 librustc: Remove each_path.
This does not implement lazy symbol resolution yet.
2013-08-27 18:47:58 -07:00
Patrick Walton
1ad2239f62 libstd: Fix merge fallout. 2013-08-27 18:47:58 -07:00
Patrick Walton
d9bb78efdf librustc: Stop calling each_path in coherence.
10% win or so for small crates.
2013-08-27 18:47:58 -07:00
Patrick Walton
4f32a2d854 librustc: Fix merge fallout. 2013-08-27 18:47:57 -07:00
Patrick Walton
5c9f5ec397 test: xfail a test that relies on old path behavior. 2013-08-27 18:47:57 -07:00
Patrick Walton
a20af8b276 librustc: Convert check loans to use the new visitor 2013-08-27 18:47:57 -07:00
Patrick Walton
8693943676 librustc: Ensure that type parameters are in the right positions in paths.
This removes the stacking of type parameters that occurs when invoking
trait methods, and fixes all places in the standard library that were
relying on it. It is somewhat awkward in places; I think we'll probably
want something like the `Foo::<for T>::new()` syntax.
2013-08-27 18:47:57 -07:00
Patrick Walton
3b6314c39b librustc: Add support for type parameters in the middle of paths.
For example, `foo::<T>::bar::<U>`.

This doesn't enforce that the type parameters are in the right
positions, however.
2013-08-27 18:46:51 -07:00
Patrick Walton
5c3504799d librustc: Remove &const and *const from the language.
They are still present as part of the borrow check.
2013-08-27 18:46:51 -07:00
Jason Fager
da559b2b36 Replace HashUtil w/ default method on Hash 2013-08-27 21:41:10 -04:00
bors
32117132bd auto merge of #8799 : fhahn/rust/ticket_5783, r=catamorphism
I've added a testcase, as mentioned in #5783
2013-08-27 18:20:44 -07:00
bors
58d6eb5048 auto merge of #8797 : nikomatsakis/rust/issue-8625-assign-to-andmut-in-borrowed-loc-2, r=pcwalton
Fixes for #8625 to prevent assigning to `&mut` in borrowed or aliasable locations. The old code was insufficient in that it failed to catch bizarre cases like `& &mut &mut`. 

r? @pnkfelix
2013-08-27 17:05:46 -07:00
bors
d5c144a4cd auto merge of #8792 : adridu59/rust/master, r=catamorphism
`target_library_in_workspace` is imported but unused:
~/rust/src/librustpkg/tests.rs:21:48: 21:75 warning: unused import [-W unused-imports (default)]
2013-08-27 15:50:50 -07:00
bors
7f32ea8820 auto merge of #8771 : thestinger/rust/repr, r=catamorphism 2013-08-27 14:35:49 -07:00
Florian Hahn
890b589491 Add test for #5783 2013-08-27 23:27:10 +02:00
Niko Matsakis
8c09865b66 Remove remnants of implicit self 2013-08-27 16:49:06 -04:00
Daniel Micay
803f941867 reflect: rm unused visit_{var,var_integral,constr} 2013-08-27 16:31:48 -04:00
Daniel Micay
ac4f0df120 repr: include mutability qualifier in visit_ptr 2013-08-27 16:31:48 -04:00
Daniel Micay
c2bc59e086 repr: print integer/float suffixes 2013-08-27 16:31:45 -04:00
bors
3ab0561b00 auto merge of #8790 : huonw/rust/unsafearc, r=thestinger
`UnsafeAtomicRcBox` &rarr; `UnsafeArc` (#7674), and `AtomicRcBoxData` &rarr; `ArcData` to reflect this.

Also, the inner pointer of `UnsafeArc` is now `*mut ArcData`, which avoids some transmutes to `~`: i.e. less chance of mistakes.
2013-08-27 13:20:47 -07:00
Niko Matsakis
35a4177550 Extend aliasability check to uncover & &mut &mut and the like 2013-08-27 15:45:19 -04:00
bors
c822d1070a auto merge of #8581 : FlaPer87/rust/issue/8232, r=bblum
As for now, rekillable is an unsafe function, instead, it should behave
just like unkillable by encapsulating unsafe code within an unsafe
block.

This patch does that and removes unsafe blocks that were encapsulating
rekillable calls throughout rust's libs.

Fixes #8232
2013-08-27 11:35:51 -07:00
Flaper Fesp
cc59d96097 Trailing space 2013-08-27 20:09:57 +02:00
Daniel Micay
20567a0c3c vec: implement DeepClone 2013-08-27 13:47:15 -04:00
bors
7841b77676 auto merge of #8772 : thestinger/rust/option, r=anasazi
Closes #6002 

There is consensus that the current implementation should be changed or
removed, so removing it seems like the right decision for now.
2013-08-27 10:20:52 -07:00
Daniel Micay
9a63be1dbd option: rm implementation of Add
Closes #6002

There is consensus that the current implementation should be changed or
removed, so removing it seems like the right decision for now.
2013-08-27 13:18:57 -04:00
bors
0baa92707a auto merge of #8789 : pnkfelix/rust/fsk-fix-typo-in-rust-mode.el, r=pnkfelix
Fix #6887.  (or rather, a bug injected by my prior commit for fixing that bug.)
2013-08-27 08:00:51 -07:00
bors
4fa09e08ed auto merge of #8777 : Kimundi/rust/doc_stuff, r=cmr 2013-08-27 06:45:50 -07:00
Adrien Tétar
b29696a08a librustpkg/tests.rs: cleanup unused import 2013-08-27 14:45:40 +02:00
bors
932d7b9465 auto merge of #8780 : brson/rust/from_elem, r=thestinger 2013-08-27 05:30:54 -07:00
Huon Wilson
a79575529d std: use ArcData rather than c_void in UnsafeArc.
This means that fewer `transmute`s are required, so there is less
chance of a `transmute` not having the corresponding `forget`
(possibly leading to use-after-free, etc).
2013-08-27 22:24:34 +10:00
bors
d9b0d4b603 auto merge of #8779 : brson/rust/macsupp, r=thestinger
This callstack changed when the FFI did. I am still a little frightened by
this suppression.

cc #8253
2013-08-27 04:15:54 -07:00