Commit Graph

687 Commits

Author SHA1 Message Date
Eric Holk
0470abe1d2 Allow some resources to be considered const. 2012-05-31 13:55:54 -07:00
Kevin Cantu
7dcbaedd32 Rename librustsyntax to libsyntax
Per issue #2418.
2012-05-31 11:15:00 -07:00
Brian Anderson
41b02b7c57 Merge remote-tracking branch 'brson/self-describing-uniques'
Conflicts:
	src/snapshots.txt
2012-05-31 01:26:05 -07:00
Brian Anderson
151de909c1 rustc: Do less work still in typestate 2012-05-30 23:20:31 -07:00
Brian Anderson
4b7e40d817 rustc: Remove debug logging 2012-05-30 21:23:34 -07:00
Brian Anderson
a2bbdd3f52 rt: Remove upcall_shared_malloc/free/realloc 2012-05-30 21:23:34 -07:00
Brian Anderson
80dc2e11a1 rustc: Remove the last use of upcall_shared_malloc 2012-05-30 21:23:34 -07:00
Brian Anderson
54d42c4d74 rustc: Make trans handle self-describing strings 2012-05-30 21:23:34 -07:00
Brian Anderson
09a1b94907 Various changes for self-describing vecs 2012-05-30 21:23:34 -07:00
Brian Anderson
c6a23cddfb rustc: Make unique closures use the new unique allocator 2012-05-30 21:23:34 -07:00
Brian Anderson
654f7e3086 rustc: Make unique boxes self-describing 2012-05-30 21:23:34 -07:00
Brian Anderson
45933ca485 rustc: Add some methods for trans for mallocing uniques 2012-05-30 21:23:34 -07:00
Brian Anderson
508ccca014 rt: Add upcall_exchange_malloc/free 2012-05-30 21:23:33 -07:00
Brian Anderson
6d37c90ce6 rustc: Remove tuplify_cbox_ty. Unused 2012-05-30 21:23:33 -07:00
Brian Anderson
02dde781eb rustc: Don't typestate fns that don't have constrained function calls 2012-05-30 17:48:05 -07:00
Michael Sullivan
ea8d4d7f17 Properly sign extend array indexes. Closes #2468. 2012-05-30 17:09:52 -07:00
Michael Sullivan
7fee392de5 Handle differing signedness in constant shifts. Closes #2426. 2012-05-30 15:03:24 -07:00
Eric Holk
f49b891ce5 Include capture clauses when generating metadata.
This may fix the bug that's blocking Issue #2441.
2012-05-30 12:03:51 -07:00
Niko Matsakis
1f4b3cfc36 zero out alloca for preserving values
conservatively do it always for now
2012-05-30 11:26:15 -07:00
Niko Matsakis
555492e427 port alt to dvec 2012-05-30 11:26:15 -07:00
Niko Matsakis
79b3dedac3 allow for loop bodies 2012-05-30 11:26:15 -07:00
Niko Matsakis
653a1f8781 integrate purity into type 2012-05-30 11:26:15 -07:00
Niko Matsakis
22a10f0e4a refactor region manip. to remove redundancy, get closer to fn subtyping
also: remove "auto-mode-matching" for implemented interfaces, as it
is complex and interacts poorly with classes

cc #2263
2012-05-30 11:04:12 -07:00
Niko Matsakis
e6b9db0884 refactor region manipulation routines to eliminate duplication
fn subtyping is starting to work, but it's exposing bugs in the
code which checks for iface conformance, which doesn't properly
skolemize the self region
2012-05-30 11:04:12 -07:00
Michael Sullivan
b744f52620 Make heap closures always require a capture clause to capture mutable variables. Closes #2446. 2012-05-30 10:46:22 -07:00
Brian Anderson
736ff34e8a rustc: Move filesearch into metadata mod
It's not that related to metadata, but metadata needs it and it will
probably be useful for doing dynamic loading.
2012-05-29 20:38:49 -07:00
Tim Chevalier
3f3c9caf4d Handle poststates of breaking loops correctly in typestate
The poststate should be one where all predicates are assumed false,
rather than the unchanged prestate.

Closes #2374
2012-05-29 18:22:38 -07:00
Tim Chevalier
8d7765be82 Resolve bounds in iface types
Closes #2311
2012-05-29 16:50:21 -07:00
Niko Matsakis
f90228b8a8 make all arguments modes immutable
note: you can still move from copy/move mode args
2012-05-29 16:22:17 -07:00
Niko Matsakis
47375439ed remove useless invocations of universally_quantify_from_sty() in method lookup 2012-05-29 16:20:54 -07:00
Niko Matsakis
37b78b48e3 modify shape code to only emit monomorphized enums (#2444)
this is hacky, but shape code is going away anyway and I didn't
want to invest too much effort into it
2012-05-29 15:12:36 -07:00
Tim Chevalier
ccc7651b48 In reachability, don't ignore nested items
Reachability was considering nested items to be unreachable, which
was causing the bug in #2383. Once I fixed that, I also had to make
impl::make_impl_vtable instantiate methods where necessary, before
calling monomorphic_fn.

Closes #2383
2012-05-29 14:40:35 -07:00
Michael Sullivan
5d1c29912d Fix an error message to not refer to "block type". Closes #2423. 2012-05-29 12:18:59 -07:00
Eric Holk
aa2efc05ea Adding shared_arc to hide some of the tedium of sharing an arc between tasks.
Also added some asserts and logging to trans.

Modified graph500 to use the shared_arc, but this unfortunately doesn't work due to #2444.
2012-05-29 10:43:19 -07:00
Erick Tryzelaar
68e5d8daa3 Merge pull request #2455 from erickt/master
Fleshing out result methods
2012-05-28 18:27:30 -07:00
Graydon Hoare
e0f0c5c1ab Remove bad Load in make_visit_glue, un-xfail reflect-visit-type.rs. 2012-05-28 13:19:31 -07:00
Erick Tryzelaar
46173e98ef Rename result::{iter,map,map2} to add _vec suffix
The result module doesn't follow the standard iter/map pattern
that we use in the rest of the library. So to
2012-05-28 12:03:25 -07:00
Brian Anderson
432c6cbde9 core: Make range follow the for loop protocol 2012-05-26 02:28:00 -07:00
Lindsey Kuper
e11742de32 More refactoring on a quest to understand region types. 2012-05-25 17:55:55 -07:00
Niko Matsakis
269bc6fb5c fix warning 2012-05-25 17:14:17 -07:00
Niko Matsakis
98740a59da detect ambig. calls to iface bounds, use transactions
cc #2433
2012-05-25 17:04:05 -07:00
Michael Sullivan
93633ea734 Add an internal notion of 'implicit copyability' and use it to warn when implicitly copying mutable data and some unique data. Closes #2448. 2012-05-25 16:53:34 -07:00
Michael Sullivan
8668d06400 Get rid of many implicit copies as a preliminary to Issue #2448. 2012-05-25 16:39:35 -07:00
Michael Sullivan
174f789e0b Add hack to silence the annoying liveness warning in trans/base.rs. 2012-05-25 15:34:09 -07:00
Niko Matsakis
9e6a068034 replace last_use with liveness info 2012-05-25 14:37:30 -07:00
Niko Matsakis
62fe587f81 revisit error message; create spill map 2012-05-25 14:37:30 -07:00
Lindsey Kuper
123c5c4315 typeck: cleanup/refactoring 2012-05-25 11:35:42 -07:00
Lindsey Kuper
f7cb7b06d5 typeck: Minor cleanup 2012-05-25 11:35:42 -07:00
Lindsey Kuper
7e70412711 Some refactoring and WIP on issue #2263. 2012-05-24 16:48:44 -07:00
Lindsey Kuper
ef33c5c9bc Typo fixes in comments. 2012-05-24 16:48:44 -07:00
Eric Holk
8b12892ca2 Convert kinds to strings better for more usable error messages. 2012-05-24 15:06:56 -07:00
Eric Holk
4ffe34cace Updating the comments in kind.rs to better reflect the current state of things. 2012-05-24 15:06:56 -07:00
Eric Holk
8b6bfc96cb Const kind checking. The rules are almost certainly incomplete and unsound... 2012-05-24 15:06:56 -07:00
Eric Holk
d993df74c3 Teach parser and related things to understand const kind bounds. 2012-05-24 15:06:56 -07:00
Niko Matsakis
ccd8d5573e remove dead assignments 2012-05-24 13:35:57 -07:00
Niko Matsakis
f5c51b0a9c remove initedness checking from typestate, as best I could 2012-05-24 09:52:16 -07:00
Niko Matsakis
0d3811e275 improve liveness so it reports unused vars / dead assignments
doesn't warn about pattern bindings yet though
2012-05-24 09:52:16 -07:00
Niko Matsakis
30b47649ea new liveness pass to supercede last_use / initedness 2012-05-24 09:52:03 -07:00
Niko Matsakis
a3be0b1054 fix classes and parameterized ifaces; remove needless self check
ref #1726, #2434
2012-05-24 06:49:40 -07:00
Niko Matsakis
bd573becf5 change region scope of call arguments, old one was unsound
improve error message to describe kind of deref'd ptr using sigil
2012-05-24 05:19:44 -07:00
Niko Matsakis
c9eb9ee612 rewrite purity check to search through scope chain 2012-05-24 05:19:44 -07:00
Eric Holk
5f154770e2 Prevent capturing non-copyable things in closures. 2012-05-23 15:46:43 -07:00
Niko Matsakis
9773a22119 shuffle error messages in borrowck, and prevent it from spewing too many
also, fix a few minor issues it complains about
2012-05-23 12:01:27 -07:00
Eric Holk
8678baab12 Resources are once again not copyable. 2012-05-23 10:27:42 -07:00
Niko Matsakis
e0f59e835e modify borrowck to allow arbitrary borrows in pure scopes 2012-05-23 06:30:29 -07:00
Niko Matsakis
00849191ce refactor loan to not return result<> 2012-05-23 06:30:29 -07:00
Niko Matsakis
01a2e99639 prepare for gather to gather up multiple maps 2012-05-23 06:30:29 -07:00
Brian Anderson
d2ec15bcf1 rustc: Eliminate metadata's dependency on util::common 2012-05-23 00:57:07 -07:00
Brian Anderson
f9d0cde19a syntax: Remove one of the two def_id hashers 2012-05-23 00:45:18 -07:00
Brian Anderson
4756556748 rustc: Move new_def_hash to ast_util 2012-05-23 00:43:02 -07:00
Tim Chevalier
ed357af980 Convert more resource tests to use classes with dtors
And monomorphize dtors correctly.
2012-05-22 22:12:18 -04:00
Brian Anderson
c0a36b71be rustc: Eliminate metadata's dependency on session 2012-05-22 18:07:36 -07:00
Brian Anderson
98b93b6c86 rustc: Eliminate some session deps from metadata::loader 2012-05-22 18:07:36 -07:00
Brian Anderson
c90a047016 rustc: Don't fall back to static libraries when shared isn't found
Nothing on Earth depends on this functionality and it is probably unexpected
2012-05-22 18:07:36 -07:00
Brian Anderson
5b4ab93017 rustc: Add cstore to ty::ctxt so csearch can get at it 2012-05-22 18:07:36 -07:00
Brian Anderson
99c1b2953d syntax: Add diagnostic::expect 2012-05-22 18:07:36 -07:00
Brian Anderson
a32392d032 Merge pull request #2427 from msullivan/shifts
Get rid of the >>> operator and make >> logical or arithmetic depending ...
2012-05-22 17:50:04 -07:00
Michael Sullivan
15cef374b9 Get rid of the >>> operator and make >> logical or arithmetic depending on the signedness. Closes #2417. 2012-05-22 14:59:15 -07:00
Eric Holk
0b2f2cabbe Send is no longer a subkind of copy. This allows for sendable, but non-copyable resources. Closes #2420. 2012-05-22 14:10:32 -07:00
Eric Holk
f213c1f3a8 Represent kinds as a bitfield of capabilities. 2012-05-22 12:48:31 -07:00
Michael Sullivan
8d7f3bd1ca Disallow type parameters to self. Closes #2422. 2012-05-22 11:52:22 -07:00
Niko Matsakis
073f90cdc4 introduce some copies so we are not alting into mut state 2012-05-22 05:21:13 -07:00
Brian Anderson
9aa18c2852 rustc: Move ast_map to the syntax crate 2012-05-21 23:39:27 -07:00
Brian Anderson
47bb1185f2 rustc: Move walk_pat to ast_util
This will allow ast_map to move to the syntax crate
2012-05-21 23:22:08 -07:00
Brian Anderson
df532e7f1b rustc: Remove ast_map's session dependency 2012-05-21 23:22:06 -07:00
Brian Anderson
611890013f rustc: Remove unused import 2012-05-21 22:50:10 -07:00
Brian Anderson
85d67723ee rustc: Move path_to_ident to ast_util 2012-05-21 22:41:59 -07:00
Niko Matsakis
2fa5a66310 remove mutable cycle from ast_fold 2012-05-21 20:07:14 -07:00
Niko Matsakis
34b42eeb65 change list so that it must be used in a purely boxed fashion
The old way was inconsistent---the head was unboxed but the
tail was boxed.  This resulted in numerous needless copies and
also made the borrow check unhappy, because the head tended to be
stored in mutable memory.
2012-05-21 09:37:34 -07:00
Niko Matsakis
8e73bb6ea0 detect and report shadows in nested bindings 2012-05-21 09:37:22 -07:00
Brian Anderson
239cf80c73 rustc: Remove dead code in encoder 2012-05-19 19:09:10 -07:00
Niko Matsakis
28d0ce9a8b fix up handling of &x where x is an arg or &self (for now at least). 2012-05-19 10:33:14 -07:00
Niko Matsakis
774ea145ec make more code use dvec 2012-05-18 20:00:51 -07:00
Niko Matsakis
0f969da882 port some code to use dvec 2012-05-18 20:00:50 -07:00
Niko Matsakis
35f6f37453 avoid modifying the variable we are alting over 2012-05-18 20:00:50 -07:00
Niko Matsakis
c9edc0f0a1 introduce a few copies here and there 2012-05-18 20:00:50 -07:00
Niko Matsakis
f9aef928ca purge ufind 2012-05-18 20:00:50 -07:00
Niko Matsakis
44c100c28d try to improve handling of methods 2012-05-18 20:00:50 -07:00
Niko Matsakis
253979236e print ids of patterns when doing --pretty identified 2012-05-18 19:07:20 -07:00
Niko Matsakis
b79d717c91 fix borrowing pats---the id field of cmt was assoc with wrong pat 2012-05-18 19:07:20 -07:00