Commit Graph

254 Commits

Author SHA1 Message Date
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
Brian Anderson
3b71d14442 Inject std when --test. #1127, #3241 2013-01-08 14:58:39 -08:00
ILyoan
2d3c22ae59 arrange core::os::consts 2013-01-08 14:35:28 -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
3a570075b1 librustc: Remove unused mod_path_map. This was expensive to build. Saves another 15% or so. r=tjc 2013-01-07 12:54:46 -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
e26ca35b08 librustc: Fix the test runner, the condition system, and core test. rs=bustage 2012-12-27 17:53:04 -08:00
Patrick Walton
84ce55e542 librustc: Fix some unresolved imports in the test runner. rs=bustage 2012-12-27 15:50:03 -08:00
Tim Chevalier
0873553680 Merge pull request #4298 from JensNockert/byteswap
Add support for byteswap intrinsics
2012-12-27 10:47:15 -08:00
Jens Nockert
a51661e8c1 Add support for byteswap intrinsics
Adds support for the llvm.bswap.i{8,16,32} intrinsics, which swaps the
byte order from little endian to big endian, or the reverse.
2012-12-27 19:07:05 +01:00
Patrick Walton
57c599914a librustc: Terminate name searches at the nearest module scope for paths that contain at least two components. r=graydon 2012-12-27 10:02:54 -08:00
Erick Tryzelaar
efb8711f90 Merge branch 'master' of github.com:mozilla/rust into incoming 2012-12-27 10:34:27 -05:00
Graydon Hoare
329316ce15 bump 0.5 => 0.6, redirect some URLs in docs. 2012-12-24 18:29:01 -08:00
Tim Chevalier
499a58708f Assign correct types to struct-like enum variant constructors
Before, the type was just the enum type itself, which caused an
assertion failure in iter_variant in trans::base.

r=brson

Closes #4229
2012-12-24 15:59:15 -08:00
Tim Chevalier
65839fa622 Emit a type error for integer literals where the expected type is char
For example, in let x: char = 42; This was an ICE and is now a
proper type error, as per #3477
2012-12-22 15:58:05 -08:00
Graydon Hoare
dbd36111fe bump 0.5 => 0.6, redirect some URLs in docs. 2012-12-21 15:35:49 -08:00
Jens Nockert
82641d4c39 Add support for bitcount intrinsics
Adds support for the llvm.ctpop, llvm.ctlz and llvm.cttz intrinsics.
2012-12-21 19:30:33 +01:00
Erick Tryzelaar
76a2891feb Remove the cfg(stageN)-specific serialize code. 2012-12-20 12:52:53 -08:00
Erick Tryzelaar
c14105bb8a Remove serialize::traits submodule. 2012-12-19 18:16:20 -08:00
Brian Anderson
dac88fa7e6 Remove transitional path2 attribute 2012-12-19 14:23:53 -08:00
Brian Anderson
97ddf3c7bd Stop resolving static methods at the module level. Closes #4179 2012-12-18 18:35:18 -08:00
Graydon Hoare
8e28f23c60 core: add macro_rules! for "condition! { c: in -> out; }". 2012-12-18 17:22:27 -08:00
Erick Tryzelaar
85bb1fc2c4 Change iter::find's closure to take a ref 2012-12-17 22:01:38 -08:00
Brian Anderson
23564574ac Change the default_methods lint mode from forbid to deny to fix tests 2012-12-17 20:41:12 -08:00
Erick Tryzelaar
8650c6f683 Switch from serialization to std::serialize. (snapshot) 2012-12-17 20:00:36 -08:00
Brian Anderson
33a8f855c2 Make the path and path2 attributes equivalent. Remove some uses 2012-12-17 18:06:52 -08:00
Jakub Wieczorek
6530fd3401 When matching a slice, the tail should have the same lifetime 2012-12-17 16:50:40 -08:00
Jakub Wieczorek
1fdfd3b1d6 Simplify the exhaustiveness check and add comments 2012-12-17 16:50:40 -08:00
Jakub Wieczorek
856dbac567 Use the same logic for _ and [..tail] when checking reachability 2012-12-17 16:50:40 -08:00
Jakub Wieczorek
1968cb315a Add support for destructuring vectors in match expressions 2012-12-17 16:50:40 -08:00
Patrick Walton
ebd9ad4d04 librustc: Add a lint mode for deprecated self. r=brson 2012-12-14 19:46:55 -08:00
Patrick Walton
41c0d7083e librustc: Fix type_use for generic newtype structs. Closes #4188. rs=bugfix 2012-12-14 19:44:07 -08:00
Patrick Walton
8a9ccf81b0 librustc: Implement a lint mode for default methods. r=brson 2012-12-14 19:28:43 -08:00
Patrick Walton
99fa9c3cab Revert "librustc: Implement a lint mode for default methods"
This reverts commit 53b181dd47.
2012-12-14 19:13:59 -08:00
Patrick Walton
53b181dd47 librustc: Implement a lint mode for default methods 2012-12-14 19:07:20 -08:00
Patrick Walton
bdb2d659ae librustc: Ensure that no moves from the inside of @ or & boxes occur. rs=crashing-servo 2012-12-14 18:19:07 -08:00
Brian Anderson
e6d1b02359 Rename core::comm to core::oldcomm 2012-12-14 14:59:32 -08:00
Patrick Walton
1b9f740f2f librustc: Reset the mode context to MoveValue for block lambdas. rs=bugfix 2012-12-13 21:44:19 -08:00
Patrick Walton
57e4ed479e librustc: Add missing case in mem_categorization. rs=bugfix 2012-12-13 18:03:48 -08:00
Patrick Walton
036b26a197 librustc: Remove merge markers. rs=oops 2012-12-13 16:17:57 -08:00
Patrick Walton
732c39c183 librustc: Have coherence check Copy kind bounds when determining whether parameter substitutions could possibly unify. r=nmatsakis 2012-12-13 16:14:54 -08:00
Brian Anderson
ed4fac01b5 Rename Send trait to Owned 2012-12-13 15:52:50 -08:00
Brian Anderson
a277081ee4 Rename Owned trait to Durable 2012-12-13 15:52:50 -08:00
Patrick Walton
cd120736cb librustc: Allow moves out of self. r=nmatsakis 2012-12-13 15:49:07 -08:00
Patrick Walton
45848b2040 librustc: Automatically move non-implicitly-copyable types into unique closures. r=nmatsakis 2012-12-13 15:33:33 -08:00
Brian Anderson
7ca94369da Fix encoding of trait static method paths. Closes #4097. r=pcwalton 2012-12-13 15:02:42 -08:00
Patrick Walton
efb9b74718 librustc: Fix explicit self for objects in more cases. r=nmatsakis 2012-12-13 13:29:08 -08:00
Patrick Walton
4c2e4c37ce librustc: Make use statements crate-relative by default. r=brson 2012-12-13 13:05:22 -08:00
Brian Anderson
6047dd35bb Fix vtable calculations when translating static methods. Closes #4165 2012-12-12 17:14:39 -08:00
Graydon Hoare
9cced55b93 syntax: remove all remaining uses of #ast, and #ast / qquote itself. 2012-12-12 15:02:47 -08:00
Tim Chevalier
d42bdf1997 Auto-deref when checking field and method privacy
This disallows using pointers to sneak around priv qualifiers.

Deeming this too small for review as well. Closes #3763
2012-12-11 19:17:31 -08:00
Brian Anderson
a7159be24a Remove old deriving 2012-12-11 18:11:14 -08:00
Tim Chevalier
6439f2d546 Avoid extra error for type mismatches in patterns
When a type error has already occurred, don't call ty::subst,
which may ICE due to the mismatch in the number of type params
involved.

I'm deeming this too small to review.

Closes #3680
2012-12-11 17:38:57 -08:00
Brian Anderson
364f9afb64 Remove duplicate bound_to_str code 2012-12-11 13:59:21 -08:00
Tim Chevalier
94a76843f4 Revert "Merge pull request #4144 from luqmana/deprecated-attribute"
This reverts commit f675b97ddc, reversing
changes made to e7dd3af970.
2012-12-11 12:28:30 -08:00
Tim Chevalier
1abad3b4e6 Fix whitespace 2012-12-11 11:42:44 -08:00
Tim Chevalier
01c0971172 Allow pattern-matching on any strings, not just unique strings
r=brson

Closes #3574
2012-12-11 11:22:13 -08:00
Tim Chevalier
f675b97ddc Merge pull request #4144 from luqmana/deprecated-attribute
Add deprecated attribute.
2012-12-10 21:16:20 -08:00
Tim Chevalier
e7dd3af970 Remove commented-out code 2012-12-10 21:08:22 -08:00
Tim Chevalier
0046ed9462 Remove un-needed code for obsolete classes
and rename "class" to "struct" everywhere possible (except local
vars, I was too lazy for that) -- that is why this commit is so
big.

No review, just dead code removal and renaming.

Closes #3515
2012-12-10 18:45:01 -08:00
Graydon Hoare
12c32e944d Add license boilerplate to more files. 2012-12-10 17:32:58 -08:00
Patrick Walton
3f78e0ecc0 librustc: Fix bug preventing cross-crate struct destructuring from working. rs=bugfix 2012-12-10 12:38:31 -08:00
Patrick Walton
ac2b0456f4 librustc: Remove is_self_field from borrowck. Unused. rs=#rust 2012-12-10 10:50:45 -08:00
Luqman Aden
4b4c8331bb Add deprecated attribute. 2012-12-09 02:26:12 -05:00
Tim Chevalier
42f8a3366a Print out a more helpful type error message for do-blocks/for-loops
If a do-block body has the wrong type, or a for-loop body has a
non-() type, suggest that the user might have meant the other one.

Closes #2817

r=brson
2012-12-08 23:04:38 -08:00
Patrick Walton
98fdcb0b9d librustc: De-mode pattern bindings. r=nmatsakis 2012-12-07 19:34:57 -08:00