Commit Graph

195 Commits

Author SHA1 Message Date
Jed Davis
33414d81d1 Fix long lines in for loop trans change 2013-01-13 14:37:59 -08:00
Niko Matsakis
c75d45d7e3 For for loop bodies, translate the type of the closure
based on the expr_loop_body expression and not the inner closure
2013-01-13 14:37:59 -08:00
Jed Davis
745a020db5 Make () actually size 0 2013-01-13 14:37:59 -08:00
Andrew Paseltiner
0de7aa5506 allow logical negation operator (!) to be overloaded 2013-01-11 14:31:44 -05:00
Patrick Walton
a0c2a9b743 librustc: Implement a #[no_mangle] attribute to suppress name mangling. r=brson
This is very helpful for SDL, as SDL wants you to define a function named
`SDL_main`.
2013-01-10 21:44:59 -08:00
Patrick Walton
ca71c6ec5b librustc: Make all external functions unsafe. r=tjc 2013-01-10 21:24:08 -08:00
Tim Chevalier
42095221f4 Properly suppress derived type error messages
Previously, the typechecker suppressed many but not all errors,
by suppressing errors where the actual type was either ty_err, or
a function type whose result was ty_err. Added a has_ty_err flag
to the type flags so as to suppress errors for any types involving
ty_err.

r=nmatsakis
2013-01-10 20:15:04 -08:00
Niko Matsakis
737e115646 mode: reset mode on entry to fn body.
This is an interim fix to address the "Beware!" unsoundness.  I have a
more comprehensive rewrite of mode.rs in the pipeline.

r=pcwalton
2013-01-10 13:17:25 -08:00
Patrick Walton
2a1b6c4de9 librustc: Implement &static as the replacement for Durable. r=nmatsakis 2013-01-10 11:16:54 -08:00
Patrick Walton
982830c836 librustc: Allow the type parameter version of Self to be spelled with a capital S 2013-01-10 10:37:22 -08:00
Niko Matsakis
2b92962aa2 A collection of refactorings that I found it hard/tiresome to divide:
- Make `extern fn()` assignable to any closure type, rather than
  a subtype.
- Remove unused int_ty_set and float_ty_set
- Refactor variable unification and make it more DRY
- Do fn sub/lub/glb on the level of fn_sig
- Rename infer::to_str::ToStr to infer::to_str::InferStr
- Capitalize names of various types
- Correct hashing of FnMeta
- Convert various records-of-fns into structs-of-fns.  This is both
  eliminating use of deprecated features and more forwards compatible
  with fn reform.

r=pcwalton
2013-01-09 14:59:07 -08:00
Graydon Hoare
dd5734d487 rustc: more fallout from 2db3abd 2013-01-09 09:49:11 -08:00
Erick Tryzelaar
2891a49f0d core: rename vec.filter to vec.filtered 2013-01-09 08:55:37 -08:00
Erick Tryzelaar
93c2ebf994 syntax: convert ast::spanned into a struct 2013-01-09 08:55:36 -08:00
Patrick Walton
2db3abddcd librustc: Make unqualified identifier searches terminate at the nearest module scope. r=tjc 2013-01-08 22:02:35 -08:00
Patrick Walton
44ab00ee37 Revert "librustc: Make unqualified identifier searches terminate at the nearest module scope. r=tjc"
This reverts commit a8d37af247.
2013-01-08 19:29:16 -08:00
Patrick Walton
a8d37af247 librustc: Make unqualified identifier searches terminate at the nearest module scope. r=tjc 2013-01-08 19:27:57 -08:00
Niko Matsakis
c3a74d87bd Implement GLB algorithm. (Issue #2263)
r=brson
2013-01-08 15:41:53 -08:00
Niko Matsakis
9f7dc1cb33 Remove ret_style and instead check whether fn return type is bot
cc #3681
2013-01-08 14:21:06 -08:00
Tim Chevalier
80435ad429 Make self visible when typechecking nested functions
Necessary to allow supertrait methods to be called in default methods.

r=nikomatsakis
2013-01-08 13:56:26 -08:00
Tim Chevalier
2d1ce01a8a Suppress error messages about function types whose result is ty_err
Ideally we would suppress error messages involving any types that
contain ty_err, but that's awkward to do right now.
2013-01-08 13:56:26 -08:00
Lindsey Kuper
816cb8c535 Rename identifiers that still use 'alt' to use 'match'
This'll be less confusing for anyone who works on match in future.
2013-01-08 14:31:58 -05:00
Niko Matsakis
16ec9aa6e7 Support assignability for struct fields. r=pcwalton 2013-01-07 18:46:37 -08:00
Tim Chevalier
4557f70487 Revert "Suppress type error message involving a function type whose result is ty_err"
This reverts commit e45312e5a0.
2013-01-07 18:27:20 -08:00
Tim Chevalier
7b433d098a Revert "Change the self def_id to a self_info in typeck, and inherit"
This reverts commit 921393c568.
2013-01-07 18:18:22 -08:00
Tim Chevalier
0e774de766 Revert "Improve a typeck ICE message (slightly)"
This reverts commit c662a9aad7.
2013-01-07 18:15:44 -08:00
Tim Chevalier
921393c568 Change the self def_id to a self_info in typeck, and inherit
That is, treat `self` as if it has dynamic scope. This seems to
be harmless, and prevents an ICE as per #3563
2013-01-07 18:08:19 -08:00
Tim Chevalier
86db69def2 Revert "xfail broken tests"
This reverts commit d771830c4c.
2013-01-07 18:04:30 -08:00
Tim Chevalier
d771830c4c xfail broken tests 2013-01-07 18:04:01 -08:00
Tim Chevalier
e45312e5a0 Suppress type error message involving a function type whose result is ty_err
In general it would be good to suppress any messages involving types that
have ty_err as a sub-component, but this works for now.
2013-01-07 16:14:25 -08:00
Tim Chevalier
c662a9aad7 Improve a typeck ICE message (slightly) 2013-01-07 16:14:25 -08:00
Patrick Walton
8bf38b26ee librustc: Fix some librustc test modes. rs=bustage 2013-01-07 15:37:48 -08:00
Patrick Walton
53f41f07ce librustc: Make vectors no longer implicitly copyable in rustc. r=graydon
~20% perf win for trans on -O0, with other minor improvements across the board.
No effect on -O2.
2013-01-07 14:17:36 -08:00
Tim Chevalier
09758f7072 Merge pull request #4357 from jld/constenum-bonus-fix
Trivial cleanup: use enum_is_univariant; no functional change intended.
2013-01-07 13:40:45 -08:00
Tim Chevalier
78aad60062 Merge pull request #4358 from jld/constenum-unit
Fix consts of nullary univariant enum type.
2013-01-07 13:40:05 -08:00
Patrick Walton
9f387926fc librustc: Fold rt items into lang items. Shaves another 10% or so off hello world compile time. 2013-01-07 12:21:34 -08:00
Patrick Walton
d2d1d98968 librustc: Encode language items into a special lookup table. 9% improvement in hello world compile time. 2013-01-07 10:51:53 -08:00
Patrick Walton
0ab7f9129e librustc: Refactor language items to have IDs. rs=refactor
Preparation for fixing the performance problems with language item collection.
2013-01-06 12:05:34 -08:00
Patrick Walton
96e01a67c7 librustc: Convert some large structural records over to structs. rs=perf
No effect on compile-time performance.
2013-01-06 11:16:14 -08:00
Patrick Walton
fa96740923 librustc: Remove some string allocations. rs=perf 2013-01-05 19:33:37 -08:00
Patrick Walton
1070cc0109 librustc: Fix unconditional ty_to_str call in ty.rs. Was heaviest path in allocation. Negligible perf win. rs=perf-fix 2013-01-05 18:41:22 -08:00
Jed Davis
6043a72774 Make consts of degenerate nullary enums not ICE.
This makes the const construction code match the logic in type_of.
2013-01-05 00:24:38 -08:00
Jed Davis
8f8b417811 Trivial cleanup: use enum_is_univariant; no functional change intended. 2013-01-05 00:24:33 -08:00
Patrick Walton
7b245d46ed librustc: Stop generating first-class aggregates in visit glue, since they kick us off fast isel. Closes #4352. rs=minor-perf-improvement 2013-01-04 23:07:58 -08:00
Tim Chevalier
89acd1f57f Rename option::get_default => get_or_default, get_zero => get_or_zero 2013-01-04 16:01:26 -08:00
gareth
624421aa3d Simplify idents_to_str and use it in more places. 2012-12-29 18:25:09 +00:00
gareth
d68954efa0 Fix the build by removing trailing whitespace. 2012-12-29 11:44:02 +00:00
gareth
b6aafe928d When an import fails to resolve, make the error message say
which import it actually was. This makes debugging imports
like: use aa::{x, y, z} easier (for issue #2914).
2012-12-29 11:15:54 +00:00
Tim Chevalier
a75c0b3b32 Merge pull request #4268 from catamorphism/issue-3477
Emit a type error for integer literals where the expected type is char
2012-12-28 13:05:58 -08:00
Patrick Walton
84ce55e542 librustc: Fix some unresolved imports in the test runner. rs=bustage 2012-12-27 15:50:03 -08:00