Commit Graph

21673 Commits

Author SHA1 Message Date
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
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
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
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
Felix S. Klock II
1f13eab3c0 fix typo in rust-mode.el 2013-08-27 12:48:51 +02:00
Huon Wilson
71448d7c37 Rename UnsafeAtomicRcBox to UnsafeArc. Fixes #7674. 2013-08-27 20:12:39 +10:00
bors
947513c4f4 auto merge of #8773 : catamorphism/rust/rustpkg-version-flag, r=anasazi
r? anyone. Now, rustpkg --version does something useful!
2013-08-27 03:00:52 -07:00
Flaper Fesp
df84925b45 Rebased and replaced yield with deschedule 2013-08-27 09:53:31 +02:00
bors
604ab9477a auto merge of #8757 : vadimcn/rust/debug-info-tests, r=brson
Now that new LLVM has landed, the debug info works on Windows as well.   Most existing tests pass, except for the following four, which I left disabled for now:
lexical-scope-in-for-loop
lexical-scope-in-if
lexical-scope-in-match
lexical-scopes-in-block-expression

Also, fixed a small problem with the debug info test runner.
2013-08-26 23:35:54 -07:00
bors
35f975b838 auto merge of #8700 : alexcrichton/rust/better-llvm, r=thestinger
Beforehand, it was unclear whether rust was performing the "recommended set" of
optimizations provided by LLVM for code. This commit changes the way we run
passes to closely mirror that of clang, which in theory does it correctly. The
notable changes include:

* Passes are no longer explicitly added one by one. This would be difficult to
  keep up with as LLVM changes and we don't guaranteed always know the best
  order in which to run passes
* Passes are now managed by LLVM's PassManagerBuilder object. This is then used
  to populate the various pass managers run.
* We now run both a FunctionPassManager and a module-wide PassManager. This is
  what clang does, and I presume that we *may* see a speed boost from the
  module-wide passes just having to do less work. I have no measured this.
* The codegen pass manager has been extracted to its own separate pass manager
  to not get mixed up with the other passes
* All pass managers now include passes for target-specific data layout and
  analysis passes

Some new features include:

* You can now print all passes being run with `-Z print-llvm-passes`
* When specifying passes via `--passes`, the passes are now appended to the
  default list of passes instead of overwriting them.
* The output of `--passes list` is now generated by LLVM instead of maintaining
  a list of passes ourselves
* Loop vectorization is turned on by default as an optimization pass and can be
  disabled with `-Z no-vectorize-loops`


All of these "copies" of clang are based off their [source code](http://clang.llvm.org/doxygen/BackendUtil_8cpp_source.html) in case anyone is curious what my source is. I was hoping that this would fix #8665, but this does not help the performance issues found there. Hopefully i'll allow us to tweak passes or see what's going on to try to debug that problem.
2013-08-26 21:25:55 -07:00
Alex Crichton
73540551e5 Rewrite pass management with LLVM
Beforehand, it was unclear whether rust was performing the "recommended set" of
optimizations provided by LLVM for code. This commit changes the way we run
passes to closely mirror that of clang, which in theory does it correctly. The
notable changes include:

* Passes are no longer explicitly added one by one. This would be difficult to
  keep up with as LLVM changes and we don't guaranteed always know the best
  order in which to run passes
* Passes are now managed by LLVM's PassManagerBuilder object. This is then used
  to populate the various pass managers run.
* We now run both a FunctionPassManager and a module-wide PassManager. This is
  what clang does, and I presume that we *may* see a speed boost from the
  module-wide passes just having to do less work. I have no measured this.
* The codegen pass manager has been extracted to its own separate pass manager
  to not get mixed up with the other passes
* All pass managers now include passes for target-specific data layout and
  analysis passes

Some new features include:

* You can now print all passes being run with `-Z print-llvm-passes`
* When specifying passes via `--passes`, the passes are now appended to the
  default list of passes instead of overwriting them.
* The output of `--passes list` is now generated by LLVM instead of maintaining
  a list of passes ourselves
* Loop vectorization is turned on by default as an optimization pass and can be
  disabled with `-Z no-vectorize-loops`
2013-08-26 20:11:51 -07:00
bors
c0aadfd76c auto merge of #8747 : pnkfelix/rust/fsk-issue6887-fix-emacs-compilation-regexp, r=graydon
Fix #6887
2013-08-26 19:55:57 -07:00
Marvin Löbel
8f17ac9099 Rewrote module tutorial 2013-08-27 04:15:11 +02:00
bors
af99b8d91e auto merge of #8739 : fhahn/rust/ticket_2275, r=brson
This is a pull request for #2275

I've created a small python script to generate test files for a list of keywords (as break do else enum extern false fn for if impl let loop match mod mut priv pub ref return self static struct super true trait type unsafe use while), but I'm not really sure where to put it. I've added the created files as well.

I did not use 

     fn main() {
        let $KW = "foo"; //~ error
        println($KW); //~ error
    } 

as template, because for return, self, ref, loop, mut and break this does not raise an error in the ```println``` line, only in the ```let``` line.
2013-08-26 18:20:56 -07:00
Brian Anderson
063d9ca928 std: Make vec::from_elem failure-safe 2013-08-26 18:17:56 -07:00