Commit Graph

21915 Commits

Author SHA1 Message Date
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
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
Brian Anderson
7406c2d0b7 Fix valgrind suppression on mac
This callstack changed when the FFI did. I am still a little frightened by
this suppression.
2013-08-26 17:39:50 -07:00
bors
a8221bd5e2 auto merge of #8438 : cmr/rust/default, r=thestinger 2013-08-26 17:05:57 -07:00
Corey Richardson
6eb924d28e Fix deriving-zero test 2013-08-26 19:47:58 -04:00
Corey Richardson
87d9d37c07 Add a Default trait. 2013-08-26 19:25:53 -04:00
bors
1ac7d809af auto merge of #8712 : catamorphism/rust/rustpkg-issue-7241, r=pcwalton
r? @brson ...multiple workspaces

The test checks that rustpkg uses the first one, rather than complaining
about multiple matches.

Closes #7241
2013-08-26 15:51:15 -07:00
Flaper Fesp
5e80e0cbf4 Decrement unkillable counter before failing 2013-08-27 00:37:08 +02:00
Flaper Fesp
5fc4045d78 Don't make the runtime exit on illegal calls 2013-08-27 00:35:39 +02:00
Tim Chevalier
f3d017cbab rustpkg: Implement --version command-line option
Now, rustpkg --version does something useful!
2013-08-26 15:34:34 -07:00
Flaper Fesp
c4093b4a83 Testing rekillable fails when called from outside an unkillable block 2013-08-27 00:34:17 +02:00
Flaper Fesp
cd92d2c77f Make rekillable consistent with unkillable
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 00:34:16 +02:00
Tim Chevalier
3e4e1a274a rustpkg: Test that different copies of the same package ID can exist in multiple workspaces
The test checks that rustpkg uses the first one, rather than complaining
about multiple matches.

Closes #7241
2013-08-26 15:23:06 -07:00
bors
9cd91c8cc4 auto merge of #8766 : brson/rust/vecfromfn, r=alexcrichton
A recently-enabled test of this is causing valgrind failures.
2013-08-26 13:41:12 -07:00