Commit Graph

1637 Commits

Author SHA1 Message Date
Viktor Dahl
9d915294c9 Implemented '-W type-limits' (#3833) 2012-10-24 18:44:37 +02:00
Patrick Walton
61bb3571a5 rustc: Implement construction of monomorphic struct-like variants. r=nmatsakis 2012-10-23 19:23:46 -07:00
Tim Chevalier
087cbb55d0 Remove <- operator from the compiler
Yield an obsolete syntax error on things like "let foo <- bar;"
and "foo <- bar;" r=brson

Progress on #3466
2012-10-23 12:10:19 -07:00
Tim Chevalier
48c8d1fecd Remove uses of binary move in the compiler 2012-10-23 12:10:04 -07:00
Patrick Walton
3bf0a9b094 rustc: Implement typechecking for simple monomorphic derivable traits on monomorphic types. r=brson 2012-10-23 10:45:23 -07:00
Brian Anderson
575950d12c rustc: Lower-case the error messages in kind.rs, for consistency 2012-10-23 10:41:33 -07:00
Brian Anderson
b2af873b76 Merge remote-tracking branch 'luqmana/incoming' 2012-10-22 21:44:53 -07:00
Patrick Walton
1048f9abfa rustc: Factor out struct literal typechecking in preparation for struct-like enum variants 2012-10-22 18:00:55 -07:00
Patrick Walton
ec1c60c4d6 rustc: Implement generic cross-crate trait inheritance 2012-10-22 18:00:48 -07:00
Simon BD
cc0f2c6bb2 Merge remote-tracking branch 'original/incoming' into incoming 2012-10-22 18:33:41 -05:00
Brian Anderson
5a86f5d084 rustc: Convert two printlns in trans into debug! 2012-10-22 13:33:44 -07:00
Brian Anderson
64e1ecb939 Long lines 2012-10-22 12:02:55 -07:00
Brian Anderson
2eea07be11 Merge pull request #3826 from jdm/doublefail
Fix ICE stemming from use of unique pointers in unreachable blocks.
2012-10-22 11:32:30 -07:00
Tim Chevalier
14e7df7d1a Fix breakage (forgot to commit this... 2012-10-22 10:54:23 -07:00
Tim Chevalier
dca0776747 Incorporate review comments (mostly fixing indentation)
Previous commit was r=nmatsakis
2012-10-22 09:44:56 -07:00
Tim Chevalier
dd66e7549b Preliminary support for labeled break/continue for loops
This patch adds preliminary middle-end support (liveness and trans)
for breaks and `loop`s to `loop` constructs that have labels.

while and for loops can't have labels yet.

Progress on #2216
2012-10-22 09:20:37 -07:00
Tim Chevalier
46d4bbbae4 Simplify the AST representation of ty param bounds
Change ast::ty_param_bound so that all ty param bounds are represented
as traits, with no special cases for Copy/Send/Owned/Const.
typeck::collect generates the special cases.

A consequence of this is that code using the #[no_core] attribute
can't use the Copy kind/trait. Probably not a big deal?

As a side effect, any user-defined traits that happen to be called
Copy, etc. in the same module override the built-in Copy trait.

r=nmatsakis

Closes #2284
2012-10-22 09:01:12 -07:00
Niko Matsakis
42c05fe642 Correct propagation of mutability from components to base in borrowck
Fixes #3828.
2012-10-21 23:52:36 -07:00
Luqman Aden
e1db959ec2 rustc: add new intrinsics - atomic_cxchg{_acq,_rel} 2012-10-21 22:23:50 -04:00
Josh Matthews
7c7980196c Fix ICE stemming from use of unique pointers in unreachable blocks. 2012-10-21 03:43:41 -04:00
Ben Striegel
ac81fff229 Remove old fixed-length vector syntax 2012-10-20 17:50:46 -07:00
Tim Chevalier
10612ee30c Remove superfluous by-ref in option::get, option::get_default, option::expect
Superficial change, no review.
2012-10-19 11:38:28 -07:00
Patrick Walton
754704ea94 rustc: Implement intra-crate static methods on anonymous trait implementations. r=nmatsakis 2012-10-18 14:29:18 -07:00
Erick Tryzelaar
a7ecde3323 libcore: minor code cleanup.
This is minor and probably completely inconsequential to performance,
but I find vec::map to be more clear than vec::each and a push.
2012-10-18 10:09:57 -07:00
Erick Tryzelaar
95423d28f2 libcore: call [u8] values bytes, not bufs 2012-10-18 10:09:42 -07:00
Erick Tryzelaar
4e03ffdb65 rustc: optimize away some mallocs when building GEP args 2012-10-18 08:03:04 -07:00
Tim Chevalier
33adb7a824 Merge pull request #3739 from killerswan/usagemsg
Add a module to getopts for verbose option group declaration (and use it in rustc)
2012-10-17 13:05:04 -07:00
Kevin Cantu
32baf1c54c Add a module to getopts to support verbose option definition
This is built on top of the existing functionality, but
adds a `groups` module which defines functions allowing
the user to specify whole short/long/description groups
at once and provides a usage message.
2012-10-17 12:10:06 -07:00
Tim Chevalier
7f12cc4e63 Merge pull request #3716 from Blei/fix-3656
rustc: fix size computation of structs for the FFI
2012-10-17 11:00:36 -07:00
Tim Chevalier
081a0434fb Remove integer suffixes 2012-10-16 23:32:58 -07:00
Tim Chevalier
1679960889 Change a use of map::get to map::find 2012-10-16 23:32:57 -07:00
Patrick Walton
4dc67c5e6a rustc: Implement intra-crate static methods on anonymous trait implementations. 2012-10-16 12:22:56 -07:00
Tim Chevalier
b38092e9a2 In ty::normalize_ty, don't replace self_regions with None
Instead, replace with re_static. This was causing ty::subst to
fail when called from trans::type_of::type_of.

Already discussed with nmatsakis and it's a small change, so
no review.

Closes #3447
2012-10-15 17:46:09 -07:00
Tim Chevalier
7d84505654 Error out in resolve if structs try to capture type parameters
Closes #3214
2012-10-15 16:27:53 -07:00
Patrick Walton
91ae5412d8 rustc: Merge module and type namespaces. r=brson 2012-10-15 15:35:36 -07:00
Patrick Walton
c886629d4f rustc: Implement monomorphic default methods. r=nmatsakis 2012-10-15 14:14:05 -07:00
Niko Matsakis
2a1aa9fb53 Check whether loans conflict with old loans or with themselves.
Along the way, convert from dvec-of-dvec representation to track loans in scope
to just a single flattened list.  It's more convenient.

Fixes #3765. r+ pcwalton.
2012-10-15 13:37:50 -07:00
Tim Chevalier
0643466f85 Fix whitespace 2012-10-15 13:14:23 -07:00
Tim Chevalier
7237268b70 Allow enum discriminator exprs to refer to declared consts
Also some work towards #3521

Closes #2428
2012-10-15 12:28:29 -07:00
Tim Chevalier
9406f8101d Avoid repeating 'try adding a move' hint 2012-10-12 22:15:13 -07:00
Tim Chevalier
f1e5b36ab2 Remove unneeded parens 2012-10-12 20:59:47 -07:00
Tim Chevalier
c6780fbb0c Make trans ignore last use 2012-10-12 20:43:38 -07:00
Tim Chevalier
c4155f5ea3 Change the kind checker to ignore results of last-use
and require explicit moves.

Also provide more info in some error messages.

Also: check that non-copyable struct fields don't get copied.
Closes #3481
2012-10-12 20:43:38 -07:00
Tim Chevalier
9abc7f0a1c (For legacy code:) In liveness, require that by-move arguments are rvalues 2012-10-12 20:43:38 -07:00
Tim Chevalier
d0ed13c4bd Make moves explicit in rustc::middle 2012-10-12 20:43:37 -07:00
Niko Matsakis
98887cc7ee remove ctor from ast (take 2) (no review: just dead code removal) 2012-10-12 19:46:37 -07:00
Niko Matsakis
cb55e246ba Use the Nth impl when translating a static method call, instead
of the 0th.  0th is only correct when there are no bound tps
on the trait.

Fixes #3741.
2012-10-12 17:46:43 -07:00
Graydon Hoare
57b4d10ff6 bump version to 0.5. 2012-10-12 16:41:32 -07:00
Kevin Cantu
1bede1f5e0 Replace several common macros of the form #m[...] with m!(...)
This commit replaces nearly all remaining uses of #fmt, #debug, #error,
and #info, and fixes some error messages...
2012-10-12 14:14:48 -07:00
Tim Chevalier
915897b3df Remove obsolete comment 2012-10-11 16:46:06 -07:00
Tim Chevalier
7509a3d75b Remove obsolete FIXME 2012-10-11 16:46:06 -07:00
Tim Chevalier
97c2255822 Use truncate in typeck::infer; gets rid of FIXME 2012-10-11 16:46:06 -07:00
Tim Chevalier
acaad9381d Remove obsolete comment 2012-10-11 16:46:06 -07:00
Tim Chevalier
41752b02b9 Update FIXME numbers 2012-10-11 16:46:01 -07:00
Tim Chevalier
db679a738f Remove obsolete FIXME 2012-10-11 16:46:00 -07:00
Tim Chevalier
6986acb340 Update FIXME numbers 2012-10-11 16:15:12 -07:00
Tim Chevalier
3764ec7025 Remove obsolete FIXME 2012-10-11 16:11:47 -07:00
Tim Chevalier
63dc83198a Remove obsolete FIXME 2012-10-11 16:10:07 -07:00
Tim Chevalier
fb667cde59 Update FIXME number 2012-10-11 16:10:02 -07:00
Tim Chevalier
72fc2b52db Remove unneeded no_rt flag 2012-10-11 16:06:17 -07:00
Tim Chevalier
5a8ba073bc Make to_str pure and fix const parameters for str-mutating functions
Two separate changes that got intertwined (sorry):

Make to_str pure. Closes #3691

In str, change functions like push_char to take an &mut str instead of
an &str. Closes #3710
2012-10-11 14:17:59 -07:00
Kevin Cantu
ae8e6781d2 Move the description of -(W|A|D|F) into the -W help message 2012-10-10 16:48:23 -07:00
Kevin Cantu
c419e77cc1 Touchup the debug flag description printing 2012-10-10 16:38:58 -07:00
Philipp Brüschweiler
25096a212a rustc: fix size computation of structs for the FFI
It didn't take alignment into account.

Fixes #3656.
2012-10-10 22:40:58 +02:00
Erick Tryzelaar
e325d029d4 Remove old serialization2 vestigial code 2012-10-09 18:03:07 -07:00
Tim Chevalier
22efa39382 Revert "Revert "Remove old auto_serialize2 code (needs snapshot)""
This reverts commit a33535e441.
2012-10-08 17:43:45 -07:00
Tim Chevalier
a33535e441 Revert "Remove old auto_serialize2 code (needs snapshot)"
This reverts commit 0bd6da8a8c.
2012-10-08 11:58:54 -07:00
Erick Tryzelaar
0bd6da8a8c Remove old auto_serialize2 code (needs snapshot) 2012-10-07 17:20:19 -07:00
Erick Tryzelaar
eb626e7119 Remove the old serializers (needs snapshot) 2012-10-07 17:20:19 -07:00
Erick Tryzelaar
e1c517ca48 migrate libsyntax/rustc to auto_serialize2 2012-10-07 10:32:25 -07:00
Simon BD
0e3bec0ced Merge remote-tracking branch 'original/incoming' into incoming 2012-10-06 13:15:18 -05:00
Tim Chevalier
f96a2a2ca1 Remove by-mutable-ref mode from the compiler
and test cases. Closes #3513
2012-10-05 22:45:50 -07:00
Tim Chevalier
28c45601b2 De-mode mysterious unused functions in middle::trans::shape (see comment) 2012-10-05 19:24:04 -07:00
Patrick Walton
b80b0688d5 rustc: Add a new method_self method call origin. Part of default methods. 2012-10-05 18:53:04 -07:00
Patrick Walton
38aab8e400 rustc: Thread a self type through trans_impl; fix cross-crate trait issue 2012-10-05 17:49:13 -07:00
Patrick Walton
d8287f0e41 rustc: Translate default methods on traits for each impl in which they're used instead of once.
This is a step on the way to default methods.
2012-10-05 17:31:46 -07:00
Tim Chevalier
45345bda6a Remove uses of mutable ref mode.
It's still in the compiler right now, but warned about
2012-10-05 16:57:37 -07:00
Patrick Walton
04497ea7b9 rustc: Implement simple uses of &trait 2012-10-05 16:57:13 -07:00
Tim Chevalier
f8bc0d2545 Revert "wip"
This reverts commit ca49fd402a.
2012-10-05 16:10:08 -07:00
Tim Chevalier
ca49fd402a wip 2012-10-05 15:39:12 -07:00
Tim Chevalier
e16dbb7888 Demode some code using by-mutbl-ref; warn about by-mutbl-ref
The parser now warns about use of mutbl-ref mode, though it's kind
of a lie since this commit doesn't remove support for the mode.

Changed move_val_init to have stage0 and stage1/2 versions, the latter of
which is demoded.

Changed the type that the typechecker expects the move_val_init
intrinsic to have. After this is pushed, I can make a new snapshot,
which will remove the need for the stage0 versions.
2012-10-05 15:37:01 -07:00
Patrick Walton
1b732145ec rustc: Implement simple trait inheritance.
Generic trait inheritance, cross-crate trait inheritance, and vtable-based
trait inheritance don't work yet.
2012-10-05 11:52:08 -07:00
Tim Chevalier
8fc60af441 Remove by-copy mode from std, mostly
One instance remains in net_tcp due to a foreign fn. Lots of
instances remain in serialization.rs, but IIRC that is being removed.

I had to do unholy things to task-perf-word-count-generic to get it
to compile after demoding pipes. I may well have messed up its
performance, but it passes.
2012-10-04 19:59:47 -07:00
Tim Chevalier
fe12da0864 De-mode comm::Chan 2012-10-04 16:48:57 -07:00
Brian Anderson
edc317b821 Remove arg vectors from main functions. Stop supporting them. 2012-10-04 15:07:49 -07:00
Simon BD
efcd2385ea Merge remote-tracking branch 'original/incoming' into incoming
Conflicts:
	src/libstd/json.rs
	src/libstd/sort.rs
2012-10-03 21:47:09 -05:00
Patrick Walton
d4351c9d39 rustc: Fix ICE when de-exporting rt 2012-10-03 18:15:33 -07:00
Orphée Lafond-Lummis
ae4f8fb87a rustc man page and usage text update.
* Mark --static as experimental;
* Remove --stats, as the option isn't implemented.
* Bold and surround by pointy brackets (<>) all the URLs of rustc man page, for
  consistency.
2012-10-03 20:19:20 -04:00
Patrick Walton
f885205b1b rustc: Unbreak old-style boxed traits 2012-10-03 17:18:24 -07:00
Patrick Walton
b34327be0d rustc: Implement "@Foo as @Bar" for boxed traits 2012-10-03 17:03:29 -07:00
Tim Chevalier
53906bb4fb Change default mode for fns to be by-copy, except for fn& 2012-10-03 16:34:36 -07:00
Tim Chevalier
9516e7b4b3 Revert "rustc: Don't error out early when constructing a boxed trait."
This reverts commit 5e7ff924b5.
2012-10-03 14:05:51 -07:00
Patrick Walton
2f451a7bd7 rustc: Only allow imports marked with "pub" to be imported from other modules 2012-10-02 18:15:19 -07:00
Patrick Walton
4101d8c22d rustc: Add a side table for legacy boxed traits, not filled in.
This is part of the transition to "@int as @Trait".
2012-10-02 16:19:03 -07:00
Patrick Walton
5e7ff924b5 rustc: Don't error out early when constructing a boxed trait.
This improves error messages a bit and helps pave the way for "@int as @Trait"
(as opposed to "int as @Trait").
2012-10-02 15:31:10 -07:00
Tim Chevalier
f78cdcb636 Removing explicit uses of + mode
This removes most explicit uses of the + argument mode. Pending a
snapshot, I had to remove the forbid(deprecated_modes) pragma from
a bunch of files. I'll put it back!

+ mode still has to be used in a few places for functions that get
moved (see task.rs)

The changes outside core and std are due to the to_bytes trait and
making the compiler (with legacy modes on) agree with the libraries
(with legacy modes off) about modes.
2012-10-02 14:31:39 -07:00
Patrick Walton
9284179311 libstd: Switch off legacy modes in both core and std. 2012-10-02 12:20:06 -07:00
Brian Anderson
6365adaa61 Don't warn about non-camel-case types by default 2012-10-02 09:36:50 -07:00
Erick Tryzelaar
8fc3088b2a rename vec::raw::form_slice to buf_as_slice
This matches the str::raw function.
2012-10-01 20:44:30 -07:00
Tim Chevalier
24fbf88230 In lint, don't complain about infer mode if legacy modes aren't enabled 2012-10-01 16:49:39 -07:00