Commit graph

9634 commits

Author SHA1 Message Date
Eric Holk
8ab15c0266 Merge branch 'incoming' into newsnap 2012-06-14 20:36:16 -07:00
Lindsey Kuper
77e6573929 Further work on integer literal suffix inference (#1425)
In this commit:

  * Change the lit_int_unsuffixed AST node to not carry a type, since
    it doesn't need one

  * Don't print "(unsuffixed)" when pretty-printing unsuffixed integer
    literals

  * Just print "I" instead of "(integral)" for integral type variables

  * Set up trans to use the information that will be gathered during
    typeck to construct the appropriate constants for unsuffixed int
    literals

  * Add logic for handling int_ty_sets in typeck::infer

  * Clean up unnecessary code in typeck::infer

  * Add missing mk_ functions to middle::ty

  * Add ty_var_integral to a few of the type utility functions it was
    missing from in middle::ty
2012-06-14 20:24:36 -07:00
Graydon Hoare
d953462d03 Complete a data visitor type that does proper pointer-walking. 2012-06-14 19:58:34 -07:00
Eric Holk
d4b6898958 Correctly registering snapshot 2012-06-14 19:39:39 -07:00
Eric Holk
52c38ba886 Merge branch 'incoming' into newsnap 2012-06-14 19:36:22 -07:00
Eric Holk
e5dea14122 Registering snapshot 2012-06-14 19:34:40 -07:00
Tim Chevalier
a214e3abd2 Comments only: annotate FIXME in core::str 2012-06-14 19:32:41 -07:00
Tim Chevalier
d0e1591a6a Comments only: annotate FIXMEs in core::run 2012-06-14 19:32:41 -07:00
Tim Chevalier
70dde68cfb Annotate one FIXME and remove another
...since we probably won't have this kind of typestate.
2012-06-14 19:32:41 -07:00
Tim Chevalier
c96ae78c38 Comments only: annotate FIXMEs in core::os 2012-06-14 19:32:41 -07:00
Tim Chevalier
39d9c30a15 Remove code from parser that was awaiting snapshot
Remove old parser functions as well as support for old-style capture
clauses. Remove remaining old-style capture clauses.
2012-06-14 19:09:02 -07:00
Tim Chevalier
bc507c4ef5 Remove unneeded spawn in std::timer, and annotate a FIXME 2012-06-14 19:09:02 -07:00
Patrick Walton
6969f0f2fc Issue #2572: (trans) Fix self-referential classes. 2012-06-14 18:51:31 -07:00
Tim Chevalier
6b16325f43 Comments only: annotate FIXMEs 2012-06-14 18:46:33 -07:00
Tim Chevalier
dce5d6ab9c whitespace 2012-06-14 18:46:10 -07:00
Tim Chevalier
7ee7ba5955 Remove workaround 2012-06-14 18:21:17 -07:00
Tim Chevalier
7441a90fd9 Comments only: annotate FIXMEs 2012-06-14 18:21:17 -07:00
Michael Sullivan
af60716281 Get an initial implementation of boxed vectors working. 2012-06-14 18:01:05 -07:00
Tim Chevalier
9e9e280446 annotate FIXME in iter-trait 2012-06-14 17:57:22 -07:00
Tim Chevalier
f7dd2d5bd5 Add xfailed test case for issue 2611 2012-06-14 17:56:41 -07:00
Tim Chevalier
8945255559 Comments only: Annotate FIXMEs in libcore 2012-06-14 17:56:41 -07:00
Tim Chevalier
ffc9fff720 In dvec, annotate a FIXME and uncomment append_iter
I uncommented append_iter and made it compile. I hope it wasn't
horribly flawed in some other way... but if so, there was no comment
explaining how.
2012-06-14 17:56:41 -07:00
Tim Chevalier
97bcb20244 Avoid some duplicated typechecking work
There was a FIXME noting that ty::enum_variants and typeck::check::
check_enum_variants both call eval_const_expr. I tried refactoring the
code so that check_enum_variants does all the work and enum_variants
just looks up cached results, but this turned out not to be easy because
several ty functions call enum_variants and it might get invoked on an
enum before that enum item has been typechecked. Instead, I just made
check_enum_variants update the enum_var_cache so that enum_variants
will never call eval_const_expr twice on the same const.
2012-06-14 16:21:53 -07:00
Graydon Hoare
aeb9a2b72c Add zero check/fail paths on div/mod paths. Close #944. 2012-06-14 15:39:24 -07:00
Tim Chevalier
aa4fa2611c Remove an xfail-fast, as this seems to work on Windows now 2012-06-14 15:35:44 -07:00
Tim Chevalier
360d7c2c1d Remove an outdated FIXME, change to use the new //! ERROR syntax 2012-06-14 15:35:44 -07:00
Tim Chevalier
663000ce35 run-pass/autobind seems to work, so un-xfail it 2012-06-14 15:35:44 -07:00
Tim Chevalier
0a6ef35c8c while => for 2012-06-14 15:35:43 -07:00
Tim Chevalier
13d4b61182 Comments only: annotate FIXMEs in tests 2012-06-14 15:35:43 -07:00
Tim Chevalier
1509b091c4 Comments only: annotate FIXMEs in rustdoc 2012-06-14 14:30:17 -07:00
Tim Chevalier
c6462eec30 Comments only: annotate FIXMEs in reflect 2012-06-14 14:13:52 -07:00
Eric Holk
74d2f56f21 Adding move_val and move_val_init intrinsics. 2012-06-14 13:49:41 -07:00
Tim Chevalier
1642df8efa Remove a workaround 2012-06-14 12:40:49 -07:00
Tim Chevalier
fcab11da47 Refactor; annotate a FIXME 2012-06-14 12:24:56 -07:00
Tim Chevalier
24f9f45ac6 Comments only: annotate FIXMEs in typeck::infer 2012-06-14 12:10:48 -07:00
Tim Chevalier
699b14b99d Comments only: annotate a FIXME and remove an obsolete one 2012-06-14 12:07:42 -07:00
Tim Chevalier
730381d936 Annotate and fix FIXMEs in typeck 2012-06-14 12:04:05 -07:00
Tim Chevalier
87af3f3cca Dead code elimination 2012-06-14 11:10:32 -07:00
Patrick Walton
e38eaed978 Add a Num typeclass 2012-06-14 10:55:49 -07:00
Michael Sullivan
a72d469067 Add upcall_malloc_dyn to rustrt.def.in. 2012-06-13 18:36:58 -07:00
Michael Sullivan
591b2802ff Make trans only generate calls to the _dyn malloc upcalls, so we can get rid of the non dyn ones. 2012-06-13 18:00:17 -07:00
Michael Sullivan
4c0d41cffa Add a malloc_dyn upcall for dynamically sized allocations on the shared heap. 2012-06-13 17:59:21 -07:00
Tim Chevalier
e5a5fc2029 Allow impls to be re-exported
It was a little hard for me to believe, but it seems that re-exporting
an impl doesn't work at a, because encoder::encode_info_for_mod requires
that all the impls in the current module's impl map be local (that is,
bound to a value in the current crate's item map). Fixed it.

Closes #2414.
2012-06-13 15:52:00 -07:00
Brian Anderson
1db8515c08 Merge remote-tracking branch 'erickt/master' into incoming 2012-06-13 12:03:13 -07:00
Tim Chevalier
6f95c79b95 Traverse types in reachability
Issue 2526 showed a test case where a library exported only a type
that was a synonym for a class. Because the class's destructor wasn't
getting marked as reachable, its linkage was wrongly getting set to
"internal". The solution is for reachability to traverse types.

Closes #2526.
2012-06-13 11:57:01 -07:00
Lindsey Kuper
cce7327487 Allow trailing commas in import lists. Closes #2582. 2012-06-13 11:53:35 -07:00
Brian Anderson
ce750a7dbc Box AST idents 2012-06-13 11:30:45 -07:00
Michael Sullivan
bdd2000066 Some cleanup in tvec. 2012-06-13 11:17:02 -07:00
Tim Chevalier
920ea63f53 Register snapshots 2012-06-13 10:46:17 -07:00
Erick Tryzelaar
78daa1540c cargo: Recursively copy install fragments
This is useful on OS X in order to handle the .dSYM files.
2012-06-13 09:36:33 -07:00
Erick Tryzelaar
dd17a98a09 Fix cargo not making ./.cargo dir 2012-06-13 09:35:10 -07:00
Erick Tryzelaar
065fa9a462 Make cargo a little more ideomatic 2012-06-13 09:34:43 -07:00
Erick Tryzelaar
11a56c3e91 Add a couple more to_json impls. 2012-06-13 08:30:54 -07:00
Tim Chevalier
11e30b2a73 Forgot to xfail-fast this 2012-06-12 19:05:34 -07:00
Erick Tryzelaar
b361f6c288 Fix json no-implicit-copy warnings 2012-06-12 18:10:19 -07:00
Erick Tryzelaar
2cc0a0e19c std: Remove copy from all the hashmap key type params 2012-06-12 18:10:19 -07:00
Erick Tryzelaar
01118be818 whitespace cleanup 2012-06-12 18:10:19 -07:00
Erick Tryzelaar
48e877a435 Rewrite int/uint helper functions to use refs
This lets us pass them to generic functions.
2012-06-12 18:10:19 -07:00
Erick Tryzelaar
4335ce47f3 Convert most str and vec fns to slices 2012-06-12 18:10:18 -07:00
Erick Tryzelaar
f574cb4ac8 Clean up cargo imports. 2012-06-12 18:10:18 -07:00
Erick Tryzelaar
a816176eb5 std: Add a to_str impl for json::error. 2012-06-12 18:10:18 -07:00
Erick Tryzelaar
ac4ac328ee cargo: remove leading underscores 2012-06-12 18:10:18 -07:00
Tim Chevalier
eadd74b5b6 Test case for previous commit
(basically a stripped-down version of comm, and a "driver" that
constructs a new port)
2012-06-12 17:37:04 -07:00
Tim Chevalier
aa9d2d88d3 Handle class destructors correctly in metadata
This allows destructors to be inlined, which is necessary since
classes can have both ty params and destructors.
2012-06-12 17:37:04 -07:00
Michael Sullivan
35dd717352 Simplify a bunch of trans functions to not need the rust type. Remove some PointerCasts. 2012-06-12 17:01:13 -07:00
Michael Sullivan
ccf4e8cf9a Make vectors contain the right type descriptor. Closes #2536. 2012-06-12 17:01:13 -07:00
Michael Sullivan
4f61dcb026 Introduce an unboxed_vec type 2012-06-12 17:01:13 -07:00
Michael Sullivan
e67b5b25a6 Introduce a SHAPE_UNBOXED_VEC shape in order to seperate out vector logic. 2012-06-12 17:01:13 -07:00
Tim Chevalier
ebdf0c20cd Correct typo in comment 2012-06-12 14:56:26 -07:00
Tim Chevalier
72360970fc Change trans::common::block to be a class
And replace trans::common::block_parent with option<block>. To handle
the recursive self-reference in the block_ class, I had to add a
newtype-like enum "block" which is equivalent to @block_ -- which due
to an interaction with borrowck, resulted in having to change a few
functions in trans::base to take their block argument in ++ mode,
irritatingly enough (but not that irritatingly, since we're supposed to
get rid of modes).
2012-06-12 14:55:44 -07:00
Niko Matsakis
d1ec1d4abb Treat enums with one variant specially in borrowck: #2573 2012-06-12 14:30:14 -07:00
Lindsey Kuper
1655c1a825 Add a test for explicit i suffix on integer literals
This doesn't seem to show up anywhere else in the test suite, even
though it's supposed to be legal.
2012-06-12 14:09:11 -07:00
Lindsey Kuper
8a730a255d Allow trailing comma in vectors. Closes #2482. 2012-06-12 13:03:30 -07:00
Lindsey Kuper
bffb7db8ae syntax: clarify that trailing separators are never required 2012-06-12 11:18:31 -07:00
Michael Sullivan
d04ed0c493 Reorder things in hash_type_structure to make more sense. 2012-06-12 10:58:00 -07:00
Brian Anderson
07bba397c5 core: More stack walking 2012-06-11 22:44:55 -07:00
Graydon Hoare
9f3b12b6c6 Change llsize_real to use LLVMSizeOfTypeInBits. Add comments. 2012-06-11 18:34:24 -07:00
Lindsey Kuper
b75199634a syntax: minor cleanups; making things more idiomatic 2012-06-11 16:49:35 -07:00
Lindsey Kuper
8467279fac Add a new AST node for unsuffixed integer types. 2012-06-11 16:34:56 -07:00
Michael Sullivan
baf58a764b Stop emitting type parameters in shape.rs. 2012-06-11 12:52:49 -07:00
Michael Sullivan
665ba3531d Clean up tydesc declaration to make it clear what is unused. 2012-06-11 12:29:04 -07:00
Michael Sullivan
b22620624c Get rid of a bunch of dead shape code. Closes #2552. 2012-06-11 12:19:40 -07:00
Michael Sullivan
70b79d1e32 Add emacs settings to some runtime files where they were missing. 2012-06-11 12:19:40 -07:00
Tim Chevalier
87d57e4919 Don't treat all class fields as mutable, except in trans
Closes #2550
2012-06-11 10:16:17 -07:00
Brian Anderson
75adeaadb8 cargo: Do builds under ./.cargo/work in local mode
Doing builds outside of the cwd is breaking rustc's logic for
locating crates in ./.cargo/lib.

Ideally, cargo would not be changing directories at all.
2012-06-10 01:50:01 -07:00
Brian Anderson
88906cd097 cargo: Update for recent language changes 2012-06-09 21:01:11 -07:00
Brian Anderson
67eb4e978a Merge remote-tracking branch 'z0w0/cargo-deps'
Conflicts:
	src/cargo/cargo.rs
2012-06-09 19:51:29 -07:00
Brian Anderson
67885ac089 Revert "Merge remote-tracking branch 'z0w0/cargo-deps'"
This reverts commit 106fe8b5e8, reversing
changes made to 748bd12dc7.
2012-06-09 19:20:22 -07:00
Brian Anderson
6ea4047e50 Revert "cargo: Add a FIXME about immutability"
This reverts commit 978ff7972c.
2012-06-09 19:19:10 -07:00
Brian Anderson
978ff7972c cargo: Add a FIXME about immutability 2012-06-09 19:04:31 -07:00
Brian Anderson
106fe8b5e8 Merge remote-tracking branch 'z0w0/cargo-deps'
Conflicts:
	src/cargo/cargo.rs
2012-06-09 17:26:02 -07:00
Brian Anderson
748bd12dc7 bench: xfail-pretty shootout-k-nucleotide 2012-06-09 16:12:28 -07:00
Brian Anderson
03e186cd04 bench: Modify shootout-k-nucleotide to not read from the filesystem 2012-06-09 13:57:18 -07:00
Brian Anderson
a884044066 bench: Increase the difficulty of fasta 2012-06-09 13:25:05 -07:00
Kevin Cantu
c2a9cc9394 Add the Alioth k-nucleotide benchmark
This is not particularly well performing yet (60x slower than C++ or
worse).  I think the slicing and the copies made for the hashmap
are mostly responsible, but YMMV.

By default shootout-fasta writes to stdout and shootout-k-nucleotide
reads from stdin.  To use an intermediate file with a fixed name,
set RUST_BENCH...
2012-06-09 12:58:12 -07:00
Brian Anderson
c1859d4cd0 Fix long lines 2012-06-09 03:42:30 -07:00
Brian Anderson
794f664dd9 syntax: Don't copy source string 2012-06-09 01:01:14 -07:00
Brian Anderson
21087bf1a5 syntax: Intern @strs instead of strs 2012-06-09 00:53:34 -07:00
Brian Anderson
8fea5260c2 core: Don't deadlock on io streams in run::program_output
We can't just read all of stdout before stderr or it will cause
deadlocks for children that want to write a lot to stderr

I could not come up with an obvious cross-platform way to easily
test this.
2012-06-08 23:00:59 -07:00
Brian Anderson
c91d5aa95c Merge pull request #2560 from bstrie/num
Allow multiple `num` impls to be imported at once
2012-06-08 22:59:53 -07:00
Ben Striegel
d14d4155de Allow multiple num impls to be imported at once
If we import num::num, it gets reexported implicitly and causes collisions if
you try to import (for example) int::num and i8::num at the same time.
2012-06-09 01:36:26 -04:00
Niko Matsakis
7ec171f6ae make a copy so vec is not living in mutable memory 2012-06-08 20:39:11 -07:00
Niko Matsakis
013fc92423 remove alias analysis and replace with borrowck
This reverts commit 7ef825bb60.
2012-06-08 20:39:11 -07:00
Niko Matsakis
1351117aa8 avoid rooting @ptrs that live in immutable, stable memory 2012-06-08 20:39:11 -07:00
Niko Matsakis
a628f7f47e make ccx/tcx/sess methods on bcx pure 2012-06-08 20:39:10 -07:00
Patrick Walton
5a04069042 Merge pull request #2559 from mozilla/incoming
Incoming
2012-06-08 20:37:57 -07:00
Patrick Walton
436b77c9f8 Revert "syntax: Remove a couple of implicit copies" due to test failures
This reverts commit 46b12d3e05.
2012-06-08 19:15:17 -07:00
Graydon Hoare
56c6c65186 Add preliminary test of walking data pointers via reflection. 2012-06-08 19:00:59 -07:00
Brian Anderson
45f2926144 core: Inline unsigned range function 2012-06-08 18:49:50 -07:00
Brian Anderson
629f1b2e37 Merge pull request #2557 from bstrie/inlinerange
Inline `range` for all integral types
2012-06-08 18:48:56 -07:00
Ben Striegel
89e424d373 Inline range for all integral types 2012-06-08 21:18:41 -04:00
Patrick Walton
8ce0215f1b core: "inlune" is not an attribute 2012-06-08 17:57:39 -07:00
Patrick Walton
46b12d3e05 syntax: Remove a couple of implicit copies 2012-06-08 17:56:17 -07:00
Patrick Walton
fbd583bde2 core: Implement string equal natively to save a call into the shape code. Shaves a couple of seconds off rustc. 2012-06-08 17:38:12 -07:00
Lindsey Kuper
0863ac25a7 Update READMEs and comments to reflect "rustsyntax" -> "syntax" change 2012-06-08 17:24:14 -07:00
Lindsey Kuper
7c0fd858db Get rid of little-used logging fns in util::common. Closes #2553.
Also got rid of a bunch of commented-out logging statements and
generally cleaned up the logging situation, mostly in typestate.
2012-06-08 17:22:19 -07:00
Patrick Walton
c7c37debe4 syntax: Use a ring buffer instead of a dvec and save a bunch of copies. Shaves a second or two off rustc. 2012-06-08 17:17:31 -07:00
Graydon Hoare
7a699852cb Pass names of fields and variants when reflecting. 2012-06-08 16:41:38 -07:00
Graydon Hoare
d182c14247 Visit the substructure for classes and enums as well. 2012-06-08 15:36:02 -07:00
Lindsey Kuper
b8af02e219 WIP on issue #1425: mostly infrastructure changes. 2012-06-08 15:20:21 -07:00
Lindsey Kuper
d8d76738ec std: Typo fix in docs. 2012-06-08 15:02:50 -07:00
Niko Matsakis
9105cb6d5d revise map interface so that K need not be copyable 2012-06-08 14:35:11 -07:00
Niko Matsakis
fc9eadf75b profile LLVM cleanup insns 2012-06-08 14:34:55 -07:00
Graydon Hoare
dc94ccc4a4 More work on reflect, only missing enum and class substructures. 2012-06-08 13:26:15 -07:00
Brian Anderson
7a74545e97 Convert reinterpret_cast + forget to 'transmute' 2012-06-08 10:58:46 -07:00
Brian Anderson
f12adcbf93 core: Add unsafe::transmute
Like reinterpret_cast + forget
2012-06-08 10:58:46 -07:00
Patrick Walton
75d9ec100b Merge pull request #2545 from mozilla/incoming
Incoming
2012-06-07 23:29:20 -07:00
Patrick Walton
cdcae39ba3 syntax: Remove some more implicit copies 2012-06-07 22:51:00 -07:00
Brian Anderson
95b9d538b8 Use #[cfg(unix)] and #[cfg(windows)] everywhere 2012-06-07 22:28:00 -07:00
Patrick Walton
fd85239119 syntax: Remove several deep copies that were happening due to misuse of parse_seq 2012-06-07 22:09:27 -07:00
Patrick Walton
26faa37305 syntax: Add a lot of copy keywords 2012-06-07 21:53:47 -07:00
Patrick Walton
847c5e4e98 syntax: Remove a bunch of implicit copies 2012-06-07 20:12:05 -07:00
Brian Anderson
7ef825bb60 Revert "remove alias analysis and replace with borrowck"
18s perf regression compiling rustc with opts

This reverts commit 7f6ee0ce0d.
2012-06-07 19:42:27 -07:00
Brian Anderson
c058f1d992 core: Remove transitional code 2012-06-07 19:12:12 -07:00
Patrick Walton
7571ee85c4 Merge branch 'incoming' 2012-06-07 18:50:42 -07:00
Patrick Walton
e158ce8a9d Add neg() to the num iface 2012-06-07 18:27:10 -07:00
Patrick Walton
d8b113f209 std: Implement a fuzzy-equal interface 2012-06-07 18:12:50 -07:00
Michael Sullivan
45cc95fa22 Remove a bunch of old "remove after snapshot" code. 2012-06-07 18:05:12 -07:00
Patrick Walton
02b7089e15 libcore: Add a num typeclass 2012-06-07 17:25:54 -07:00
Michael Sullivan
bf0d6a77c5 Reorder the arms of sty. 2012-06-07 17:09:23 -07:00
Niko Matsakis
7f6ee0ce0d remove alias analysis and replace with borrowck
cc #2540
2012-06-07 16:46:57 -07:00
Tim Chevalier
8c6d439a81 Comments only: annotate remainder of FIXMEs in typestate 2012-06-07 16:29:41 -07:00
Patrick Walton
3d7400f3ac Add a Num typeclass 2012-06-07 16:08:38 -07:00
Tim Chevalier
64b5ae27ac Start annotating FIXMEs in typestate; also some minor refactoring 2012-06-07 16:01:45 -07:00
Tim Chevalier
6b2cfe793b Remove an irrelevant comment
Comment doesn't seem relevant anymore because the block comment at the
very beginning of the file says it's a bad idea.
2012-06-07 15:13:35 -07:00
Tim Chevalier
d68c5cc399 Use c_ulonglong now that it works in FFI, etc...
Annotate FIXMEs; remove obsolete FIXMEs; remove an unnecessary
PointerCast.
2012-06-07 15:13:35 -07:00
Tim Chevalier
dc77386494 Remove obsolete comment
This comment seems to be no longer relevant, since we do have
user-defined vector sizes now (and they don't use the T_vec type)
2012-06-07 15:13:35 -07:00
Tim Chevalier
88f03743b0 Comments only: annotate FIXMEs 2012-06-07 15:13:35 -07:00
Graydon Hoare
9ee0137018 Refactor reflect.rs, begin visiting type substructures. 2012-06-07 13:51:41 -07:00
Tim Chevalier
a494cc1598 Comments only: annotate FIXMEs 2012-06-07 13:49:01 -07:00