Patrick Walton
e7c60c141b
librustc: Remove pure
from libsyntax and librustc.
2013-03-22 12:57:27 -07:00
bors
9584c60871
auto merge of #5484 : pcwalton/rust/snapshots, r=pcwalton
2013-03-22 00:00:50 -07:00
Patrick Walton
e7dbe6cd6f
librustc: Register new snapshots
2013-03-21 18:10:20 -07:00
Marvin Löbel
0a47cd5ef1
Un-renamed trim and substr functions.
2013-03-21 23:06:05 +01:00
Marvin Löbel
ee2f3d9673
Switched over substr and trim functions in str to be non-allocating, temporary renamed them to better track use-sites
2013-03-21 23:06:04 +01:00
Luqman Aden
d68b98a5bf
Don't use by_val for passing asm operands.
2013-03-15 18:55:44 -07:00
Luqman Aden
3d56936be3
Tidy.
2013-03-15 18:55:44 -07:00
Luqman Aden
e182ac4bbd
Actually use no or multiple operands properly.
2013-03-15 18:55:44 -07:00
Luqman Aden
9ead7dad93
Implicitly use addr_of for output operands in asm.
2013-03-15 18:55:44 -07:00
Luqman Aden
59dcbd9f1c
Initial support for output operands in asm.
2013-03-15 18:55:44 -07:00
Luqman Aden
d8ab47e7f9
Properly handle input operands for inline asm.
2013-03-15 18:55:43 -07:00
Luqman Aden
6d078db952
Actually pass inline asm operands around.
2013-03-15 18:55:43 -07:00
Patrick Walton
24a0de4e7f
librustc: Separate out trait storage from evec/estr storage
2013-03-13 20:07:08 -07:00
Luqman Aden
18b71a7831
Add alignstack option for inline asm.
2013-03-12 01:03:35 -07:00
Luqman Aden
5aa734d6a1
Parse operands properly and add a way to indicate volatile asm.
2013-03-12 01:03:34 -07:00
Luqman Aden
fc78b93c41
Wrap llvm::InlineAsm::AsmDialect
2013-03-12 01:03:34 -07:00
Luqman Aden
ecccc0d649
Parse inline assembly.
2013-03-12 01:03:34 -07:00
Patrick Walton
d18f785457
librustc: Replace all uses of fn()
with &fn()
. rs=defun
2013-03-11 09:35:58 -07:00
Patrick Walton
9a17ef9b52
librustc: Stop parsing assert
.
2013-03-07 22:37:57 -08:00
Patrick Walton
d7e74b5e91
librustc: Convert all uses of assert
over to fail_unless!
2013-03-07 22:37:57 -08:00
Patrick Walton
954ae9c975
libsyntax: Remove struct literal expressions from the compiler
2013-03-07 22:32:55 -08:00
Patrick Walton
4e3dbfe052
librustc: Remove structural record types from the compiler
2013-03-07 22:32:54 -08:00
Josh Matthews
7bb03345cf
Inline constants across crates.
2013-03-07 15:34:52 -05:00
Jed Davis
1f9bc64bae
adt.rs renaming: "field" rather than "element"; set_discr -> start_init.
...
This way "field" refers to the abstraction and "element" (as in get_elt,
"get element pointer", etc.) refers to the low-level LLVM operations.
2013-03-06 20:41:58 -08:00
Jed Davis
e13111fc5a
Even more comments for ADT-related interfaces
2013-03-06 20:41:58 -08:00
Jed Davis
6840b48074
trans_cast_to_int is hard to explain; make it trans_get_discr instead.
2013-03-06 20:41:58 -08:00
Jed Davis
a9026c7f19
Memoize trans::adt::represent_type
2013-03-06 20:41:58 -08:00
Jed Davis
6bb6baba2c
Renovate cast-to-int
2013-03-06 20:41:57 -08:00
Jed Davis
3a4714d92e
Renovate field projection expressions
2013-03-06 20:41:57 -08:00
Jed Davis
40313fb6b0
Renovate nullary variant construction
2013-03-06 20:41:57 -08:00
Jed Davis
fdd28451f6
Convert expr_struct to use adt, and try to share code with tuples.
2013-03-06 20:41:57 -08:00
Jed Davis
5cbc2571c1
Renovate expr_tup translation
2013-03-06 20:41:57 -08:00
Alex Crichton
dfb5c10dea
Remove unused imports throughout src/
2013-03-04 12:27:01 -05:00
Patrick Walton
ccec510f39
librustc: Stop parsing fn@
, fn~
, and fn&
2013-03-02 18:47:48 -08:00
Patrick Walton
02a4b5bed3
Merge remote branch 'nmatsakis/issue-4808-representation-of-extern-fn' into incoming
2013-03-01 08:43:36 -08:00
Alex Crichton
2df07ddc25
Fix implicit leaks of imports throughout libraries
...
Also touch up use of 'pub' and move some tests around so the tested functions
don't have to be 'pub'
2013-02-28 18:00:34 -05:00
Niko Matsakis
febdb49e92
Change bare functions so that they are represented by a single pointer.
...
The basic idea is that we add a new kind of adjustment, AutoAddEnv, that pads
an extern fn into a closure by adding the extra NULL word. Then there are a few
misc changes in trans to get the LLVM types to match up.
Fixes #4808 .
2013-02-28 16:03:49 -05:00
Patrick Walton
107bf96ff0
librustc: Mark all type implementations public. rs=impl-publicity
2013-02-28 11:32:24 -08:00
John Clements
ca147a029e
Change imported macros to use leaky modules rather than leaky functions.
2013-02-26 10:26:41 -08:00
bors
ba7a870660
auto merge of #5051 : bstrie/rust/deimpself, r=pcwalton
...
With the exception of three places where explicit self ran into borrowing errors. Will try those again once borrowing is refined.
2013-02-22 10:24:43 -08:00
Graydon Hoare
0309af458c
Put unique allocs in managed heap when they might contain managed boxes.
2013-02-21 23:01:17 -08:00
Ben Striegel
4a853894fa
De-implicit-self librustc
2013-02-22 01:42:03 -05:00
Patrick Walton
9c71249b9d
librustc: De-mut trans. rs=demuting
2013-02-21 15:45:55 -08:00
Tim Chevalier
0c3290a217
Merge
2013-02-20 18:45:50 -08:00
Luqman Aden
cd82c4566b
librustc: Get rid of structural records save for front/test.rs.
2013-02-20 18:45:50 -08:00
Brian Anderson
423843e54b
Don't perform swap when src == dst. #5041
2013-02-20 16:18:48 -08:00
Patrick Walton
9143688197
librustc: Replace impl Type : Trait
with impl Trait for Type
. rs=implflipping
2013-02-14 14:44:12 -08:00
Jed Davis
3742b62f64
Omit discriminant from nullary univariant enums.
...
If an enum is isomorphic to unit, there's no need to use any bits to
represent it. The only obvious reason this wasn't the case was because
the enum could be C-like and have a user-specified discriminant -- but
that value is constant, so it doesn't need to be stored.
This change means that all newtype-like enums have the same size (and
layout) as their underlying type, which might be a useful property to
have, at least in terms of making programs' low-level behavior less
surprising.
2013-02-09 22:28:43 -08:00
Daniel Micay
a32c5c73ee
oldmap: get rid of legacy _ref suffixes
2013-02-08 19:12:51 -05:00
Niko Matsakis
a32498d846
Make ~fn non-copyable, make &fn copyable, split barefn/closure types,
...
correct handling of moves for struct-record update.
Part of #3678 . Fixes #2828 , #3904 , #4719 .
2013-02-07 05:53:30 -08:00
Patrick Walton
6d13c90256
librustc: Stop loading enum variant discriminants from memory
2013-02-06 15:08:33 -08:00
Patrick Walton
b34f871dda
librustc: Change i1 to i8 for bools. Attempts to put out burning tree. rs=burningtree
2013-02-06 14:28:02 -08:00
Patrick Walton
801f3225b2
oldmap: use &K instead of K in find and get
...
This reverts commit a4250a96fd
.
This is not the cause of the nonexhaustive-match failure.
2013-02-05 19:41:45 -08:00
Graydon Hoare
a4250a96fd
Revert "oldmap: use &K instead of K in find and get"
...
This reverts commit 8e643525d4
.
2013-02-05 14:30:53 -08:00
Daniel Micay
8e643525d4
oldmap: use &K instead of K in find and get
2013-02-03 23:30:56 -05:00
Daniel Micay
f4a27b2c7d
oldmap: get rid of the legacy contains_key method
2013-02-03 15:55:10 -05:00
Brian Anderson
9dc6938292
Merge remote-tracking branch 'nickdesaulniers/issue4524' into nocomm1
2013-02-01 11:18:58 -08:00
Nick Desaulniers
7868b6bf55
Remove fail keyword from lexer & parser and clean up remaining calls to
...
fail
Fix merge conflicts - Issue 4524
2013-02-01 00:15:42 -08:00
John Clements
53688addaa
test cases, cleanup
2013-01-31 23:05:12 -08:00
Niko Matsakis
71478f9ce3
Workaround for #4717 : pad contents of ast. rs=breakage
2013-01-31 16:56:12 -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
a47fa9b32f
librustc: De-export some of trans. rs=deexporting
2013-01-29 22:14:08 -08:00
Patrick Walton
eb4d39e1fe
libstd: Remove "dual impls" from the language and enforce coherence rules. r=brson
...
"Dual impls" are impls that are both type implementations and trait
implementations. They can lead to ambiguity and so this patch removes them
from the language.
This also enforces coherence rules. Without this patch, records can implement
traits not defined in the current crate. This patch fixes this, and updates
all of rustc to adhere to the new enforcement. Most of this patch is fixing
rustc to obey the coherence rules, which involves converting a bunch of records
to structs.
2013-01-29 10:42:45 -08:00
Seo Sanghyeon
d10b5c725b
Add is_mutbl field to def_arg
2013-01-22 23:34:34 -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
Erick Tryzelaar
293cd3480c
convert ast::{field_,capture_item_,mt} and middle::ty::mt into structs
2013-01-14 21:36:27 -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
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
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
Patrick Walton
ca71c6ec5b
librustc: Make all external functions unsafe. r=tjc
2013-01-10 21:24:08 -08:00
Graydon Hoare
dd5734d487
rustc: more fallout from 2db3abd
2013-01-09 09:49:11 -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
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
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
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
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
Patrick Walton
4c2e4c37ce
librustc: Make use
statements crate-relative by default. r=brson
2012-12-13 13:05: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
Patrick Walton
ab3b752906
librustc: Implement "&mut [T]" as an expression. r=brson
2012-12-07 18:29:10 -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
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
b8cfd5c414
librustc: Long lines. rs=rustbot
2012-12-04 21:13:02 -08:00
Patrick Walton
33c1e47c1b
librustc: Implement moves based on type. r=nmatsakis
2012-12-04 15:38:04 -08:00
Patrick Walton
56ece46f7d
librustc: Remove all legacy pattern bindings from libsyntax and librustc. rs=refactoring
2012-12-04 14:19:19 -08:00
Graydon Hoare
00c856c0b1
Update license, add license boilerplate to most files. Remainder will follow.
2012-12-03 17:12:14 -08:00
Patrick Walton
f34833abfc
librustc: Make a.b()
always a method call. r=nmatsakis
2012-11-30 20:41:46 -08:00
Patrick Walton
9e1c9be16f
librustc: Make the Drop trait use explicit self
2012-11-29 11:06:15 -08:00
Brian Anderson
fc06114ddf
Merge remote-tracking branch 'brson/companion' into incoming
...
Conflicts:
src/compiletest/compiletest.rs
src/libcargo/cargo.rs
src/libcore/core.rs
src/librustc/rustc.rs
src/librustdoc/rustdoc.rc
2012-11-28 13:17:33 -08:00
Brian Anderson
8179e268ef
Register snapshots
2012-11-28 12:33:00 -08:00
Patrick Walton
ca6970a65e
librustc: Make overloaded operators with explicit self translate correctly
2012-11-28 11:01:14 -08:00
Patrick Walton
1c348e6e38
librustc: Implement @mut [T] as the new replacement for @[mut T]
2012-11-27 09:23:31 -08:00
Patrick Walton
318e534895
rustc: Implement explicit self for Eq and Ord. r=graydon
2012-11-19 15:33:11 -08:00
Brian Anderson
69a8b4d8e2
Rename src/rustc to src/librustc. Use the driver crate
2012-11-07 13:53:39 -08:00