about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2013-10-06auto merge of #9703 : alexcrichton/rust/compiler-features, r=cmrbors-0/+2
This implements the necessary logic for gating particular features off by default in the compiler. There are a number of issues which have been wanting this form of mechanism, and this initially gates features which we have open issues for. Additionally, this should unblock #9255
2013-10-06auto merge of #9593 : fhahn/rust/logging-unsafe-removal, r=alexcrichtonbors-202/+305
This pull request changes to memory layout of the `CrateMap` struct to use static slices instead of raw pointers. Most of the discussion took place [here](https://github.com/fhahn/rust/commit/63b5975efa10af7df3df0a50d8d7f9c8d5bcf9e9#L1R92) . The memory layout of CrateMap changed, without bumping the version number in the struct. Another, more backward compatible, solution would be to keep the old code and increase the version number in the new struct. On the other hand, the `annihilate_fn` pointer was removed without bumping the version number recently. At the moment, the stage0 compiler does not use the new memory layout, which would lead the segfaults during stage0 compilation, so I've added a dummy `iter_crate_map` function for stage0, which does nothing. Again, this could be avoided if we'd bump the version number in the struct and keep the old code. I'd like to use a normal `for` loop [here](https://github.com/fhahn/rust/compare/logging-unsafe-removal?expand=1#L1R109), for child in children.iter() { do_iter_crate_map(child, |x| f(x), visited); } but for some reason this only yields `error: unresolved enum variant, struct or const 'Some'` and I have no idea why.
2013-10-06get_crate_map returns an OptionFlorian Hahn-23/+42
2013-10-06Fix a typo in std::ops documentationHuon Wilson-1/+1
2013-10-05Implement feature-gating for the compilerAlex Crichton-0/+2
A few features are now hidden behind various #[feature(...)] directives. These include struct-like enum variants, glob imports, and macro_rules! invocations. Closes #9304 Closes #9305 Closes #9306 Closes #9331
2013-10-05auto merge of #9713 : sfackler/rust/dynamic_lib, r=alexcrichtonbors-10/+19
The root issue is that dlerror isn't reentrant or even thread safe. The solution implemented here is to make a yielding spin lock over an AtomicFlag. This is pretty hacky, but the best we can do at this point. As far as I can tell, it isn't possible to create a global mutex without having to initialize it in a single threaded context. The Windows code isn't affected since errno is thread-local on Windows and it's running in an atomically block to ensure there isn't a green thread context switch. Closes #8156
2013-10-05auto merge of #9250 : erickt/rust/num, r=ericktbors-100/+897
This PR solves one of the pain points with c-style enums. Simplifies writing a fn to convert from an int/uint to an enum. It does this through a `#[deriving(FromPrimitive)]` syntax extension. Before this is committed though, we need to discuss if `ToPrimitive`/`FromPrimitive` has the right design (cc #4819). I've changed all the `.to_int()` and `from_int()` style functions to return `Option<int>` so we can handle partial functions. For this PR though only enums and `extra::num::bigint::*` take advantage of returning None for unrepresentable values. In the long run it'd be better if `i64.to_i8()` returned `None` if the value was too large, but I'll save this for a future PR. Closes #3868.
2013-10-05std: add Primitive.is_signedErick Tryzelaar-0/+13
2013-10-05std: ToPrimitive's default impls should use `.to_*()`Erick Tryzelaar-22/+11
This allows the default methods to be properly range checked.
2013-10-05std: fix some warningsErick Tryzelaar-5/+0
2013-10-05std: check bounds for ints/uints in {To,From}PrimitiveErick Tryzelaar-60/+598
2013-10-05Implemented `IntoSendStr` on `SendStr` to allow naming aMarvin Löbel-0/+20
task with a `SendStr` directly
2013-10-05Make a task name use a `SendStr`, allowing for eitherMarvin Löbel-6/+22
static or owned strings
2013-10-05Fix thread safety issues in dynamic_libSteven Fackler-10/+19
The root issue is that dlerror isn't reentrant or even thread safe. The Windows code isn't affected since errno is thread-local on Windows and it's running in an atomically block to ensure there isn't a green thread context switch. Closes #8156
2013-10-05Add code for older crate map versions, bumped crate map version numberFlorian Hahn-38/+171
2013-10-05Use &'self str instead of raw char pointer in ModEntryFlorian Hahn-127/+99
2013-10-05Use slice representation for module entries in CrateMapFlorian Hahn-87/+47
Relaxe lifetime of CrateMap as well.
2013-10-05Use slice representation for child crate mapsFlorian Hahn-116/+135
2013-10-04auto merge of #9727 : Valloric/rust/doc-fixes, r=catamorphismbors-1/+1
2013-10-04Fixed another minor typo in std::str docsStrahinja Val Markovic-1/+1
2013-10-04Fix minor typo in std::str module docsStrahinja Val Markovic-1/+1
2013-10-04auto merge of #9718 : alexcrichton/rust/snapshots, r=sanxiynbors-12/+0
Now that #9662 is merged, we should be much more easily bootstrappable on windows now.
2013-10-04Register new snapshotsAlex Crichton-12/+0
Now that #9662 is merged, we should be much more easily bootstrappable on windows now.
2013-10-04fix some examples in std::rand::Rngflo-l-6/+14
2013-10-03auto merge of #9522 : steveklabnik/rust/doc_std_opts, r=alexcrichtonbors-2/+382
Added an overview with a 'real' example, as well as toy implementations of all of the traits. Closes #9356.
2013-10-03Update std::ops docs as per feedbackSteve Klabnik-140/+112
from @chris-morgan
2013-10-03Merge pull request #9697 from sfackler/issue_9155Daniel Micay-13/+9
Close out #9155
2013-10-03auto merge of #9691 : alexcrichton/rust/rustdoc, r=cmrbors-1/+2
This slurps in the commits from #9684 as well as closing #9539.
2013-10-03Close out #9155Steven Fackler-13/+9
Add a test to make sure it works and switch a private struct over to a newtype. Closes #9155
2013-10-02auto merge of #9693 : sfackler/rust/newtype-removal, r=alexcrichtonbors-30/+48
UnboundedPipeStream is still a newtype since process::set_stdio needs to look into its internals. Closes #9667
2013-10-02Stop using newtype wrappers in std::rt::ioSteven Fackler-30/+48
UnboundedPipeStream is still a newtype since process::set_stdio needs to look into its internals. Closes #9667
2013-10-02auto merge of #9681 : skade/rust/str-from-str, r=huonwbors-1/+21
This fixes an issue for APIs that return FromStr. Before this change, they would have to offer a seperate function for returning the source string.
2013-10-02rustdoc: Generate hyperlinks between cratesAlex Crichton-1/+2
The general idea of hyperlinking between crates is that it should require as little configuration as possible, if any at all. In this vein, there are two separate ways to generate hyperlinks between crates: 1. When you're generating documentation for a crate 'foo' into folder 'doc', then if foo's external crate dependencies already have documented in the folder 'doc', then hyperlinks will be generated. This will work because all documentation is in the same folder, allowing links to work seamlessly both on the web and on the local filesystem browser. The rationale for this use case is a package with multiple libraries/crates that all want to link to one another, and you don't want to have to deal with going to the web. In theory this could be extended to have a RUST_PATH-style searching situtation, but I'm not sure that it would work seamlessly on the web as it does on the local filesystem, so I'm not attempting to explore this case in this pull request. I believe to fully realize this potential rustdoc would have to be acting as a server instead of a static site generator. 2. One of foo's external dependencies has a #[doc(html_root_url = "...")] attribute. This means that all hyperlinks to the dependency will be rooted at this url. This use case encompasses all packages using libstd/libextra. These two crates now have this attribute encoded (currently at the /doc/master url) and will be read by anything which has a dependency on libstd/libextra. This should also work for arbitrary crates in the wild that have online documentation. I don't like how the version is hard-wired into the url, but I think that this may be a case-by-case thing which doesn't end up being too bad in the long run. Closes #9539
2013-10-02auto merge of #9675 : sfackler/rust/lint, r=alexcrichtonbors-0/+8
Closes #9671
2013-10-02Check enums in missing_doc lintSteven Fackler-0/+8
Closes #9671
2013-10-02std: Swap {To,From}Primitive to use the 64bit as the unimplemented versionErick Tryzelaar-32/+36
One downside with this current implementation is that since BigInt's default is now 64 bit, we can convert larger BigInt's to a primitive, however the current implementation on 32 bit architectures does not take advantage of this fact.
2013-10-02std: Replace num::IntConvertible with {To,From}PrimitiveErick Tryzelaar-99/+357
2013-10-02Add an implementation of FromStr for ~str and @strFlorian Gilcher-1/+21
This fixes an issue for APIs that return FromStr. Before this change, they would have to offer a seperate function for returning the source string.
2013-10-02auto merge of #9665 : alexcrichton/rust/snapshot, r=brsonbors-12/+12
Uses the new snapshots to kill the old `loop` and introduce the new `continue`.
2013-10-02auto merge of #9638 : ↵bors-0/+2
pnkfelix/rust/fsk-issue7526-attempt-to-catch-nonuc-statics-in-match-patterns, r=alexcrichton r? anyone Address scariest part of #7526 by adding a new more specific lint (that is set to warn by default, rather than allow).
2013-10-01auto merge of #9578 : alexcrichton/rust/un-ignore-libuv-process-tests, r=brsonbors-142/+2
Closes #9341
2013-10-01Move the rt::io::process tests to run-passAlex Crichton-142/+2
Closes #9341
2013-10-01Migrate users of 'loop' to 'continue'Alex Crichton-12/+12
Closes #9467
2013-10-01remove the `float` typeDaniel Micay-1502/+27
It is simply defined as `f64` across every platform right now. A use case hasn't been presented for a `float` type defined as the highest precision floating point type implemented in hardware on the platform. Performance-wise, using the smallest precision correct for the use case greatly saves on cache space and allows for fitting more numbers into SSE/AVX registers. If there was a use case, this could be implemented as simply a type alias or a struct thanks to `#[cfg(...)]`. Closes #6592 The mailing list thread, for reference: https://mail.mozilla.org/pipermail/rust-dev/2013-July/004632.html
2013-10-01auto merge of #9644 : alexcrichton/rust/clarify, r=huonwbors-19/+42
It was a little ambiguous before how explicitl positional parameters and implicit positional parameters intermingled, and this clarifies how the two intermingle. This also updates a little bit of documentation/code examples elsewhere as well.
2013-10-01auto merge of #9576 : FlaPer87/rust/issue/9125, r=alexcrichtonbors-19/+29
Fixes #9125
2013-10-01Merge fall out of removing fmt!Alex Crichton-4/+4
2013-10-01Update std::task::mod docstringFlavio Percoco-19/+29
2013-09-30std: Remove usage of fmt!Alex Crichton-509/+497
2013-09-30Clarify format! implicit positional referencesAlex Crichton-19/+42
It was a little ambiguous before how explicitl positional parameters and implicit positional parameters intermingled, and this clarifies how the two intermingle. This also updates a little bit of documentation/code examples elsewhere as well.