Commit graph

629 commits

Author SHA1 Message Date
Graydon Hoare
afabde19dc More fixes to fast-check. 2011-06-29 17:54:05 -07:00
Tim Chevalier
88447a47c0 Eliminate the --check-claims compiler flag
The option can only be toggled at runtime now.
2011-06-29 14:28:02 -07:00
Brian Anderson
6832f75f0b Support attaching attributes to modules via the crate file. Issue #487 2011-06-28 18:39:34 -07:00
Tim Chevalier
9f1444c701 Implement "claim"
Implement "claim" (issue #14), which is a version of "check" that
doesn't really do the check at runtime. It's an unsafe feature.

The new flag --check-claims turns claims into checks automatically --
but it's off by default, so by default, the assertion in a claim
doesn't execute at runtime.
2011-06-28 16:41:06 -07:00
Eric Holk
64596e6583 Teach the parser and typechecker to understand port[int](). Closes #588 2011-06-28 16:11:04 -07:00
Tim Chevalier
a7c4c19d4b add a predicate that determines whether a binop is lazy (and and or are lazy) 2011-06-28 13:07:52 -07:00
Brian Anderson
cab73f8897 Write metadata for more meta_item types. Issue #487 2011-06-28 10:12:05 -07:00
Marijn Haverbeke
9561def209 Use 'resource' rather than 'res' as a keyword
Resources are now defined like...

    resource fd(int n) { close(n); }

Calling fd with an int will then produce a non-copyable value
that, when dropped, will call close on the given int.
2011-06-28 18:00:39 +02:00
Paul Stansifer
b3443eb049 '#simplext' -> '#macro' 2011-06-28 15:02:12 +00:00
Paul Stansifer
c3901cdf8e Add simple syntax extension (#simplext) 2011-06-28 15:02:12 +00:00
Paul Stansifer
b632681780 Add AST fold. 2011-06-28 15:02:12 +00:00
Rafael Ávila de Espíndola
ecc080ed0b Use "" in the native_name as an indication that no extra options have to
be passed to the "linker". Use that for libc.
2011-06-28 08:21:13 -04:00
Brian Anderson
ba5c7a570d Rename middle::metadata to metadata::cwriter. Move creader to metadata
Preparation for a lot more metadata refactoring
2011-06-27 16:30:27 -07:00
Rafael Ávila de Espíndola
ac081c30be Record and link with used native libraries. 2011-06-27 15:24:44 -04:00
Marijn Haverbeke
f6753be655 Allow moving out of temporary values
This will probably need more work, as moving doesn't appear to do
quite the right thing yet in general, and we should also check
somewhere that we're not, for example, moving out the content out of
an immutable field (probably moving out of fields is not okay in
general).
2011-06-25 21:15:11 +02:00
Marijn Haverbeke
61fc12d0d0 Partial implementation of resources
Non-copyability is not enforced yet, and something is still flaky with
dropping of the internal value, so don't actually use them yet. I'm
merging this in so that I don't have to keep merging against new
patches.
2011-06-25 21:15:11 +02:00
Tim Chevalier
c772269f08 Fix inexhaustive match in parser 2011-06-24 22:38:01 -07:00
Tim Chevalier
582e1f13f0 Invalidate constraints correctly after an assignment expression
Modified typestate to throw away any constraints mentioning a
variable on the LHS of an assignment, recv, assign_op, or on
either side of a swap.

Some code cleanup as well.
2011-06-24 22:36:53 -07:00
Michael Sullivan
f3717da1b1 Modify the fn vistors in walk so that they can handle functions without names. Update the typestate code to understand this. 2011-06-24 15:46:20 -07:00
Marijn Haverbeke
9643aedb04 Remove uses of variable name 'res' from rustc
This in preparation of making 'res' a keyword for defining resources.
Please don't introduce too many new ones in the meantime...
2011-06-24 21:22:23 +02:00
Marijn Haverbeke
3d7fdb509a Remove def_obj
Since obj constructors and types have different def_ids now,
their def can simply be a def_fn and a def_ty.
2011-06-24 21:13:25 +02:00
Brian Anderson
3aa8d7ff45 rustc: Pretty-print ternary operator 2011-06-23 23:14:40 -07:00
Brian Anderson
05c0216654 rustc: Add ternary operator. Closes #565
The implementation is so simple it might be considered cheating: at almost
every step the expr_ternary is just converted to expr_if.
2011-06-23 22:16:11 -07:00
Rafael Ávila de Espíndola
3c534b2bef Remove parse_str_lit_or_env_ident.
We decided to use metadata for the more complex cases, and a simple
string is enough for rustc right now.
2011-06-23 18:42:55 -04:00
Brian Anderson
d9b56ec2ea rustc: Limit creader exports 2011-06-22 19:04:04 -07:00
Brian Anderson
8746b84eec rustc: Handle valueless ret expressions as block results. Closes #521 2011-06-22 17:20:01 -07:00
Brian Anderson
adc18bb24a rustc: Introduce and parse additional meta_item forms
Examples: #[test], #[link(name = "vers")]

Issue #487
2011-06-22 13:55:58 -07:00
Brian Anderson
a6e188f8bf rustc: Rename parser.err to parser.fatal 2011-06-22 12:55:26 -07:00
Paul Stansifer
fe0925678c Remove a simidgeon of dead code. 2011-06-23 03:32:57 +08:00
Tim Chevalier
7fb35ecf84 Serialize constraints in types (literal arguments still not supported)
This involved, in part, changing the ast::def type so that a def_fn
has a "purity" field. This lets the typechecker determine whether
functions defined in other crates are pure.

It also required updating some error messages in tests. As a test
for cross-crate constrained functions, I added a safe_slice function
to std::str (slice(), with one of the asserts replaced with a
function precondition) and some test cases (various versions of
fn-constraint.rs) that call it. Also, I changed "fn" to "pred" for
some of the boolean functions in std::uint.
2011-06-21 14:37:33 -07:00
Marijn Haverbeke
3b6d94d489 Move names and ids of native items into their recs, rather than their tags 2011-06-21 23:11:00 +02:00
Lindsey Kuper
26d8eaefa7 Puts out burning tinderbox (oops, AST nodes don't have def_ids/anns). 2011-06-21 14:07:28 -07:00
Lindsey Kuper
84005fadbf Some progress on support for extending objects with new fields (issue
into four separate issues (#538, #539, #540, #543) with corresponding
tests.
2011-06-21 13:31:27 -07:00
Marijn Haverbeke
c34e9b33d9 Move expr ids into the expr record type
This simplifies the tag variants a bit and makes expr_node_id
obsolete.
2011-06-21 22:25:32 +02:00
Brian Anderson
23d6a6bde1 rustc: Remove unused slice call from extfmt. Closes #532 2011-06-21 07:49:40 -07:00
Marijn Haverbeke
75681f9ad7 Get rid of def_ids and anns in AST nodes, use single node_id
This reduces some redundancy in the AST data structures and cruft in
the code that works with them. To get a def_id from a node_id, apply
ast::local_def, which adds the local crate_num to the given node_id.
Most code only deals with crate-local node_ids, and won't have to
create def_ids at all.
2011-06-20 23:53:28 +02:00
Rafael Ávila de Espíndola
3d8a5cb9e6 Remember the library files we used in rustc and pass them to the "linker".
This avoid the hardcoded -lstd, allows programs to use other crates and avoids
any differences that may exist in the rustc and ld search logic.
2011-06-20 17:44:12 -04:00
Brian Anderson
200dbe4c4f Remove various rustboot workarounds 2011-06-19 20:48:20 -07:00
Brian Anderson
43427dae0c rustc: Rename session.span_err -> span_fatal, err -> fatal
Issue #440
2011-06-19 12:19:53 -07:00
Brian Anderson
cf9ed08a50 Revert previous 6 commits. Hopefully put out Windows fire.
Revert "rustc: Export only what's needed from middle::ty"

This reverts commit 4255d58aa5.

Revert "rustc: Make name resolution errors less fatal"

This reverts commit b8ab9ea89c.

Revert "rustc: Make import resolution errors less fatal"

This reverts commit 92a8ae94b9.

Revert "rustc: Export only what's used from middle::resolve"

This reverts commit 4539a2cf7a.

Revert "rustc: Re-introduce session.span_err, session.err"

This reverts commit 7fe9a88e31.

Revert "rustc: Rename session.span_err -> span_fatal, err -> fatal"

This reverts commit c394a7f49a.
2011-06-19 03:29:19 -07:00
Brian Anderson
c394a7f49a rustc: Rename session.span_err -> span_fatal, err -> fatal
Issue #440
2011-06-19 02:40:59 -07:00
Brian Anderson
514813148b rustc: Store the lhs and rhs of receive exprs in left to right order
With the changing of receive semantics the parser has been putting the rhs
expression in the first argument of expr_recv and the lhs in the second, and
all subsequent passes have been referring to them backwords (but still doing
the right thing because they were assuming that lhs was the port and rhs was
the receiver).

This makes all code agree on what lhs and rhs mean for receive expressions.
2011-06-18 20:23:05 -07:00
Brian Anderson
364cd5763c rustc: receive is spelled |> now 2011-06-18 20:23:05 -07:00
Brian Anderson
ddbb31eb8e rustc: Remove the meta keyword
Issue #487
2011-06-18 20:23:05 -07:00
Brian Anderson
81a187e8be rustc: Remove metadata from the session.
This mechanism was not being used for anything. Issue #487.
2011-06-17 14:46:59 -07:00
Paul Stansifer
391348ec86 Consistify ast::local. 2011-06-16 17:56:24 -07:00
Brian Anderson
6f4326c54d Add better error messages for bad attributes in .rc files
Issue #487
2011-06-16 17:23:20 -07:00
Brian Anderson
4b8fba5f34 rustc: Fix regressed handling of bad attributes
Issue #487
2011-06-16 17:23:20 -07:00
Brian Anderson
ffa7c76ed2 rustc: Change print_file to print_crate
The pretty-printer needs access to the crate attributes in order to reproduce
inner crate attributes in standalone .rs files

Issue #487
2011-06-16 17:23:20 -07:00
Brian Anderson
e83a115d79 rustc: Parse crate attributes in standalone .rs files
Issue #487
2011-06-16 17:23:20 -07:00
Brian Anderson
ffae642663 rustc: Parse attributes in crate files
Issue #487
2011-06-16 17:23:20 -07:00
Brian Anderson
62939e41b2 rustc: Parse inner items of file-level modules linked from crate files
Issue #487
2011-06-16 17:23:20 -07:00
Graydon Hoare
b84fffaa4e Reformat a bunch of recent churn. 2011-06-16 16:55:46 -07:00
Patrick Walton
94cd2985b2 rustc: Parse T[mutable?] 2011-06-16 15:17:06 -07:00
Brian Anderson
43cbbabccb rustc: Correctly mark attributes as inner attributes
Issue #487
2011-06-16 14:21:43 -07:00
Brian Anderson
f3996d32b0 rustc: Parse inner attributes of modules
Issue #487
2011-06-16 14:21:42 -07:00
Patrick Walton
4fc286e24e rustc: Parse interior vector types in which the base type is a path properly 2011-06-16 14:03:07 -07:00
Tim Chevalier
219924e669 Bring back if-check
Add "if check" (expr_if_check), a variation on check that executes
an "else" clause rather than failing if the check doesn't hold.
2011-06-16 12:13:20 -07:00
Michael Sullivan
066599104a Parse swap. 2011-06-16 11:47:54 -07:00
Michael Sullivan
e8d2d27a88 Add "<->" to the token definition and the lexer. 2011-06-16 11:47:54 -07:00
Patrick Walton
66c52036da rustc: Change interior vector syntax to T[] 2011-06-16 10:13:39 -07:00
Marijn Haverbeke
15f71b3600 Refactor ast::item representation
Most of the fields in an AST item were present in all variants. Things
could be simplified considerably by putting them in the rec rather
than in the variant tags.
2011-06-16 13:32:35 +02:00
Brian Anderson
6c2f322f82 Improve and test failure behavior for malformed attributes 2011-06-15 19:30:10 -07:00
Brian Anderson
2772a29e92 rustc: Support outer attributes on items that are defined as statements
Issue #487
2011-06-15 16:01:35 -07:00
Tim Chevalier
a5bca7df88 Refactor data structures representing constraints (again...)
I added a "resolved" version of the ast::constr type -- ty::constr_def
-- that has a def_id field instead of an ann_field. This is more
consistent with other types and eliminates some checking.

Incidentally, I removed the def_map argument to the top-level function
in middle::alias, since the ty::ctxt already has a def_map field.
2011-06-15 15:38:12 -07:00
Marijn Haverbeke
0987b17dcb Small simplification in parser.rs' crate parsing 2011-06-15 21:39:26 +02:00
Graydon Hoare
ce72993488 Reformat source tree (minus a couple tests that are still grumpy). 2011-06-15 11:19:50 -07:00
Brian Anderson
1c9277e0d3 rustc: Make room in remaining AST item nodes for attributes
Issue #487
2011-06-15 09:48:55 -07:00
Brian Anderson
11c5c73d56 rustc: Introduce an attribute type to the AST
Right now the only thing that it adds to meta_item is an indication of whether
the attribute was declared inside or outside the item, but I expect it will
become more useful.

Issue #487
2011-06-15 09:46:37 -07:00
Brian Anderson
0eefa5f9d3 rustc: Parse module attributes
Issue #487
2011-06-15 09:46:37 -07:00
Brian Anderson
31116dcdd5 rustc: Make room in item_mod for metadata
Issue #487
2011-06-15 09:46:37 -07:00
Brian Anderson
f42977d946 rustc: Modernize front::eval 2011-06-15 09:46:37 -07:00
Marijn Haverbeke
b0d46efd07 Stop dropping object field mutability on the floor 2011-06-15 14:20:04 +02:00
Marijn Haverbeke
df27699a57 Modernize some code in parser.rs
No more explicit type params or working around rustboot bugs
2011-06-14 22:09:00 +02:00
Graydon Hoare
9ae843ab1c Print parens on unops when necessary. 'make reformat' output now builds to stage3. 2011-06-14 11:32:20 -07:00
Graydon Hoare
a1edf91f48 Fix bug in detecting trailing comments when at beginning-of-file. 2011-06-14 11:11:22 -07:00
Marijn Haverbeke
471436a299 Implement function expressions/anonymous functions
Looks like 'fn(..arg..) -> ret {body;}. They don't support type
parameters or upvars yet.
2011-06-14 18:22:46 +02:00
Marijn Haverbeke
8c06d1bcb0 Remove 'peeking_at_item' from parser
parse_item now returns a value to indicate it didn't find an item
2011-06-14 14:53:01 +02:00
Tim Chevalier
d65ad8c31c Change decl to local in expr_for and expr_for_each
Since the decl in a for or for-each loop must always be a local
decl, I changed the AST to express this. Fewer potential match
failures and "the impossible happened" error messages = yay!
2011-06-13 17:33:04 -07:00
Tim Chevalier
698c6406ba Reject programs with unsatisfied predicate constraints
Generate appropriate constraints for calls to functions with
preconditions, and reject calls where those constraints don't
hold true in the prestate.

...by which I mean that it works for one test case :-)
2011-06-10 19:17:15 -07:00
Graydon Hoare
9671d21408 Implement meta tag matching in creader. Start using it in rustc.rc. Close #459. Close #457. 2011-06-10 15:54:41 -07:00
Graydon Hoare
52c4c9014f Encode meta tags in the crate and start sketching enhanced logic for resolving crate "use" directives.
Now with extra "works on OSX" kludging.
2011-06-10 12:57:29 -07:00
Patrick Walton
7b7c746c1e Merge pull request #447 from paulstansifer/quick_error_message_fix
Error message, instead of segfault, when recursive types are used.
2011-06-10 10:53:42 -07:00
Patrick Walton
dfdd6dbc54 rustc: Remove the bitwise not operator 2011-06-10 10:47:33 -07:00
Marijn Haverbeke
fccf065266 Implement mutable/immutable alias distinction.
Before, all aliases were implicitly mutable, and writing
&mutable was the same as writing &. Now, the two are
distinguished, and assignments to regular aliases are
no longer allowed.
2011-06-10 12:15:58 +02:00
Marijn Haverbeke
798bbd2e22 Fix all occurrences of writing to immutable aliases
You'd be surprised.
2011-06-10 12:15:28 +02:00
Patrick Walton
40e3a9fcbc Revert "Encode meta tags in the crate and start sketching enhanced logic for resolving crate "use" directives." due to tree bustage
This reverts commit ab3635eebe.
2011-06-09 18:15:13 -07:00
Patrick Walton
60706f1e35 rustc: Write interior vecs and strings into the metadata and add logic for them in ty_to_str 2011-06-09 18:00:46 -07:00
Graydon Hoare
ab3635eebe Encode meta tags in the crate and start sketching enhanced logic for resolving crate "use" directives. 2011-06-09 17:24:32 -07:00
Patrick Walton
5318248f24 rustc: Annotate vector and string literals in the AST with their uniqueness or lack thereof 2011-06-09 17:11:21 -07:00
Patrick Walton
1c48102838 rustc: Add ty_istr and ty_ivec types 2011-06-09 16:23:19 -07:00
Patrick Walton
54d34bec59 rustc: Parse istr and ivec 2011-06-09 15:05:08 -07:00
Tim Chevalier
17ff2a0d79 Further support for predicate constraints
Changed function types to include a list of constraints. Added
code for parsing and pretty-printing constraints. This necessitated
splitting pprust into two files (pprust and ppaux) to break a
circulate dependency, as ty_to_str now needs to print out constraints,
which may include literals, but pprust depended on ty.
2011-06-09 11:37:52 -07:00
Marijn Haverbeke
beda82ddf1 A revised, improved alias-checker
The old system tried to ensure that the location an alias pointed at
would retain its type. That turned out to not be strong enough in the
face of aliases to the inside of tags.

The new system instead proves that values pointed to by aliases are
not replaced (or invalidated in some other way) at all. It knows of
two sufficient conditions for this, and tries to prove at least of
them:

A) The alias is 'immutably rooted' in a local, and this local is not
   reassigned for the lifetime of the alias. Immutably rooted means
   the alias refers to the local itself, or to something reachable
   from the local through immutable dereferencing.

B) No value whose type might include the type of the 'inner mutable
   element' of the thing the alias refers to (for example, the box in
   rec(mutable x = @mutable int)) is from the outer scope is accessed
   for the lifetime of the alias. This means for functions, no other
   argument types may include the alias's inner mutable type. For alt,
   for each, and for, it means the body does not refer to any locals
   originating from outside their scope that include this type.

The lifetime of an alias in an alt, for each, or for body is defined
as the range from its definition to its last use, not to the point
where it goes out of scope. This makes working around these
restrictions somewhat less annoying. For example, you can assign to
your alt-ed value you don't refer to any bindings afterwards.
2011-06-09 13:11:29 +02:00
Josh Matthews
2235fb73ef Add optional message to fail. 2011-06-08 04:02:55 -04:00
Graydon Hoare
721c5bbee8 More work on proper linkage name-mangling. Almost right, aside from version numbers. 2011-06-07 18:08:17 -07:00
Josh Matthews
df9cf0be9b Add multiline, whitespace-eating strings. 2011-06-07 11:21:10 +02:00
Brian Anderson
53ea2a4751 stdlib: Use spans for #fmt errors originating in std
Issue #444
2011-06-04 19:48:19 -04:00
Brian Anderson
a177dc485b rustc: Reenable debug logging in extfmt
This is not obnoxious now that logging is off by default
2011-06-04 17:57:53 -04:00
Brian Anderson
4b566fe7f9 rustc: Hide the parser from syntax extensions
Eventually extensions will probably need access to the parser again, but it'll
be in a different form.
2011-06-04 17:51:59 -04:00
Brian Anderson
c88fa92de4 rustc: Generate extension annotations from ext_ctxt instead of parser 2011-06-04 17:44:24 -04:00
Brian Anderson
1d6f1dc58d rustc: Add a next_ann method to ext_ctxt
After this we can remove the parser from the syntax extensions, at least for
now.
2011-06-04 17:31:44 -04:00
Brian Anderson
3ca5fff195 rustc: Use spans for #env errors
Issue #444
2011-06-04 17:14:32 -04:00
Brian Anderson
ac83e34dc6 rustc: Report unimplemented #fmt features with spans 2011-06-04 17:10:08 -04:00
Brian Anderson
dd588519bd rustc: Add a span_unimpl method to ext_ctxt 2011-06-04 17:10:08 -04:00
Brian Anderson
ecf1bd7651 rustc: Use spans on extfmt error messages
Issue #444
2011-06-04 17:10:04 -04:00
Brian Anderson
794221b353 rustc: Return the correct span from parse_seq 2011-06-04 16:36:08 -04:00
Brian Anderson
c18f2e2dac rustc: Pass the correct span to syntax extensions 2011-06-04 15:57:13 -04:00
Brian Anderson
af46f3ed0d rustc: Introduce ext module. Move some things from parser to ext.
Introduce an ext_ctxt record to provide a span_err method for use while
expanding syntax extensions. Hopefully it will be useful for other things.
2011-06-04 15:49:42 -04:00
Paul Stansifer
dbd066a02a "macro" -> "syntax extension" for now 2011-06-03 18:47:11 -07:00
Paul Stansifer
79fcd51b46 Make the macro system more modular. 2011-06-03 18:47:11 -07:00
Graydon Hoare
088ab03fdb Add spans to fields, args, methods. Improve pp of same. 2011-06-03 15:42:42 -07:00
Rafael Ávila de Espíndola
429e21414b Parse pointers in metadata. 2011-06-03 15:13:10 -04:00
Rafael Ávila de Espíndola
18b63865ce Accept *foo as a pointer to foo.
This is accepted everywhere, since just passing a pointer is safe.
2011-06-03 14:34:19 -04:00
Graydon Hoare
cb61d7b38e Pretty-print literals exactly as we saw them in the source. 2011-06-02 17:18:49 -07:00
Paul Stansifer
1377e9b341 Implement pcwalton's code review suggestions. 2011-06-02 15:12:17 -07:00
Paul Stansifer
5cd10d2fef Error message, instead of segfault, when recursive types are used. 2011-06-02 14:03:17 -07:00
Tim Chevalier
ac4ef1741e Allow constraint args to be literals 2011-06-01 17:45:13 -07:00
Graydon Hoare
023bbc0449 Add a space after @mutable. 2011-06-01 13:12:12 -07:00
Graydon Hoare
2ef2bda276 Move brace/if/for/while/do/alt/spawn exprs into bottom_expr rule. 2011-06-01 12:42:28 -07:00
Paul Stansifer
9f5dddf08c Now imports are not re-exported unless 'export' is explicitly used. 2011-05-31 18:43:26 -07:00
Michael Sullivan
fd1029e6dd Support move as an initializer. 2011-05-31 17:39:14 -07:00
Michael Sullivan
5e7bba3d23 Insert plumbing for move that behaves just like assign. 2011-05-31 17:39:14 -07:00
Eric Holk
84a56ed7cd Teach the compiler to understand yield and join, as well as using task as a type name. 2011-05-31 16:28:13 -07:00
Graydon Hoare
223c7dfb11 Fix comment-scanning logic in lexer. 2011-05-31 15:31:50 -07:00
Graydon Hoare
b6971d94df Consolidate formatting functions a bit more. 2011-05-31 11:00:47 -07:00
Graydon Hoare
b48cab962a Add span to field to catch per-field comments in rec exprs. 2011-05-31 11:00:47 -07:00
Graydon Hoare
d12ea39896 Improve comment handling in pp. 2011-05-31 11:00:47 -07:00
Brian Anderson
81fc2d8728 rustc: Remove unneeded type params from alt patterns 2011-05-31 01:23:53 -04:00
Michael Sullivan
a7a42c24be Change the syntax for RECV from "var <- port" to "port |> var". 2011-05-27 12:01:20 -07:00
Michael Sullivan
2119e3b5b9 Fix missing bump in RECV lexer case. 2011-05-27 12:01:20 -07:00
Michael Sullivan
9c79200a7f Pretty print the new RECV token... 2011-05-27 12:01:20 -07:00
Michael Sullivan
ea16e582eb Remove parser support for recv as an initializer in preparation for changing the recv syntax. 2011-05-27 12:01:20 -07:00
Michael Sullivan
55b40e6894 Lex '|>' as the RECV token. 2011-05-27 12:01:20 -07:00
Paul Stansifer
40fe44d23e "import module::*;" now works. 2011-05-27 02:42:33 +00:00
Paul Stansifer
f11f846ead Parsing and folding changes for globbed imports. 2011-05-27 02:42:32 +00:00
Tim Chevalier
250643c549 Remove unused imports 2011-05-26 18:01:48 -07:00
Graydon Hoare
9f95538462 Remove redisue of unused fields from 'ann'. 2011-05-26 17:26:59 -07:00
Graydon Hoare
2561b01211 Remove residual uses of fold, and fold itself. 2011-05-26 17:16:54 -07:00
Brian Anderson
29a801565a rustc: Fail better when the first argument to #fmt is not a string literal 2011-05-25 23:50:19 -04:00
Brian Anderson
c4e9d8fb91 rustc: Fail when #fmt is given too many arguments 2011-05-25 23:43:04 -04:00
Marijn Haverbeke
86d51ec24b Get test-pass/utf8.rs to run
This involved a small fix to the unicode-escape character lexing and
to the pretty-printer.
2011-05-23 23:25:55 +02:00
Tim Chevalier
467b938ea8 Merge remote-tracking branch 'graydon/master' into typestate_4 2011-05-20 18:23:03 -07:00
Tim Chevalier
fed0486c33 Annotate erroring functions in session and parser 2011-05-20 18:20:54 -07:00
Lindsey Kuper
c3410bf927 More work on anonymous objects. 2011-05-20 17:59:56 -07:00
Tim Chevalier
a08a376d6e Make controlflow part of a function type
Change ty_fn to have a controlflow field. A 'controlflow' is
essentially a bit of data that says whether or not this function
never returns to the caller (if it never returns, that means it calls
"fail" or another "never-returns" function on every control path).

Also add syntax for annotating functions that never return:

fn foo() -> ! {
   fail;
}

for example. Functions marked with ! implicitly have a result type of
ty_bot, which is a new type that this commit also adds.
2011-05-20 16:57:37 -07:00
Patrick Walton
7e43a31f08 rustc: Move the interner to a new module intended to be used for general data structures 2011-05-20 13:57:53 -07:00
Graydon Hoare
7f938f4945 Move the ty_item_table into ty::ctxt.items, move variant_info to ty, and start sketching the contains_pointer property on types. 2011-05-19 17:21:36 -07:00
Marijn Haverbeke
8a7b544995 Finish name collision testing.
And fix a the single screw-up in the source code it caught.
2011-05-19 21:58:57 +02:00
Tim Chevalier
bb594a03a1 remove now-unused ts field from ann 2011-05-19 11:40:16 -07:00