summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2013-03-14auto merge of #5365 : thestinger/rust/map, r=catamorphismbors-1/+30
2013-03-13librustc: Remove "base types" from the language.Patrick Walton-29/+29
2013-03-13librustc: Don't accept `as Trait` anymore; fix all occurrences of it.Patrick Walton-44/+51
2013-03-14Remove unused imports in stdILyoan-1/+0
2013-03-13add the mutate_values method to the Map traitDaniel Micay-1/+30
2013-03-13Remove `++` mode from the compiler (it is parsed as `+` mode)Niko Matsakis-2/+2
and obsolete `-` mode altogether (it *was* parsed as `+` mode).
2013-03-13Revamp foreign code not to consider the Rust modes. This requiresNiko Matsakis-8/+8
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-13auto merge of #5293 : brson/rust/logging, r=brsonbors-149/+146
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-12auto merge of #5329 : wanderview/rust/std-getopts-opts_present, r=graydonbors-4/+5
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-11Remove uses of logBrian Anderson-149/+146
2013-03-11auto merge of #5310 : thestinger/rust/treeset, r=graydonbors-113/+94
2013-03-11Fix std::getopts::opts_present() to check value.Ben Kelly-4/+5
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-11core: Add rt mod and add the new scheduler codeBrian Anderson-1939/+17
2013-03-11treemap: fix a bug in the union implementationDaniel Micay-0/+4
2013-03-11treemap: add more set testsDaniel Micay-0/+10
2013-03-11treemap: refactor the set operation testsDaniel Micay-80/+34
2013-03-11treemap: add more tests for set differenceDaniel Micay-16/+21
2013-03-11treemap: inline the TreeSet wrappersDaniel Micay-12/+20
2013-03-11treemap: indentation fixesDaniel Micay-14/+14
2013-03-11treemap: make set_advance publicDaniel Micay-2/+2
2013-03-11libstd: Remove all newtype enums from std and core.Patrick Walton-14/+40
2013-03-11libsyntax: Stop parsing bare functions in preparation for switching them overPatrick Walton-2/+4
2013-03-11librustc: Replace all uses of `fn()` with `&fn()`. rs=defunPatrick Walton-210/+210
2013-03-10Correct copyright year to be 2012-2013.Ben Kelly-1/+1
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-10Fix formatting and errors in std::getopts example.Ben Kelly-5/+8
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-08Fix dvec-related fallout in testsAlex Crichton-15/+9
2013-03-08std: Remove uses of DVecAlex Crichton-59/+51
2013-03-07test: Fix tests.Patrick Walton-17/+27
2013-03-07librustc: Convert all uses of `assert` over to `fail_unless!`Patrick Walton-1598/+1632
2013-03-07librustc: Remove "extern mod { ... }" from librustc, librustdoc, and tests. ↵Patrick Walton-3/+6
rs=deexterning
2013-03-07libstd: Remove `extern mod { ... }` from libstd. rs=deexterningPatrick Walton-195/+238
2013-03-07De-implicit-self libstdBen Striegel-127/+128
2013-03-06Add manual &self/ and &static/ and /&self declarations thatNiko Matsakis-114/+159
are currently inferred. New rules are coming that will require them to be explicit. All add some explicit self declarations.
2013-03-06Fix bug in coherence that causes all cross-crate impls to be regarded asNiko Matsakis-0/+21
inherent impls, not just those of the `impl Type` variety.
2013-03-05core: convert vec::{last,last_opt} to return referencesErick Tryzelaar-4/+4
2013-03-05std: remove an unnecessary copy from workcacheErick Tryzelaar-1/+1
2013-03-05auto merge of #5233 : bstrie/rust/deimpselfcore, r=graydonbors-9/+9
2013-03-05auto merge of #5212 : thestinger/rust/iter, r=graydonbors-2/+2
A small step towards fixing #2827
2013-03-04De-implicit-self libcoreBen Striegel-9/+9
2013-03-04Adding missing imports for tests, and gate off othersAlex Crichton-6/+3
2013-03-04Remove unused imports throughout src/Alex Crichton-75/+2
2013-03-03rustc: MIPS32 supportJyun-Yan You-1/+20
2013-03-03replace option::iter with a BaseIter implDaniel Micay-2/+2
2013-03-02libstd: Remove `fn@`, `fn~`, and `fn&` from libstd. rs=defunPatrick Walton-40/+43
2013-03-02librustc: Forbid chained imports and fix the logic for one-level renaming ↵Patrick Walton-27/+25
imports
2013-03-02auto merge of #5196 : thestinger/rust/ord, r=catamorphismbors-81/+86
This allows `TreeMap`/`TreeSet` to fully express their requirements and reduces the comparisons from ~1.5 per level to 1 which really helps for string keys. I also added `ReverseIter` to the prelude exports because I forgot when I originally added it.
2013-03-02treemap: reimplement using TotalOrdDaniel Micay-81/+86
2013-03-02auto merge of #5137 : yjh0502/rust/empty_struct, r=nikomatsakisbors-4/+4
The fix is straight-forward, but there are several changes while fixing the issue. 1) disallow `mut` keyword when making a new struct In code base, there are following code, ```rust struct Foo { mut a: int }; let a = Foo { mut a: 1 }; ``` This is because of structural record, which is deprecated corrently (see issue #3089) In structural record, `mut` keyword should be allowd to control mutability. But without structural record, we don't need to allow `mut` keyword while constructing struct. 2) disallow structural records in parser level This is related to 1). With structural records, there is an ambiguity between empty block and empty struct To solve the problem, I change parser to stop parsing structural records. I think this is not a problem, because structural records are not compiled already. Misc. issues There is an ambiguity between empty struct vs. empty match stmt. with following code, ```rust match x{} {} ``` Two interpretation is possible, which is listed blow ```rust match (x{}) {} // matching with newly-constructed empty struct (match x{}) {} // matching with empty enum(or struct) x // and then empty block ``` It seems that there is no such code in rust code base, but there is one test which uses empty match statement: https://github.com/mozilla/rust/blob/incoming/src/test/run-pass/issue-3037.rs All other cases could be distinguished with look-ahead, but this can't be. One possible solution is wrapping with parentheses when matching with an uninhabited type. ```rust enum what { } fn match_with_empty(x: what) -> ~str { match (x) { //use parentheses to remove the ambiguity } } ```
2013-03-01auto merge of #5185 : ben0x539/rust/net-tcp-docs, r=brsonbors-76/+76
This changes various type_names to TypeNames and fixes the example for `tcp::accept` that was still using the old `match` syntax and `{|args| ...}` closures. The `accept` example was fairly outdated. I was just going to stay away from all the IO things until the scheduler revamp lands, but `accept` is probably one of the obvious starting points for networking stuff for a learner, and I don't want to get in the way of anyone's enthusiasm. Doesn't touch non-comment lines, so I hope I will get away without learning about unit tests. It doesn't seem like the test system is set up to extract tests from doc comments right now.
2013-03-02Remove REC, change related tests/docsJihyun Yu-4/+4