Commit Graph

430 Commits

Author SHA1 Message Date
Seo Sanghyeon
800b8a759d Implement mut in arguments 2013-01-22 23:34:34 -08:00
Seo Sanghyeon
d10b5c725b Add is_mutbl field to def_arg 2013-01-22 23:34:34 -08:00
Seo Sanghyeon
9a5d617092 Add is_mutbl field to arg 2013-01-22 23:34:33 -08:00
Seo Sanghyeon
3ed39ce26f Handle divide by zero in constant evaluator 2013-01-23 15:07:00 +09:00
Daniel Micay
9cdcd9bff9 migrate gather_loans.rs to LinearSet 2013-01-22 22:10:04 -05:00
Daniel Micay
342cb602db migrate coherence.rs to LinearSet 2013-01-22 22:10:00 -05:00
Graydon Hoare
bcaeb20800 long line police 2013-01-22 17:53:27 -08:00
Josh Matthews
72259e0772 Translate const references to extern functions as *i8 instead of the typical closure pair. Fixes #4522. 2013-01-22 16:22:55 -08:00
Tim Chevalier
9d672671e2 Make borrowck's notion of scopes consistent with trans's notion of scopes
This eliminates an ICE in trans where the scope for a particular
borrow was a statement ID, but the code in trans that does cleanups
wasn't finding the block with that scope. As per #3860

preserve looks at a node ID to see if it's for a statement -- if it
is, it uses the enclosing scope instead when updating the map that
trans looks at later.

I added a comment noting that this is not the best fix (since it may
cause boxes to be frozen for longer than necessary) and referring
to #3511.

r=nmatsakis
2013-01-22 15:59:45 -08:00
Tim Chevalier
10260bee38 Change debuginfo to not use an option for the output type...
...now without a random libuv change.
2013-01-22 15:13:23 -08:00
Tim Chevalier
a36eacc4f9 Revert "Clean up previous commit to not require an Option"
I made a mistake and included some submodule weirdness.
About to re-push the patch without that.

This reverts commit 17ea548275.
2013-01-22 15:12:35 -08:00
Tim Chevalier
17ea548275 Clean up previous commit to not require an Option 2013-01-22 14:28:05 -08:00
Josh Matthews
5b4e569bf3 Fix building of all rustc components with -g. 2013-01-22 14:27:21 -08:00
Tim Chevalier
a8d076d2de syntax/rustc: Make some metadata-related functions take slices, kill bad copies
Too small to review.
2013-01-22 11:58:08 -08:00
Tim Chevalier
8869e72386 Simplify path_entry's closure argument
Make the closure take two arguments instead of a single `path_entry`
struct; remove the `path_entry` type. This eliminates a bad copy.
2013-01-22 11:06:54 -08:00
Tim Chevalier
d3bb4990dd rustc: Make metadata::encoder::encode_path take an &path
Eliminates some bad copies.
2013-01-21 20:39:58 -08:00
Tim Chevalier
01f26249bb rustc: Print out region errors involving a function scope properly 2013-01-20 19:51:33 -08:00
Tim Chevalier
bc5dd2f557 rustc: Suppress more derived errors 2013-01-20 15:13:29 -08:00
Erick Tryzelaar
7f2c399f3a Convert many libsyntax records into structs
Specifically:

ast_map::ctx
ast_util::id_range
diagnostic::{handler_t,codemap_t}
auto_encode::field
ext::base::{macro_def,syntax_expander_tt,syntax_expander_tt_item}
ext::pipes::proto::next_state
2013-01-20 14:08:18 -08:00
Erick Tryzelaar
28da4ecdaa convert librustc record types to structs
specifically:

freevars::freevar_entry
ty::{field_ty,AutoAdjustment,AutoRef}
mod::{method_param,method_map_entry}
2013-01-20 14:08:18 -08:00
Erick Tryzelaar
d5d77b9351 convert the remaining ast record types into structs
These are: region,arg,fn_decl,method,_mod,foreign_mod,
variant_arg,enum_def_,variant_,trait_ref.
2013-01-20 14:08:18 -08:00
Erick Tryzelaar
8cdc3fda11 convert ast::ty into a struct 2013-01-20 14:08:18 -08:00
Erick Tryzelaar
8a3a1fc148 convert ast::expr into a struct 2013-01-20 14:08:18 -08:00
Tim Chevalier
96b4f43675 Handle region errors where the actual scope is a statement
Prevents a case of "unknown scope, this is a bug".

I judged this too small to review. Closes #4500
2013-01-19 17:06:36 -08:00
Tim Chevalier
97b20f8e02 rustc: Make type_names and named_types tables in trans use @str instead of ~str
Cuts down on bad copies (though there are still a few that can go
away once there are impls of push / append / + for @str)
2013-01-18 14:30:29 -08:00
Tim Chevalier
9c1476e7a4 Comments: turn XXXes into FIXMEs 2013-01-18 14:21:31 -08:00
Brian Anderson
6b6acde972 Add a license check to tidy. #4018 2013-01-17 23:28:42 -08:00
Tim Chevalier
1244c0b6fd rustc: One Less Bad Copy 2013-01-17 19:17:24 -08:00
Niko Matsakis
440f8dfc4e Correct tests
rs=breakage
2013-01-17 18:45:57 -08:00
Niko Matsakis
532c94d0f1 Propagate expected types through block expressions.
r=graydon
2013-01-17 18:45:48 -08:00
Niko Matsakis
9fed56ed90 When decoding types, indicate to the def-id conversion function what kind of
def-id we have, so that the inliner can distinguish between external and
internal def-ids.  Also add some comments explaining the distinction!

Fixes #4516.

r=graydon
2013-01-17 18:45:45 -08:00
Patrick Walton
f405e41d7a librustc: Implement write guards for borrowing @mut to & or &mut. r=nmatsakis 2013-01-17 11:50:20 -08:00
Tim Chevalier
8bde2c1d65 Minor cleanup and eliminate a bad copy 2013-01-16 19:29:38 -08:00
Patrick Walton
a2ec5400ff Merge pull request #4493 from jbclements/rename-moved-variable-to-moved-value
s/moved variable/moved value/
2013-01-16 12:30:55 -08:00
Graydon Hoare
989667e545 librustc: minor missing change for crate-as-struct. 2013-01-15 17:57:45 -08:00
Graydon Hoare
84825ee310 librustc: Make the default sigil for block lambdas & instead of @. 2013-01-15 17:57:45 -08:00
Brian Anderson
bd6536f868 Merge pull request #4497 from ILyoan/i4488
When building a test runner, don't remove the main function
2013-01-15 17:27:45 -08:00
ILyoan
a63b11a009 when test, just remove #[main] attr 2013-01-15 17:06:37 +09:00
Erick Tryzelaar
293cd3480c convert ast::{field_,capture_item_,mt} and middle::ty::mt into structs 2013-01-14 21:36:27 -08:00
Erick Tryzelaar
4bcd19f6be Convert ast::{pat,field_pat,local_,arm} into structs 2013-01-14 20:52:28 -08:00
Erick Tryzelaar
0b9e23146b convert ast::crate_ into a struct. 2013-01-14 19:06:59 -08:00
Erick Tryzelaar
4b0f702608 convert ast::attribute_ and ast::view_item to a struct 2013-01-14 18:15:54 -08:00
Erick Tryzelaar
1f5e9ff362 convert ast::struct_def to a struct 2013-01-14 18:15:54 -08:00
Erick Tryzelaar
530a113bfa convert ast::item into a struct 2013-01-14 18:15:53 -08:00
Erick Tryzelaar
ebea895d02 convert ast::struct_dtor_ into a struct 2013-01-14 18:14:17 -08:00
Erick Tryzelaar
5c0d674a45 convert ast::foreign_item to a struct 2013-01-14 18:14:16 -08:00
Erick Tryzelaar
df7d376d25 Convert ast::def_id into a struct. 2013-01-14 18:14:16 -08:00
Erick Tryzelaar
bea67bde21 Change ast::path into a struct. 2013-01-14 18:14:16 -08:00
John Clements
3bf8b8af98 s/moved variable/moved value/ 2013-01-14 17:38:22 -08:00
Tim Chevalier
a4dc65baa1 syntax/rustc: Eliminate some bad copies
r=pcwalton
2013-01-14 15:49:53 -08:00
ILyoan
b7cefd0c96 allowing the entry point name to be something other than main
add build tests
2013-01-14 13:58:13 -08:00
Brian Anderson
e6b57f858f Add FIXME's for #4404. Android JNI hacks 2013-01-13 16:43:39 -08:00
kyeongwoon
987f824f23 Support ARM and Android
Conflicts:
	src/libcore/os.rs
	src/librustc/back/link.rs
	src/librustc/driver/driver.rs
	src/librustc/metadata/loader.rs
	src/librustc/middle/trans/base.rs
2013-01-13 16:43:39 -08:00
Tim Chevalier
fbc33e0247 Merge pull request #4459 from jld/constenum
Allow consts to be initialized by non-nullary enum constructors
2013-01-13 14:42:57 -08:00
Jed Davis
1b01629f18 Make vectors (& old ports) of zero-size types allocate one byte each. 2013-01-13 14:37:59 -08:00
Jed Davis
ea53c48ca2 Make empty structs debug-printable 2013-01-13 14:37:59 -08:00
Jed Davis
1b4f3fad1e Correct (I hope) amd64 ABI handling for empty structs 2013-01-13 14:37:59 -08:00
Jed Davis
cd01ecfe13 One more place where for loops and their bodies need to be unconfused. 2013-01-13 14:37:59 -08:00
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
Jed Davis
349fa1e550 Omit needless zeroes for C-like variants of non-C-like enums 2013-01-11 23:42:51 -08:00
Jed Davis
abae61257c Allow consts to be non-nullary enum constructors 2013-01-11 23:42:51 -08:00
Jed Davis
f76e28aa1c Allow consts' LLVM types to depend on their initializers.
Loosening the connection between the LLVM type and the Rust type
is necessary to use non-nullary enum constructors as const initializers,
because the const needs to be initialized with data of the actual type of
the variant in question, which is (generally) not the same as the u8
array in the `type_of` type.

Thus, referring to a const now requires casting the LLVM global to the
expected pointer type instead of using it as-is.
2013-01-11 23:42:51 -08:00
Jed Davis
452642422d Factor out base::get_discrim_val from const translation 2013-01-11 23:42:51 -08:00
Tim Chevalier
847d30db66 Merge pull request #4445 from apasel422/notop
Allow logical negation operator (!) to be overloaded
2013-01-11 20:10:51 -08:00
Tim Chevalier
cfa62cd5ee Make ast_util::path_name_i take a slice vector, eliminate a bad copy 2013-01-11 15:19:05 -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
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
Patrick Walton
ab3b752906 librustc: Implement "&mut [T]" as an expression. r=brson 2012-12-07 18:29:10 -08:00
Brian Anderson
e5e6d3c43d Long lines 2012-12-07 16:48:55 -08:00
Brian Anderson
ecdc8aae41 Remove impl_id from trait_ref. Unused 2012-12-07 15:54:17 -08:00
Brian Anderson
2fcf562d16 Add an auto-slice-and-ref step to method lookup. Allows ~[T] to work with explicit self 2012-12-07 15:29:38 -08:00
Brian Anderson
e71081ec03 Merge pull request #4101 from brson/bound-default-methods
Call default methods on bound typarams more correctly
2012-12-07 15:10:57 -08:00
Brian Anderson
791f976e8c Remove hack to not use type_use on x86 2012-12-06 19:45:32 -08:00
Patrick Walton
cf3972e95a librustc: Propagate type uses correctly from method calls to the containing functions. rs=bugfix
This adds a new script, `monodebug.pl`. It can be used to diagnose problems stemming from incorrect combining of monomorphic generic instantiations.
2012-12-06 19:11:51 -08:00
Tim Chevalier
d2ad028a7c Rename std::ebml::Reader => std::ebml::reader, same for writer
Closes #4076
2012-12-06 16:14:54 -08:00
Brian Anderson
3464f60c00 Remove previous x86 data corruption workaround. #4054 2012-12-06 15:26:22 -08:00
Brian Anderson
55aa49882d Turn off type_use on x86. #4127 2012-12-06 15:26:22 -08:00
Brian Anderson
c5ee9818ae Eleminate pattern warnings 2012-12-06 14:11:11 -08:00
Patrick Walton
7203be1109 librustc: Fix handling of ~ and @ unary operators in mode computation. Closes #4114. rs=bugfix 2012-12-05 22:57:58 -08:00
Patrick Walton
4fc03bac65 librustc: Implement "-Z no-monomorphic-collapse" as a debugging tool to diagnose mysterious crashes we're seeing. rs=debug-tool 2012-12-05 20:45:58 -08:00
Patrick Walton
aa3aa3b1b2 librustc: Fix type_use to not treat i1* arguments as interchangeable with i8* arguments. Closes #3917. rs=bugfix 2012-12-05 20:23:14 -08:00
Patrick Walton
e23ea24aed librustc: Move the "legality of move bindings" check from typechecking to alt checking. rs=refactoring 2012-12-05 19:01:14 -08:00
Patrick Walton
16506c0250 librustc: Make a context including the method map in check_alt, in preparation for moving check_legality_of_move_bindings there. rs=refactoring 2012-12-05 18:28:34 -08:00
Brian Anderson
1fc802233b Long lines 2012-12-05 18:10:45 -08:00
Brian Anderson
4f3cc01487 Fix cross-crate inlining of static functions 2012-12-05 18:09:52 -08:00
Patrick Walton
1282fc8074 librustc: Hook borrow check loan checking up to the moves-based-on-type infrastructure. rs=helps-unbreak-the-build 2012-12-05 15:07:48 -08:00
Patrick Walton
b8cfd5c414 librustc: Long lines. rs=rustbot 2012-12-04 21:13:02 -08:00
Brian Anderson
01cd53baf0 Merge remote-tracking branch 'luqmana/incoming'
Conflicts:
	src/librustc/middle/typeck/check.rs
2012-12-04 18:49:50 -08:00
Patrick Walton
c0d3b291d5 librustc: Shot in the dark to try to unbreak Windows. rs=me 2012-12-04 16:03:50 -08:00
Patrick Walton
33c1e47c1b librustc: Implement moves based on type. r=nmatsakis 2012-12-04 15:38:04 -08:00
Patrick Walton
f02e9db212 librustc: Remove bogus ValueMode. rs=tree-on-fire 2012-12-04 15:09:40 -08:00