Brian Anderson
50b1953f9b
Pretty-print view items in mod items
...
For mods that aren't defined at the file level we were forgetting to print the
view items so, e.g. 'mod { use std; }' would not print correctly.
2011-06-30 16:08:28 -07:00
Brian Anderson
64d6081429
Use attributes for conditional compilation in std.rc
2011-06-30 14:13:49 -07:00
Brian Anderson
39fccf3bc7
Conditionally compile items declared as statements. Issue #489
2011-06-30 13:04:35 -07:00
Tim Chevalier
37bfbc4b79
Get rid of remaining unused variables
2011-06-30 12:37:30 -07:00
Tim Chevalier
6a74253d60
Don't warn about unused for-loop index variables
2011-06-30 12:37:30 -07:00
Tim Chevalier
d8db9a0fe1
Kill unused variables
2011-06-30 12:37:30 -07:00
Tim Chevalier
4519f54857
Warn for unused variables
...
Modify typestate to check for unused variables and emit warnings
where relevant. This exposed a (previously harmless) bug in
collect_locals where outer functions had bit-vector entries
for init constraints for variables declared in their inner
nested functions. Fixing that required changing collect_locals to
use visit instead of walk -- probably a good thing anyway.
2011-06-30 12:37:30 -07:00
Patrick Walton
add9031dd5
rustc: Use interior vectors for record types
2011-06-30 12:02:40 -07:00
Patrick Walton
fd0d1cb7d8
rustc: Make mk_imm_tup() take an interior vector
2011-06-30 11:35:05 -07:00
Patrick Walton
b841152a40
rustc: Use interior vectors for tuple types
2011-06-30 11:35:05 -07:00
Eric Holk
b4a145e60f
Added a nanosecond timer to time.rs, support for some floating point casts, and a commandline-driven mode for pfib.rs
2011-06-30 11:32:10 -07:00
Brian Anderson
4165d3640a
Add a pass to fold out items that do not belong in the current configuration
...
The parser needs to parse unconfigured items into the AST so that they can
make the round trip back through the pretty printer, but subsequent passes
shouldn't care about items not being translated. Running a fold pass after
parsing is the lowest-impact way to make this work. The performance seems
fine.
Issue #489
2011-06-30 10:06:26 -07:00
Brian Anderson
3483c65b1f
Add missing item variants to fold_item_underscore
2011-06-30 10:06:26 -07:00
Brian Anderson
aa6a3debf3
Add missing expression variants to fold_expr
2011-06-30 10:06:26 -07:00
Brian Anderson
1f0c25406c
Fold the crate-level module in front::fold
2011-06-30 10:06:26 -07:00
Brian Anderson
5de916dd5c
Move middle::attr to front::attr
2011-06-30 10:06:26 -07:00
Brian Anderson
afc8a5c031
Convert the eval::env to an ast::crate_cfg
...
crate_cfg will replace eval::env as the mechanism for conditional compilation.
This is a transitional step so they can both exist together.
Issue #489
2011-06-30 10:06:25 -07:00
Brian Anderson
d53bfad8e7
Introduce a config property to the crate AST node
...
This represents the compilation environment, defined as AST meta_items, Used
for driving conditional compilation and will eventually replace the
environment used by the parser for the current conditional compilation scheme.
Issue #489
2011-06-30 10:06:25 -07:00
Brian Anderson
78a82b9fd1
Switch rustc's crate metadata to use the link attribute
2011-06-30 10:03:07 -07:00
Marijn Haverbeke
86f16b90cd
Support type parameters in resources
...
Some rather dodgy code was added to trans in the process. I'd love to
discuss it with someone who knows more about types during translation.
2011-06-30 18:36:12 +02:00
Marijn Haverbeke
31ec26d46a
Make calling resource destructors work cross-crate
...
Tydescs are currently re-created for each compilation unit (and I
guess for structural types, they have to be, though the duplication
still bothers me). This means a destructor can not be inlined in the
drop glue for a resource type, since other crates don't have access to
the destructor body.
Destructors are now compiled as separate functions with an external
symbol that can be looked up in the crate (under the resource type's
def_id), and called from the drop glue.
2011-06-30 18:36:12 +02:00
Rafael Ávila de Espíndola
5b7ce80ffa
Second try to remove -lssp.
2011-06-30 08:55:25 -04:00
Graydon Hoare
afabde19dc
More fixes to fast-check.
2011-06-29 17:54:05 -07:00
Graydon Hoare
c796a8f24d
Re-enable tidy (it was broken) and fix various non-tidy things.
2011-06-29 15:14:55 -07:00
Brian Anderson
190644063e
Be more strategic about linking to rust crates
...
Instead of linking directly to the rust crate, try to figure out the location
and name of the library from the file name, then call gcc with appropriate -L,
-l flags. This will allow dynamic linking to be more forgiving about where it
loads the library from at runtime - currently a stage3 compiler can't run
correctly from the stage0 directory. Only tested on Linux. Fingers crossed.
2011-06-29 14:35:39 -07:00
Brian Anderson
e130e7b598
Display an error when linking fails
2011-06-29 14:35:39 -07:00
Brian Anderson
e60cb9197f
Add session.note method
2011-06-29 14:35:39 -07:00
Brian Anderson
4ffa5ddf76
session.err shouldn't take a span
2011-06-29 14:35:39 -07:00
Tim Chevalier
76b755f9ad
Remove workaround for a compiler bug that, I guess, got fixed
2011-06-29 14:28:03 -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
Tim Chevalier
1ba85932b1
Add a runtime flag to enable/disable claims en masse
...
Now, if the environment variable CHECK_CLAIMS is set, then all
claims turn into checks. Otherwise, claims are no-ops.
2011-06-29 14:28:02 -07:00
Brian Anderson
d4b5b48e0a
Correctly locate the crate's version from the link attribute
2011-06-29 14:21:39 -07:00
Brian Anderson
29afe1a518
Write metadata for sythesized name/vers items to the crate's link attr
...
If the crate doesn't specify it's name or version, the defaults need to be
exported in the crate metadata
2011-06-29 14:21:39 -07:00
Brian Anderson
308bc31f24
Encapsulate more crate meta calculations
2011-06-29 14:21:39 -07:00
Brian Anderson
325f46da06
Move the calculation of the crate name, vers and cmh to a single function
2011-06-29 14:21:39 -07:00
Graydon Hoare
5b2c17fba5
Fix resource encoding bugs.
2011-06-29 12:14:29 -07:00
Patrick Walton
b18cefdfd7
rustc: Fix a leak that resulted from copying a structural interior type containing interior vectors. Add a test case.
2011-06-29 12:16:07 -07:00
Rafael Ávila de Espíndola
54f618128e
Revert ""Try" push without -lssp on windows to see what needs it."
...
This reverts commit 47b3e087e945a2a8fcfd1179e333746d294c1259.
2011-06-29 13:25:52 -04:00
Patrick Walton
bbd0d58955
rustc: Unbreak self assignment
2011-06-29 10:22:53 -07:00
Rafael Ávila de Espíndola
47b3e087e9
"Try" push without -lssp on windows to see what needs it.
2011-06-29 12:56:54 -04:00
Michael Sullivan
1d05718c2d
Extend visit to use visit_fn to visit fn expressions.
2011-06-29 09:04:00 -07:00
Brian Anderson
7c500fc0a0
Replace common::new_seq_hash with an adapter around std::smallintmap
...
It would be better to either convert ast_map to use smallintmap or make
smallintmap and hashmap follow the same interface, but I don't feel up to
it just now. Closes #585 .
2011-06-28 19:48:33 -07:00
Lindsey Kuper
7b5d34aa9a
Comments and cleanup.
2011-06-28 19:06:44 -07:00
Lindsey Kuper
57e5cde3a2
Comments and cleanup.
2011-06-28 18:54:56 -07:00
Lindsey Kuper
684c0dc494
Comments and cleanup.
2011-06-28 18:54:56 -07:00
Brian Anderson
6832f75f0b
Support attaching attributes to modules via the crate file. Issue #487
2011-06-28 18:39:34 -07:00
Patrick Walton
74f8eb51ae
rustc: Move duplicate_heap_parts to copy glue; add a test case
2011-06-28 17:59:30 -07:00
Tim Chevalier
db478ed4de
Remove outdated comments
2011-06-28 17:50:07 -07:00
Michael Sullivan
b944d8d72e
Require that both sides of a swap be lvals.
2011-06-28 17:28:06 -07:00
Brian Anderson
83b7215366
Cleanup attribute code. Issue #487
2011-06-28 16:55:07 -07:00