Commit Graph

80 Commits

Author SHA1 Message Date
Niko Matsakis
202b8dcdc4 adapt to snapshot 2013-04-30 06:43:02 -04:00
Daniel Micay
f792baba42 only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
Alex Crichton
1e4a439f7f rustc: de-mode + fallout from libsyntax changes 2013-04-19 23:23:23 -04:00
bors
225d74f211 auto merge of #5914 : catamorphism/rust/copy-cops, r=catamorphism 2013-04-18 17:51:51 -07:00
Tim Chevalier
18db9a2954 rustc: One less copy 2013-04-18 14:50:29 -07:00
Brian Anderson
decd3901d5 core::comm: Modernize constructors to use new 2013-04-18 14:07:35 -07:00
Brian Anderson
a5ddc00982 rustc: Use an out pointer to return structs in x86 C ABI. #5347
This Adds a bunch of tests for passing and returning structs
of various sizes to C. It fixes the struct return rules on unix,
and on windows for structs of size > 8 bytes. Struct passing
on unix for structs under a certain size appears to still be broken.
2013-04-17 15:49:19 -07:00
Brian Anderson
23e44a529b Bump version to 0.7-pre 2013-04-10 13:12:53 -07:00
Niko Matsakis
5606fc0c90 Revert map.each to something which takes two parameters
rather than a tuple.  The current setup iterates over
`BaseIter<(&'self K, &'self V)>` where 'self is a lifetime declared
*in the each method*.  You can't place such a type in
the impl declaration.  The compiler currently allows it,
but this will not be legal under #5656 and I'm pretty sure
it's not sound now.
2013-04-10 07:51:48 -07:00
bors
92e265cdea auto merge of #5802 : nikomatsakis/rust/issue-4183-trait-substs, r=nikomatsakis
Cleanup substitutions and treatment of generics around traits in a number of ways

- In a TraitRef, use the self type consistently to refer to the Self type:
  - trait ref in `impl Trait<A,B,C> for S` has a self type of `S`.
  - trait ref in `A:Trait` has the self type `A`
  - trait ref associated with a trait decl has self type `Self`
  - trait ref associated with a supertype has self type `Self`
  - trait ref in an object type `@Trait` has no self type

- Rewrite `each_bound_traits_and_supertraits` to perform
  substitutions as it goes, and thus yield a series of trait refs
  that are always in the same 'namespace' as the type parameter
  bound given as input.  Before, we left this to the caller, but
  this doesn't work because the caller lacks adequare information
  to perform the type substitutions correctly.

- For provided methods, substitute the generics involved in the provided
  method correctly.

- Introduce TypeParameterDef, which tracks the bounds declared on a type
  parameter and brings them together with the def_id and (in the future)
  other information (maybe even the parameter's name!).

- Introduce Subst trait, which helps to cleanup a lot of the
  repetitive code involved with doing type substitution.

- Introduce Repr trait, which makes debug printouts far more convenient.

Fixes #4183.  Needed for #5656.

r? @catamorphism
2013-04-09 17:12:58 -07:00
Brian Anderson
23251b2438 Bump version to 0.7-pre 2013-04-09 10:59:32 -07:00
Niko Matsakis
9963bd2413 Cleanup substitutions and treatment of generics around traits in a number of ways.
- In a TraitRef, use the self type consistently to refer to the Self type:
  - trait ref in `impl Trait<A,B,C> for S` has a self type of `S`.
  - trait ref in `A:Trait` has the self type `A`
  - trait ref associated with a trait decl has self type `Self`
  - trait ref associated with a supertype has self type `Self`
  - trait ref in an object type `@Trait` has no self type

- Rewrite `each_bound_traits_and_supertraits` to perform
  substitutions as it goes, and thus yield a series of trait refs
  that are always in the same 'namespace' as the type parameter
  bound given as input.  Before, we left this to the caller, but
  this doesn't work because the caller lacks adequare information
  to perform the type substitutions correctly.

- For provided methods, substitute the generics involved in the provided
  method correctly.

- Introduce TypeParameterDef, which tracks the bounds declared on a type
  parameter and brings them together with the def_id and (in the future)
  other information (maybe even the parameter's name!).

- Introduce Subst trait, which helps to cleanup a lot of the
  repetitive code involved with doing type substitution.

- Introduce Repr trait, which makes debug printouts far more convenient.

Fixes #4183.  Needed for #5656.
2013-04-09 08:06:10 -07:00
Luqman Aden
727a565f1e librustc: Move inline asm stuff to different mod. 2013-03-27 15:41:58 -07:00
Patrick Walton
0a4d0f37ca librustc: Enforce that extern mod directives come first, then use directives, then items.
Resolve them in this order as well.
2013-03-26 21:30:17 -07:00
Daniel Micay
34c5a09ce3 option: rm functions that duplicate methods 2013-03-26 22:44:40 -04:00
Alex Crichton
6f812fef1b rustc: Remove uses of oldmap::HashMap 2013-03-26 19:21:04 -04:00
Huon Wilson
12df65470f Kill some warnings: unused imports and old #[deny(..)]s. 2013-03-25 01:17:23 +11:00
Andrew Paseltiner
9966eaaba4 rustc: replace uses of old deriving attribute with new one 2013-03-22 06:24:19 -04:00
Ben Striegel
fdf69dd7b0 Finish de-implicit-selfing everything but the test suite 2013-03-08 19:34:39 -05:00
Jed Davis
626ad484fe Unified algebraic datatype representation implementation, initial version.
Later changes on this branch adapt the rest of rustc::middle::trans
to use this module instead of scattered hard-coded knowledge of
representations; a few of them also have improvements or cleanup for
adt.rs (and many added comments) that weren't drastic enough to justify
changing history to move them into this commit.
2013-03-06 20:37:23 -08:00
Alex Crichton
dfb5c10dea Remove unused imports throughout src/ 2013-03-04 12:27:01 -05:00
Jyun-Yan You
c2a61d7df3 rustc: implement MIPS O32 ABI 2013-03-03 20:02:03 -08:00
Jyun-Yan You
5150b9811b rustc: MIPS32 support 2013-03-03 19:27:27 -08:00
Patrick Walton
97fd421319 librustc: Remove fn@, fn~, and fn& from librustc. rs=defun 2013-03-02 16:49:31 -08:00
Patrick Walton
a3f728238b librustc: Forbid chained imports and fix the logic for one-level renaming imports 2013-03-02 16:49:30 -08:00
Patrick Walton
9519ee5d80 librustc: "APL2" -> "ASL2". rs=license-fix 2013-03-01 08:41:31 -08:00
sevrak
833ad6018e Fix license attribute on crates 2013-02-28 13:34:01 +00:00
Ben Striegel
43d43adf6b Turn old drop blocks into Drop traits 2013-02-27 19:14:19 -05:00
bors
99a902c81d auto merge of #5120 : jbclements/rust/macros-have-scope, r=pcwalton
r?

After this patch, macros declared in a module, function, or block can only be used inside of that module, function or block, with the exception of modules declared with the #[macro_escape] attribute; these modules allow macros to escape, and can be used as a limited macro export mechanism.

This pull request also includes miscellaneous comments, lots of new test cases, a few renamings, and a few as-yet-unused data definitions for hygiene.
2013-02-26 20:00:38 -08:00
bors
93a7f237d7 auto merge of #5115 : sanxiyn/rust/arm-abi, r=brson
Type size and alignment code needs to be factored, but I didn't want to interfere with MIPS port. Can be done later.

Fix #4797.
2013-02-26 17:57:41 -08:00
John Clements
ca147a029e Change imported macros to use leaky modules rather than leaky functions. 2013-02-26 10:26:41 -08:00
Patrick Walton
e2f90091cf libcore: Move Cell to core and de-~mut core and std 2013-02-26 04:18:12 -08:00
Seo Sanghyeon
5098cf5bd2 ARM C ABI implementation 2013-02-26 20:24:15 +09:00
Brian Anderson
dab6a85230 core: Extract comm from pipes. #4742 2013-02-21 17:36:54 -08:00
Luqman Aden
cd82c4566b librustc: Get rid of structural records save for front/test.rs. 2013-02-20 18:45:50 -08:00
Erick Tryzelaar
53951afe48 librustc: convert lint_dict to take @~strs as keys 2013-02-19 10:02:52 -08:00
Patrick Walton
bb833ca0f0 librustc: Stop parsing impl Type : Trait and fix several declarations that slipped through. r=tjc 2013-02-15 16:59:56 -08:00
Luqman Aden
99b3c07b4e librustc: Get rid of move. 2013-02-15 02:49:55 -08:00
Nick Desaulniers
4445b38df2 Remove die!, raplace invocations with fail! Issue #4524 pt 3 2013-02-13 17:01:32 -08:00
Daniel Micay
a32c5c73ee oldmap: get rid of legacy _ref suffixes 2013-02-08 19:12:51 -05:00
Patrick Walton
472797b04a librustc: Lots of de-muting. rs=demuting 2013-02-07 16:17:39 -08:00
Daniel Micay
81b4f36d49 oldmap: remove legacy each method 2013-02-03 15:55:11 -05:00
Daniel Micay
2e496818a5 oldmap: get rid of the legacy each_key method 2013-02-03 15:55:10 -05:00
Daniel Micay
319eeb1c79 rename map -> oldmap and mark it as deprecated
LinearMap is quite a bit faster, and is fully owned/sendable without
requiring copies. The older std::map also doesn't use explicit self and
relies on mutable fields.
2013-02-03 15:55:10 -05:00
Nick Desaulniers
aee7929469 Replace most invocations of fail keyword with die! macro 2013-01-31 20:12:49 -08:00
Niko Matsakis
0682ad0eb9 Finalize moves-based-on-type implementation.
Changes:

- Refactor move mode computation
- Removes move mode arguments, unary move, capture clauses
  (though they still parse for backwards compatibility)
- Simplify how moves are handled in trans
- Fix a number of illegal copies that cropped up
- Workaround for bug involving def-ids in params
  (see details below)

Future work (I'll open bugs for these...):

- Improve error messages for moves that are due
  to bindings
- Add support for moving owned content like a.b.c
  to borrow check, test in trans (but I think it'll
  "just work")
- Proper fix for def-ids in params

Def ids in params:

Move captures into a map instead of recomputing.

This is a workaround for a larger bug having to do with the def-ids associated
with ty_params, which are not always properly preserved when inlining.  I am
not sure of my preferred fix for the larger bug yet.  This current fix removes
the only code in trans that I know of which relies on ty_param def-ids, but
feels fragile.
2013-01-31 12:09:00 -08:00
Patrick Walton
ae50912875 librustc: De-export rustc. rs=deexporting 2013-01-30 13:44:24 -08:00
Patrick Walton
684aa2b7fd librustc: De-export ty. rs=deexporting 2013-01-30 12:18:08 -08:00
Patrick Walton
ba11e96289 librustc: De-export trans. rs=deexporting 2013-01-30 11:47:02 -08:00
Brian Anderson
7ad0716275 rustc: Convert to pipes 2013-01-30 01:52:01 -08:00