Commit Graph

3969 Commits

Author SHA1 Message Date
Brian Anderson
27ab663845 rustc: Don't ignore attributes inside empty mods. Closes #1655 2012-02-22 21:47:23 -08:00
Brian Anderson
99a48660d1 rustc: Allow any integral types on rhs of shift ops 2012-02-22 17:26:08 -08:00
Tim Chevalier
4acfcd8c2f Improve error message for use of a non-pure-fn in a pred
Closes #1883
2012-02-22 10:59:52 -08:00
Marijn Haverbeke
cb2f43cbf4 Stop normalizing patterns
The check for whether a pat_ident is a variant or a binding
is simple and fast. Normalizing patterns again and again is
slow and error-prone (several places were forgetting to do it).
2012-02-22 16:57:23 +01:00
Marijn Haverbeke
1e5266260a Take move captures in account in mutability checker
Closes #1461
2012-02-22 13:35:17 +01:00
Marijn Haverbeke
8015e6d52b Return a new type var instead of nil when failing to typecheck a field
The previous solution was usually causing a second spurious error
message.
2012-02-22 13:34:43 +01:00
Marijn Haverbeke
ffd50b9cdf Make the various from_str functions return options
So that they can be used with user input without causing task
failures.

Closes #1335
2012-02-22 13:18:15 +01:00
Marijn Haverbeke
ad03761a97 Remove preconditions from libraries
Closes #1805
2012-02-22 11:47:47 +01:00
Marijn Haverbeke
e57b6775c3 Clean up small things in syntax submodules 2012-02-22 11:16:25 +01:00
Brian Anderson
77a01054fa rustc: Generate crates with #ast 2012-02-21 15:34:26 -08:00
Marijn Haverbeke
9d20ed7bf9 Clean up unification code 2012-02-21 17:08:14 +01:00
Marijn Haverbeke
ff927f18f5 Clean up some FIXMEs in middle:: modules
Rename all TODOs to FIXMEs
2012-02-21 17:08:14 +01:00
Marijn Haverbeke
92a45f5582 Move trans::type_of code into its own file
Slowly shrinking base.rs
2012-02-21 17:08:14 +01:00
Marijn Haverbeke
d85d4f55f7 Include @ in crate_ctxt and fn_ctxt type definitions
So that code using them doesn't have to spell it out constantly.
2012-02-21 17:08:14 +01:00
Marijn Haverbeke
b1d7f252a9 Remove unused tydesc argument to upcall_shared_malloc 2012-02-21 17:08:14 +01:00
Marijn Haverbeke
389aff333d Make the cleanup tag in resource types a u8
Closes #1184
2012-02-21 17:08:14 +01:00
Marijn Haverbeke
5458da0fd9 Remove some checks and associated FIXMEs from trans code
Such intentions are better tracked in the bug tracker, don't need
to litter the code with repetetive comments.
2012-02-21 17:08:14 +01:00
Marijn Haverbeke
789a1ae356 Clean up a number of TODOs in the trans modules
Rename the ones that I didn't handle to FIXME
2012-02-21 14:20:18 +01:00
Tim Chevalier
4cd3d4ab1e More work on typechecking classes
classes-simple doesn't fail until trans now!
2012-02-20 22:26:19 -08:00
Brian Anderson
4220dcf1e9 core: New task API 2012-02-20 18:58:04 -08:00
Tim Chevalier
ac7aa73b3e Oops, my whitespace is showing 2012-02-20 17:19:09 -08:00
Tim Chevalier
2299d204e4 Further work on resolving and typechecking classes
Class tests aren't working yet, but they fail a little later :-)

Also, make the parser correctly set a constructor's result type to
its enclosing class type.
2012-02-20 17:16:52 -08:00
Tycho Sci
2e63bc5d82 cargo: Use $sysroot/$libdir/cargo as work dir
On win32  environment, it's "$sysroot/bin/cargo".
On unix-y environment, it's "$sysroot/lib/cargo".
2012-02-20 17:55:35 +09:00
Brian Anderson
d2294a2d99 rustc: Add missing space to error message 2012-02-18 14:04:24 -08:00
Brian Anderson
4370188055 Merge pull request #1860 from erickt/master
add str::find_from_bytes and str::index_from_bytes
2012-02-18 13:17:12 -08:00
Graydon Hoare
ef6f628589 Refactor view_path to parse (but not yet process) export globs, unify code paths. 2012-02-17 23:05:20 -08:00
Brian Anderson
4e44437180 rustc: Make resolve more forgiving of missing external crates
Rustdoc needs to be able to resolve locals without resolving externals
2012-02-17 17:34:05 -08:00
Brian Anderson
a5ede9d345 rustdoc: Resolve imports and reexports 2012-02-17 16:00:39 -08:00
Marijn Haverbeke
f7f73c79ec Move debuginfo into trans 2012-02-17 23:03:12 +01:00
Marijn Haverbeke
ff42964546 Clean up some of trans using block combinators
`with_scope` and `with_cond` can be used to wrap a piece of code in a
scope block, or conditionalize it on a value, without doing all the
context-creation and jumping by hand.

Also renames @block_ctxt to block to reduce noise.
2012-02-17 23:03:12 +01:00
Marijn Haverbeke
1c1261bcb8 Simplify get_tydesc's API 2012-02-17 22:47:03 +01:00
Marijn Haverbeke
9f4206cdc4 Clean up block_ctxt representation 2012-02-17 22:47:03 +01:00
Brian Anderson
54d7bffbb8 rt: Make upcall_vec_push an intrinsic 2012-02-17 12:08:03 -08:00
Erick Tryzelaar
042a5222d1 core: rewrite str::byte_index to use vec functions 2012-02-16 18:35:45 -08:00
Marijn Haverbeke
e62ddf4898 More rigorous reuse of cleanup sequences
In both landing pads and break/cont/ret unwinding.

Closes #300
2012-02-16 16:37:33 +01:00
Marijn Haverbeke
ea6bb5aafa Remove to_zero/to_revoke kludge
It is much simpler to just move by_move args into a temporary
alloca.
2012-02-16 13:55:17 +01:00
Niko Matsakis
bfff2a8d55 make mut a keyword synonymous with mutable
first step towards issue #1273
2012-02-15 13:26:11 -08:00
Niko Matsakis
dddd9908d5 move shape into trans 2012-02-15 13:26:10 -08:00
Marijn Haverbeke
67cc89f38d Rewrite exhaustiveness checker
Issue #352
Closes #1720

The old checker would happily accept things like 'alt x { @some(a) { a } }'.
It now properly descends into patterns, checks exhaustiveness of booleans,
and complains when number/string patterns aren't exhaustive.
2012-02-15 15:47:42 +01:00
Marijn Haverbeke
4b63826050 Replace some explicit fails with 'alt check' invocations 2012-02-15 15:47:42 +01:00
Marijn Haverbeke
16e5760564 Fix bug in safe-reference checker
At some point, a refactor broke the code that handled local declarations
to no longer descend into the initializer expressions.

Closes #1846
2012-02-15 11:53:32 +01:00
Marijn Haverbeke
9ff5ba085d Fix bad line printing for parse errors
The code that extracted lines from partially-parsed files
was broken.

Closes #1848
2012-02-15 11:53:32 +01:00
Marijn Haverbeke
6627890f6b Support 'alt check' syntax
It is only a way to flag an alt as intentionally non-exhaustive right now.

Issue #1679
2012-02-15 11:53:32 +01:00
Kevin Atkinson
d6d7134c37 When parsing a source string, fail when the entire string is not parsed.
(For now only fail when parse_from_source_str is used to avoid
possible compatibility problems; parse_expr_from_source_str still
does not check.)
2012-02-14 19:37:33 -08:00
Kevin Atkinson
a803a14b56 Bug fix to accept $ in 0th pos, (ie #ast{$(x) + ...}).
Note: part from Niko Matsakis commit: rewrite assert to accept a $ in
0th pos.
2012-02-14 19:37:33 -08:00
Kevin Atkinson
3eef8d1419 Correctly handle the character position at the EOF.
Fixes issue #1785.
2012-02-14 19:37:33 -08:00
Kevin Atkinson
379194753c Use file_substr rather than <anon> when re-parsing quasi-quotes
for better error messages.
2012-02-14 19:37:33 -08:00
Kevin Atkinson
0e44133e7c Do a better job of reporting source location for files (i.e. filemap)
that are really a substr of another file.
2012-02-14 19:37:33 -08:00
Kevin Atkinson
74b4345a38 Change file_substr to allow for external strings. 2012-02-14 19:37:33 -08:00
Brian Anderson
214cdd0dee rustc: Translate crust functions 2012-02-14 11:24:09 -08:00