Commit Graph

1562 Commits

Author SHA1 Message Date
Patrick Walton
8b56a8380b librustc: Modify all code to use new lifetime binder syntax 2013-03-26 21:30:17 -07:00
Patrick Walton
142dbd65da librustc: Remove all uses of the old [T * N] fixed-length vector syntax 2013-03-26 21:29:34 -07:00
Patrick Walton
0d52b22e7b libcore: Change [const T] to const [T] everywhere 2013-03-26 21:29:33 -07:00
Daniel Micay
34c5a09ce3 option: rm functions that duplicate methods 2013-03-26 22:44:40 -04:00
Alex Crichton
d69108d8f7 std: Remove the oldmap module 2013-03-26 19:21:05 -04:00
Alex Crichton
fa7772893a Remove unused imports throughout 2013-03-26 19:20:02 -04:00
Marvin Löbel
c99488b3a4 Isolated bug, static vector seems to behave differently than fixed sized one 2013-03-26 14:59:17 +01:00
Marvin Löbel
b9de2b5787 Switched over a bunch of splitting funktions to non-allocating iterators 2013-03-26 14:59:17 +01:00
Marvin Löbel
d74606ead6 pre-rebase commit 2013-03-26 14:59:17 +01:00
bors
7481524978 auto merge of #5528 : thestinger/rust/find_mut, r=brson
This currently requires workarounds for the borrow checker not being flow-sensitive for `LinearMap` and `TrieMap`, but it can already be expressed for `TreeMap` and `SmallIntMap` without that.
2013-03-25 22:24:57 -07:00
bors
47ddb59b80 auto merge of #5525 : dbaupp/rust/minor_fixups, r=graydon
Kills some warnings, and implements str::each_char_reverse so that it actually iterates. The test case wasn't detecting a failure, since the loop body was never executed.
2013-03-25 21:18:57 -07:00
bors
00605d58de auto merge of #5513 : apasel422/rust/deriving, r=luqmana
This removes some explicit implementations of `Eq` in favor of `#[deriving(Eq)]` and derives `Clone` for a few core types.
2013-03-25 19:01:00 -07:00
bors
b48e6998d7 auto merge of #5509 : thestinger/rust/oldmap, r=brson
The reasoning for doing it this way is that it's much easier to transition method-by-method to the `Map` API than trying to do the migration all at once.

I found an issue unrelated to my changes in one of the run-fail tests - if it uses `LinearMap`, it still fails but exits with 0. I xfailed it for now and opened [an issue](https://github.com/mozilla/rust/issues/5512), because it's not caused by these changes.
2013-03-25 18:01:04 -07:00
Brian Anderson
30d4124a37 Merge remote-tracking branch 'brson/rt'
Conflicts:
	src/libcore/rt/context.rs
	src/libcore/rt/sched.rs
	src/libcore/rt/thread.rs
	src/libcore/rt/uv.rs
2013-03-25 12:28:54 -07:00
Daniel Micay
38f39ac540 expose find_mut in the Map trait 2013-03-24 21:40:16 -04:00
Daniel Micay
f0f4a00e88 smallintmap: add find_mut method 2013-03-24 21:40:13 -04:00
Daniel Micay
7948149456 treemap: add a find_mut method 2013-03-24 16:58:52 -04:00
Huon Wilson
12df65470f Kill some warnings: unused imports and old #[deny(..)]s. 2013-03-25 01:17:23 +11:00
Andrew Paseltiner
45677eebf2 replace impls with deriving where applicable 2013-03-23 06:57:30 -04:00
Daniel Micay
11ca2efce1 turn std::oldmap into a wrapper around LinearMap 2013-03-23 02:16:14 -04:00
Patrick Walton
6d81307a9b librustc: Add explicit lifetime binders and new lifetime notation in core/std/syntax/rustc 2013-03-22 22:24:35 -07:00
Patrick Walton
85c9fc6f8f librustc: Remove the const declaration form everywhere 2013-03-22 22:24:35 -07:00
Daniel Micay
705c796ffa remove obsolete purity workarounds 2013-03-22 18:08:56 -04:00
Patrick Walton
c1084091d4 libstd: Remove all uses of pure from libstd. rs=depure 2013-03-22 10:29:17 -07:00
Patrick Walton
4634f7edae librustc: Remove all uses of static from functions. rs=destatic 2013-03-22 10:27:39 -07:00
Andrew Paseltiner
4055fe83f6 std: replace uses of old deriving attribute with new one 2013-03-22 06:24:19 -04:00
bors
9584c60871 auto merge of #5484 : pcwalton/rust/snapshots, r=pcwalton 2013-03-22 00:00:50 -07:00
bors
334e921421 auto merge of #5481 : thestinger/rust/deque, r=z0w0 2013-03-21 21:57:52 -07:00
bors
d52408d46a auto merge of #5480 : pcwalton/rust/at-const, r=pcwalton
r? @catamorphism
2013-03-21 20:39:51 -07:00
bors
5f2d4102c5 auto merge of #5479 : Kimundi/rust/str-dealloc, r=z0w0
This makes the `trim` and `substr` functions return a slice instead of an `~str`, and removes the unnecessary `Trimmable` trait (`StrSlice` already contains the same functionality).

Also moves the `ToStr` implementations for the three str types into the str module in anticipation of further untangling.
2013-03-21 19:39:53 -07:00
Patrick Walton
e7dbe6cd6f librustc: Register new snapshots 2013-03-21 18:10:20 -07:00
Patrick Walton
d4fee24c7c librustc: Forbid destructors from being attached to any structs that might contain non-Owned fields. r=nmatsakis 2013-03-21 17:31:34 -07:00
Daniel Micay
b2060174d4 deque: add a module docstring 2013-03-21 19:14:02 -04:00
bors
ec8345b18a auto merge of #5407 : jbclements/rust/add-assert-eq-macro, r=jbclements
Adds an assert_eq! macro that asserts that its two arguments are equal. Error messages can therefore be somewhat more informative than a simple assert, because the error message includes "expected" and "given" values.
2013-03-21 15:24:54 -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
bors
b8899138f8 auto merge of #5466 : Kimundi/rust/view-slice-rename, r=bstrie
A slice now always refers to something that returns an borrowed pointer, views don't exist anymore. If you want to have an explictit copy of a slice, use `to_owned()`
2013-03-21 07:06:54 -07:00
Marvin Löbel
9d9a209e9a back-renamed slice_DBG_BRWD, slice_V_DBG_BRWD -> slice, slice_DBG_UNIQ -> slice_unique 2013-03-21 14:05:57 +01:00
bors
a8527e2e97 auto merge of #5456 : graydon/rust/fixups, r=pcwalton
Stage markers for stage3 and a trivial prelude fix.
2013-03-20 18:27:48 -07:00
Marvin Löbel
a7d296f24c renamed str::view -> slice_DBG_BRWD
renamed str::slice -> slice_DBG_UNIQ
changed vec slice method -> to_owned()
renamed vec view method  -> slice_V_DBG_BRWD
2013-03-21 01:50:32 +01:00
bors
b12714eff5 auto merge of #5455 : pcwalton/rust/framework, r=catamorphism
r? @catamorphism
2013-03-20 16:42:47 -07:00
John Clements
3cd65c233d change some uses of fail_unless to assert_eq 2013-03-20 16:05:59 -07:00
Patrick Walton
9c4d804cfe libsyntax: Never use ::<> in the type grammar 2013-03-20 13:54:25 -07:00
Graydon Hoare
9350d14ecb add stage3 markers where necessary for dist-snap 2013-03-20 13:48:57 -07:00
Erick Tryzelaar
cefecd8601 core: add str::each{,i}_reverse 2013-03-20 07:53:23 -07:00
Erick Tryzelaar
fe74a1c9a2 core: rename vec::rev_each{,i} to vec::each{,i}_reverse
I'm making this change because the _reverse suffix is more commonly
used in libcore/libstd.
2013-03-19 20:24:04 -07:00
Patrick Walton
e78f2e2ac5 librustc: Make the compiler ignore purity.
For bootstrapping purposes, this commit does not remove all uses of
the keyword "pure" -- doing so would cause the compiler to no longer
bootstrap due to some syntax extensions ("deriving" in particular).
Instead, it makes the compiler ignore "pure". Post-snapshot, we can
remove "pure" from the language.

There are quite a few (~100) borrow check errors that were essentially
all the result of mutable fields or partial borrows of `@mut`. Per
discussions with Niko I think we want to allow partial borrows of
`@mut` but detect obvious footguns. We should also improve the error
message when `@mut` is erroneously reborrowed.
2013-03-18 17:21:16 -07:00
Patrick Walton
c4db4faefa libsyntax: Stop parsing old lifetimes, except for the ones on data type declarations. 2013-03-18 17:21:15 -07:00
Patrick Walton
352c070365 librustc: Convert all uses of old lifetime notation to new lifetime notation. rs=delifetiming 2013-03-18 17:21:14 -07:00
Brian Anderson
54bb7226e1 core: Simplify uvll bindings and strip out currently-unused bits
No more mapping uv structs to Rust structs
2013-03-18 16:59:37 -07:00
Brian Anderson
d30c758974 Give core::rt and std::net their own uvll bindings
I intend to do some big refactoring and don't want to deal w/ std just now
2013-03-18 16:59:11 -07:00
bors
6f1e8ef71a auto merge of #5404 : bstrie/rust/decopy, r=pcwalton
Also turn `copy` into `.clone()` in much of run-pass.
2013-03-15 20:15:44 -07:00
Ben Striegel
748c2c9ebc impl Clone for ~T, ~[T], ~str 2013-03-15 18:26:59 -04:00
Daniel Micay
2b6614f2e6 treemap: use each_mut instead of mutate 2013-03-15 14:14:03 -04:00
Daniel Micay
88278f9c35 treemap: rm old FIXME 2013-03-15 14:12:45 -04:00
Daniel Micay
b3ee49c7e2 deque: add documentation 2013-03-15 14:05:27 -04:00
Daniel Micay
a49ccee68e MutableIter impl for Option + use it in treemap 2013-03-14 23:44:25 -04:00
bors
0c7aeddb5f auto merge of #5365 : thestinger/rust/map, r=catamorphism 2013-03-14 15:06:49 -07:00
Patrick Walton
a410652bc9 librustc: Remove "base types" from the language. 2013-03-13 20:07:09 -07:00
Patrick Walton
b1c699815d librustc: Don't accept as Trait anymore; fix all occurrences of it. 2013-03-13 20:07:09 -07:00
ILyoan
278a4dbb0f Remove unused imports in std 2013-03-14 09:52:51 +09:00
Daniel Micay
becad9bb07 add the mutate_values method to the Map trait 2013-03-13 19:33:10 -04:00
Niko Matsakis
852619d5d7 Remove ++ mode from the compiler (it is parsed as + mode)
and obsolete `-` mode altogether (it *was* parsed as `+` mode).
2013-03-13 17:00:09 -04:00
Niko Matsakis
efc7f82bc4 Revamp foreign code not to consider the Rust modes. This requires
adjusting a few foreign functions that were declared with by-ref
mode.  This also allows us to remove by-val mode in the near future.

With copy mode, though, we have to be careful because Rust will implicitly pass
somethings by pointer but this may not be the C ABI rules.  For example, rust
will pass a struct Foo as a Foo*.  So I added some code into the adapters to
fix this (though the C ABI rules may put the pointer back, oh well).

This patch also includes a lint mode for the use of by-ref mode
in foreign functions as the semantics of this have changed.
2013-03-13 16:59:37 -04:00
bors
695e9fd13c auto merge of #5293 : brson/rust/logging, r=brson
r? @graydon

This removes `log` from the language. Because we can't quite implement it as a syntax extension (probably need globals at the least) it simply renames the keyword to `__log` and hides it behind macros.

After this the only way to log is with `debug!`, `info!`, etc. I figure that if there is demand for `log!` we can add it back later.

I am not sure that we ever agreed on this course of action, though I *think* there is consensus that `log` shouldn't be a statement.
2013-03-13 10:40:07 -07:00
bors
15d78fc398 auto merge of #5329 : wanderview/rust/std-getopts-opts_present, r=graydon
Currently the opts_present() function only checks to see if the option is
configured in the match, but doesn't actually check to see if the option
value has been set.  This means that opt_present('h') may return false while
opts_present([~'h']) returns true.

Add a test case to catch this condition and fix opts_present() to check
the value before returning true.

Note, there is another API difference between these two functions that this
does not address.  Currently if you pass a non-configured option to
opt_present() the program will fail!(), but opts_present() simply returns
false.  If it is acceptable to standardize on the fail!() then opts_present()
should probably be implemented in terms of the opt_present() function.
2013-03-12 09:21:56 -07:00
Brian Anderson
82f190355b Remove uses of log 2013-03-11 23:19:42 -07:00
bors
2fef18abf2 auto merge of #5310 : thestinger/rust/treeset, r=graydon 2013-03-11 22:09:43 -07:00
Ben Kelly
4f4f69d731 Fix std::getopts::opts_present() to check value.
Currently the opts_present() function only checks to see if the option is
configured in the match, but doesn't actually check to see if the option
value has been set.  This means that opt_present('h') may return false while
opts_present([~'h']) returns true.

Add a test case to catch this condition and fix opts_present() to check
the value before returning true.

Note, there is another API difference between these two functions that this
does not address.  Currently if you pass a non-configured option to
opt_present() the program will fail!(), but opts_present() simply returns
false.  If it is acceptable to standardize on the fail!() then opts_present()
should probably be implemented in terms of the opt_present() function.
2013-03-11 23:12:31 -04:00
Brian Anderson
676e0290ed core: Add rt mod and add the new scheduler code 2013-03-11 19:44:29 -07:00
Daniel Micay
9b1a9ec4ea treemap: fix a bug in the union implementation 2013-03-11 22:36:23 -04:00
Daniel Micay
2889a8a4e5 treemap: add more set tests 2013-03-11 22:36:23 -04:00
Daniel Micay
66afa5d17a treemap: refactor the set operation tests 2013-03-11 22:36:19 -04:00
Daniel Micay
d55225f04a treemap: add more tests for set difference 2013-03-11 15:02:55 -04:00
Daniel Micay
ad16fecc33 treemap: inline the TreeSet wrappers 2013-03-11 15:02:50 -04:00
Daniel Micay
a5c88366f8 treemap: indentation fixes 2013-03-11 15:02:18 -04:00
Daniel Micay
58cec70127 treemap: make set_advance public 2013-03-11 15:02:15 -04:00
Patrick Walton
4faf63e472 libstd: Remove all newtype enums from std and core. 2013-03-11 09:35:59 -07:00
Patrick Walton
bd2d17e4a1 libsyntax: Stop parsing bare functions in preparation for switching them over 2013-03-11 09:35:58 -07:00
Patrick Walton
d18f785457 librustc: Replace all uses of fn() with &fn(). rs=defun 2013-03-11 09:35:58 -07:00
Ben Kelly
13e58597a1 Correct copyright year to be 2012-2013.
Previous year range of 2011-2013 was based on file creation date.  The
check_license python script, however, only accepts copyrights starting
in 2012 or later.
2013-03-10 20:47:28 -04:00
Ben Kelly
a363862102 Fix formatting and errors in std::getopts example.
There were three issues effecting the example in the getopts rustdoc:

1. The blockquote was incorrectly formatted.  Fixed by switching to using
   an explicit markdown code section with ```.
2. The `fail fail_str(f)` would not compile.  Fixed by using `fail!()` instead
   of `fail`.
3. The line `matches.free[0]` produced a compile error about moving from
   an immutable vector.  Fix by using `copy`.
2013-03-10 17:27:31 -04:00
Alex Crichton
62651df2b4 Fix dvec-related fallout in tests 2013-03-08 09:56:52 -05:00
Alex Crichton
87f864292d std: Remove uses of DVec 2013-03-08 09:54:20 -05:00
Patrick Walton
d661711cc2 test: Fix tests. 2013-03-07 22:37:58 -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
6b5d1afeec librustc: Remove "extern mod { ... }" from librustc, librustdoc, and tests. rs=deexterning 2013-03-07 22:32:52 -08:00
Patrick Walton
87e44af2f2 libstd: Remove extern mod { ... } from libstd. rs=deexterning 2013-03-07 22:32:52 -08:00
Ben Striegel
0fed29cfb7 De-implicit-self libstd 2013-03-07 21:11:09 -05:00
Niko Matsakis
3168fe06ff Add manual &self/ and &static/ and /&self declarations that
are currently inferred.  New rules are coming that will require
them to be explicit.  All add some explicit self declarations.
2013-03-06 15:12:57 -05:00
Niko Matsakis
6267339d68 Fix bug in coherence that causes all cross-crate impls to be regarded as
inherent impls, not just those of the `impl Type` variety.
2013-03-06 11:02:19 -05:00
Erick Tryzelaar
743cfce703 core: convert vec::{last,last_opt} to return references 2013-03-05 19:39:18 -08:00
Erick Tryzelaar
d6e583ab10 std: remove an unnecessary copy from workcache 2013-03-05 19:37:04 -08:00
bors
afd6196d7b auto merge of #5233 : bstrie/rust/deimpselfcore, r=graydon 2013-03-05 08:12:51 -08:00
bors
eddefbc893 auto merge of #5212 : thestinger/rust/iter, r=graydon
A small step towards fixing #2827
2013-03-05 02:06:50 -08:00
Ben Striegel
9db61e0c21 De-implicit-self libcore 2013-03-04 22:36:15 -05:00
Alex Crichton
cb4ab76e4a Adding missing imports for tests, and gate off others 2013-03-04 12:27:01 -05:00
Alex Crichton
dfb5c10dea Remove unused imports throughout src/ 2013-03-04 12:27:01 -05:00
Jyun-Yan You
5150b9811b rustc: MIPS32 support 2013-03-03 19:27:27 -08:00
Daniel Micay
af645e8487 replace option::iter with a BaseIter impl 2013-03-03 11:01:17 -05:00