about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2014-10-06library-level docs for collectionsAlexis Beingessner-3/+320
2014-10-04auto merge of #17738 : hoeppnertill/rust/master, r=alexcrichtonbors-9/+28
There is an issue with lev_distance, where ``` fn main() { println!("{}", "\x80".lev_distance("\x80")) } ``` prints `2`. This is due to using the byte length instead of the char length.
2014-10-04auto merge of #17760 : bkoropoff/rust/issue-17737, r=eddybbors-18/+60
This is a quick fix. In the long term, the `TyVisitor` interface should be expanded to better represent closure types. Closes issue #17737
2014-10-04Register new snapshotsBjörn Steinbrink-11/+13
2014-10-04auto merge of #17755 : alexcrichton/rust/unblock-snapshot, r=eddybbors-2/+1
Hopefully unblocks a snapshot
2014-10-04auto merge of #17754 : O-I/rust/update-guide, r=steveklabnikbors-17/+16
Hi, These are a few small edits to the Guide that I made while reading online. Really well done and approachable. I have a few questions below, but I don't know if this is the proper place to ask them, so feel free to ignore the below. 1. Trailing commas seem to be a convention in Rust and are used quite a bit throughout the Guide, but are never explicitly mentioned. Maybe adding a short mention about them when they first appear in the Structs section might be helpful to those who are unfamiliar with or don't use them in other languages. 2. In the Iterators section, there is a block of code like this: ```rust let mut range = range(0i, 10i); loop { match range.next() { Some(x) => { println!("{}", x); } // no comma needed? None => { break } } } ``` My inclination would be to put a comma where the comment is to separate the two arms to get this to compile, but it runs fine either way. Is there a convention on commas for scenarios like this where each arm is enclosed in `{}`? All the best, O-I
2014-10-03Add regression test for issue #17737Brian Koropoff-0/+24
2014-10-04auto merge of #17752 : SimonSapin/rust/patch-6, r=thestingerbors-1/+1
`v.len()` counts code units, not UTF-16 bytes. The lower bound is one UTF-8 byte per code unit, not per two code units. I believe this is correct, but it’s late. Someone please double check.
2014-10-03Fix type visitor glue for unboxed closuresBrian Koropoff-18/+36
This is a quick fix that prevents an ICE by mimicing the visitor glue for boxed closures and bare functions. Ideally, the `TyVisitor` interface will be improved in the future to allow representing more information about unboxed closures such as Fn/FnMut/FnOnce status, capture mode, and captured free variable types and offsets. Closes issue #17737
2014-10-04auto merge of #17731 : bkoropoff/rust/unboxed-by-ref, r=pcwaltonbors-38/+147
This began as an attempt to fix an ICE in borrowck (issue #17655), but the rabbit hole went pretty deep. I ended up plumbing support for capture-by-reference unboxed closures all the way into trans. Closes issue #17655.
2014-10-03test: Fix a test that fails when cross compilingAlex Crichton-2/+1
Hopefully unblocks a snapshot
2014-10-03auto merge of #17743 : steveklabnik/rust/receiver_fix, r=alexcrichtonbors-1/+1
2014-10-03Adds commaRahul Horé-1/+1
Oddly (to me), this code runs fine without the comma separating the `Some` and `None` arms of the `match` construct. It seems like Rust doesn't require you to separate arms with commas if all the expressions are enclosed in braces.
2014-10-03Fix preallocation amount in String::from_utf16Simon Sapin-1/+1
`v.len()` counts code units, not UTF-16 bytes. The lower bound is one UTF-8 byte per code unit, not per two code units.
2014-10-03Fixes wordingRahul Horé-2/+2
2014-10-03Removes extra .Rahul Horé-1/+1
2014-10-03Adds missing cdRahul Horé-1/+2
2014-10-03Test fixes from the rollupAlex Crichton-15/+15
2014-10-03Use similar syntax in all armsRahul Horé-7/+5
See issue #17672. This was started in commit ee1cbb9c71bfab8500dfabedb35ba63dd1e5b7ff, but there were a few more lines to update.
2014-10-03Fixes outputRahul Horé-1/+1
2014-10-03Adds trailing commaRahul Horé-2/+2
2014-10-03Fixes spacingRahul Horé-2/+2
2014-10-03Update signature of try_recv()Steve Klabnik-1/+1
2014-10-03Fix lev_distanceTill Hoeppner-9/+28
2014-10-03rollup merge of #17739 : eddyb/fix-process-testAlex Crichton-26/+53
2014-10-03rollup merge of #17730 : alexcrichton/snapshotAlex Crichton-1/+1
2014-10-03rollup merge of #17729 : alexcrichton/issue-17718-startAlex Crichton-5/+44
2014-10-03rollup merge of #17387 : sneves/masterAlex Crichton-1/+288
2014-10-03rollup merge of #17215 : P1start/lintsAlex Crichton-204/+316
2014-10-03Fix a race condition between remove_from_env and other io::process tests.Eduard Burtescu-26/+53
2014-10-03tests: remove old compile-fail test asserting the removal of `const`.Eduard Burtescu-11/+0
2014-10-03Add some more test coverage of by-ref unboxed closuresBrian Koropoff-0/+75
2014-10-03Move the lint for the stability lints to the method name onlyP1start-2/+28
Closes #17337.
2014-10-03Change rustc pretty-printing to print [T, ..n] instead of [T, .. n]P1start-10/+10
2014-10-03Report trait/impl sig inconsistency before method/body inconsistencyP1start-10/+11
Closes #15657.
2014-10-03Correct error message for invalid `ref`/`mut` bindingsP1start-3/+18
Closes #15914.
2014-10-03Improve the `non_snake_case` lint to give better suggestionsP1start-2/+9
2014-10-03Update the `unused` lint group to include more lintsP1start-5/+6
2014-10-03Set the `non_uppercase_statics` lint to warn by defaultP1start-172/+234
2014-10-03auto merge of #16995 : kmcallister/rust/plugin-tutorial, r=alexcrichtonbors-18/+471
@steveklabnik, are you interested in looking this over?
2014-10-02Rehabilitate an unboxed closure testBrian Koropoff-7/+2
This test works as a regression test for issue #17655. It also exercises mutation of by-ref upvars.
2014-10-02Correctly trans capture-by-ref unboxed closuresBrian Koropoff-3/+16
Store references to the freevars instead of copies when constructing the environment and insert an additional load when reading them from the environment.
2014-10-02Return correct types for capture-by-ref unboxed closure upvarsBrian Koropoff-1/+13
Treat upvars of capture-by-reference unboxed closures as references with appropriate regions and mutability.
2014-10-02Fix categorization of upvars of capture-by-reference unboxed closuresBrian Koropoff-11/+15
In particular, this causes mutation of an upvar to correctly mark it as mutable during adjustment. This makes borrowck correctly flag conflicting borrows, etc. We still seem to generate incorrect code in trans which copies the upvar by value into the closure. This remains to be fixed.
2014-10-02Fix missing entries in upvar borrows map for capture-by-ref unboxed closuresBrian Koropoff-16/+26
This prevents a later ICE in borrowck. Closes issue #17655
2014-10-02Merge branch 'travis' into rollupAlex Crichton-0/+1
Conflicts: .travis.yml
2014-10-02syntax: Enable parsing of `const` globalsAlex Crichton-3/+53
This rewrites them to the current `ItemStatic` production of the compiler, but I want to get this into a snapshot. It will be illegal to use a `static` in a pattern of a `match` statement, so all those current uses will need to be rewritten to `const` once it's implemented. This requires that the stage0 snapshot is able to parse `const`. cc #17718
2014-10-02test: Don't depend on /bin/bashAlex Crichton-1/+1
Our FreeBSD bots apparently don't have bash installed, and it's ok to run with sh anyway! Unblocks a snapshot
2014-10-02Test fixes from the rollupAlex Crichton-59/+60
2014-10-02rollup merge of #17666 : eddyb/take-garbage-outAlex Crichton-5088/+435
Conflicts: src/libcollections/lib.rs src/libcore/lib.rs src/librustdoc/lib.rs src/librustrt/lib.rs src/libserialize/lib.rs src/libstd/lib.rs src/test/run-pass/issue-8898.rs