about summary refs log tree commit diff
path: root/src/libstd/rt
AgeCommit message (Collapse)AuthorLines
2014-11-20Fallout from libgreen and libnative removalAaron Turon-6/+6
2014-11-20Remove libnativeAaron Turon-0/+76
With runtime removal complete, there's nothing left of libnative. This commit removes it. Fixes #18687 [breaking-change]
2014-11-20Remove Runtime traitAaron Turon-0/+2
This commit removes most of the remaining runtime infrastructure related to the green/native split. In particular, it removes the `Runtime` trait and instead inlines the native implementation. Closes #17325 [breaking-change]
2014-11-18auto merge of #18645 : nick29581/rust/coercions-1, r=alexcrichtonbors-1/+1
r? (I realise this needs a rebase, but I will probably have to chop it up in order to land and I'd like to get r+ first so I can do that quicker)
2014-11-18Windows and OS X falloutNick Cameron-1/+1
2014-11-18implement Writer for Vec<u8>Daniel Micay-4/+2
The trait has an obvious, sensible implementation directly on vectors so the MemWriter wrapper is unnecessary. This will halt the trend towards providing all of the vector methods on MemWriter along with eliminating the noise caused by conversions between the two types. It also provides the useful default Writer methods on Vec<u8>. After the type is removed and code has been migrated, it would make sense to add a new implementation of MemWriter with seeking support. The simple use cases can be covered with vectors alone, and ones with the need for seeks can use a new MemWriter implementation.
2014-11-17Switch to purely namespaced enumsSteven Fackler-7/+10
This breaks code that referred to variant names in the same namespace as their enum. Reexport the variants in the old location or alter code to refer to the new locations: ``` pub enum Foo { A, B } fn main() { let a = A; } ``` => ``` pub use self::Foo::{A, B}; pub enum Foo { A, B } fn main() { let a = A; } ``` or ``` pub enum Foo { A, B } fn main() { let a = Foo::A; } ``` [breaking-change]
2014-11-17Fix fallout from coercion removalNick Cameron-1/+1
2014-11-16Move FromStr to core::strBrendan Zabarauskas-5/+2
2014-11-06Prelude: rename and consolidate extension traitsAaron Turon-5/+5
This commit renames a number of extension traits for slices and string slices, now that they have been refactored for DST. In many cases, multiple extension traits could now be consolidated. Further consolidation will be possible with generalized where clauses. The renamings are consistent with the [new `-Prelude` suffix](https://github.com/rust-lang/rfcs/pull/344). There are probably a few more candidates for being renamed this way, but that is left for API stabilization of the relevant modules. Because this renames traits, it is a: [breaking-change] However, I do not expect any code that currently uses the standard library to actually break. Closes #17917
2014-11-01collections: Remove all collections traitsAlex Crichton-3/+0
As part of the collections reform RFC, this commit removes all collections traits in favor of inherent methods on collections themselves. All methods should continue to be available on all collections. This is a breaking change with all of the collections traits being removed and no longer being in the prelude. In order to update old code you should move the trait implementations to inherent implementations directly on the type itself. Note that some traits had default methods which will also need to be implemented to maintain backwards compatibility. [breaking-change] cc #18424
2014-10-30rollup merge of #18398 : aturon/lint-conventions-2Alex Crichton-1/+1
Conflicts: src/libcollections/slice.rs src/libcore/failure.rs src/libsyntax/parse/token.rs src/test/debuginfo/basic-types-mut-globals.rs src/test/debuginfo/simple-struct.rs src/test/debuginfo/trait-pointers.rs
2014-10-29Rename fail! to panic!Steve Klabnik-5/+5
https://github.com/rust-lang/rfcs/pull/221 The current terminology of "task failure" often causes problems when writing or speaking about code. You often want to talk about the possibility of an operation that returns a Result "failing", but cannot because of the ambiguity with task failure. Instead, you have to speak of "the failing case" or "when the operation does not succeed" or other circumlocutions. Likewise, we use a "Failure" header in rustdoc to describe when operations may fail the task, but it would often be helpful to separate out a section describing the "Err-producing" case. We have been steadily moving away from task failure and toward Result as an error-handling mechanism, so we should optimize our terminology accordingly: Result-producing functions should be easy to describe. To update your code, rename any call to `fail!` to `panic!` instead. Assuming you have not created your own macro named `panic!`, this will work on UNIX based systems: grep -lZR 'fail!' . | xargs -0 -l sed -i -e 's/fail!/panic!/g' You can of course also do this by hand. [breaking-change]
2014-10-28Update code with new lint namesAaron Turon-1/+1
2014-10-25get rid of libc_heap::{malloc_raw, realloc_raw}Daniel Micay-1/+1
The C standard library functions should be used directly. The quirky NULL / zero-size allocation workaround is no longer necessary and was adding an extra branch to the allocator code path in a build without jemalloc. This is a small step towards liballoc being compatible with handling OOM errors instead of aborting (#18292). [breaking-change]
2014-10-16don't refer to the nonexistant gcSteve Klabnik-7/+5
2014-10-10Register new snapshotsAlex Crichton-14/+12
Also convert a number of `static mut` to just a plain old `static` and remove some unsafe blocks.
2014-10-09Test fixes and rebase conflictsAlex Crichton-8/+8
2014-10-07Use slice syntax instead of slice_to, etc.Nick Cameron-1/+1
2014-10-02Revert "Review and rebasing changes"Aaron Turon-1/+1
This reverts commit 6e0611a48707a1f5d90aee32a02b2b15957ef25b.
2014-10-02Review and rebasing changesNick Cameron-1/+1
2014-09-30Fix libstdSteven Fackler-14/+14
2014-09-23Fixed: iOS build was broken because of deprecated APIsValerii Hiora-2/+3
2014-09-22std::rt::backtrace: Fix symbol names on Windowsklutzy-3/+5
Fixes #17372
2014-09-18std::rt::backtrace: Fix backtrace on Win64klutzy-0/+4
`struct CONTEXT` and its substructs require 16-byte alignment.
2014-09-16Fallout from renamingAaron Turon-2/+2
2014-09-03Fix spelling errors and capitalization.Joseph Crail-3/+3
2014-08-30auto merge of #16859 : alexcrichton/rust/snapshots, r=huonwbors-24/+0
2014-08-29Register new snapshotsAlex Crichton-24/+0
2014-08-30Unify non-snake-case lints and non-uppercase statics lintsP1start-3/+3
This unifies the `non_snake_case_functions` and `uppercase_variables` lints into one lint, `non_snake_case`. It also now checks for non-snake-case modules. This also extends the non-camel-case types lint to check type parameters, and merges the `non_uppercase_pattern_statics` lint into the `non_uppercase_statics` lint. Because the `uppercase_variables` lint is now part of the `non_snake_case` lint, all non-snake-case variables that start with lowercase characters (such as `fooBar`) will now trigger the `non_snake_case` lint. New code should be updated to use the new `non_snake_case` lint instead of the previous `non_snake_case_functions` and `uppercase_variables` lints. All use of the `non_uppercase_pattern_statics` should be replaced with the `non_uppercase_statics` lint. Any code that previously contained non-snake-case module or variable names should be updated to use snake case names or disable the `non_snake_case` lint. Any code with non-camel-case type parameters should be changed to use camel case or disable the `non_camel_case_types` lint. [breaking-change]
2014-08-27Implement generalized object and type parameter bounds (Fixes #16462)Niko Matsakis-1/+1
2014-08-22auto merge of #16647 : vhbit/rust/ios-build-fixes, r=alexcrichtonbors-2/+2
2014-08-21iOS compilation fixValerii Hiora-2/+2
2014-08-20Stage #[repr(packed)] in std::rtCorey Richardson-1/+32
2014-08-20librustc: handle repr on structs, require it for ffi, unify with packedCorey Richardson-1/+1
As of RFC 18, struct layout is undefined. Opting into a C-compatible struct layout is now down with #[repr(C)]. For consistency, specifying a packed layout is now also down with #[repr(packed)]. Both can be specified. To fix errors caused by this, just add #[repr(C)] to the structs, and change #[packed] to #[repr(packed)] Closes #14309 [breaking-change]
2014-08-13std: Rename various slice traits for consistencyBrian Anderson-3/+3
ImmutableVector -> ImmutableSlice ImmutableEqVector -> ImmutableEqSlice ImmutableOrdVector -> ImmutableOrdSlice MutableVector -> MutableSlice MutableVectorAllocating -> MutableSliceAllocating MutableCloneableVector -> MutableCloneableSlice MutableOrdVector -> MutableOrdSlice These are all in the prelude so most code will not break. [breaking-change]
2014-08-06auto merge of #16258 : aturon/rust/stabilize-atomics, r=alexcrichtonbors-8/+8
This commit stabilizes the `std::sync::atomics` module, renaming it to `std::sync::atomic` to match library precedent elsewhere, and tightening up behavior around incorrect memory ordering annotations. The vast majority of the module is now `stable`. However, the `AtomicOption` type has been deprecated, since it is essentially unused and is not truly a primitive atomic type. It will eventually be replaced by a higher-level abstraction like MVars. Due to deprecations, this is a: [breaking-change]
2014-08-04stabilize atomics (now atomic)Aaron Turon-8/+8
This commit stabilizes the `std::sync::atomics` module, renaming it to `std::sync::atomic` to match library precedent elsewhere, and tightening up behavior around incorrect memory ordering annotations. The vast majority of the module is now `stable`. However, the `AtomicOption` type has been deprecated, since it is essentially unused and is not truly a primitive atomic type. It will eventually be replaced by a higher-level abstraction like MVars. Due to deprecations, this is a: [breaking-change]
2014-08-04rustc: Link entire archives of native librariesAlex Crichton-0/+3
As discovered in #15460, a particular #[link(kind = "static", ...)] line is not actually guaranteed to link the library at all. The reason for this is that if the external library doesn't have any referenced symbols in the object generated by rustc, the entire library is dropped by the linker. For dynamic native libraries, this is solved by passing -lfoo for all downstream compilations unconditionally. For static libraries in rlibs this is solved because the entire archive is bundled in the rlib. The only situation in which this was a problem was when a static native library was linked to a rust dynamic library. This commit brings the behavior of dylibs in line with rlibs by passing the --whole-archive flag to the linker when linking native libraries. On OSX, this uses the -force_load flag. This flag ensures that the entire archive is considered candidate for being linked into the final dynamic library. This is a breaking change because if any static library is included twice in the same compilation unit then the linker will start emitting errors about duplicate definitions now. The fix for this would involve only statically linking to a library once. Closes #15460 [breaking-change]
2014-07-31Fix trailing whitespaceMichael Neumann-2/+2
2014-07-29Port Rust to DragonFlyBSDMichael Neumann-1/+5
Not included are two required patches: * LLVM: segmented stack support for DragonFly [1] * jemalloc: simple configure patches [1]: http://reviews.llvm.org/D4705
2014-07-25Revert "Use fewer instructions for `fail!`"Brian Anderson-2/+1
This reverts commit c61f9763e2e03afbe62445877ceb3ed15e22e123. Conflicts: src/librustrt/unwind.rs src/libstd/macros.rs
2014-07-21Use fewer instructions for `fail!`Brian Anderson-1/+2
Adds a special-case fail function, rustrt::unwind::begin_unwind_no_time_to_explain, that encapsulates the printing of the words "explicit failure". The before/after optimized assembly: ``` leaq "str\"str\"(1369)"(%rip), %rax movq %rax, 8(%rsp) movq $19, 16(%rsp) leaq 8(%rsp), %rdi movl $11, %esi callq _ZN6unwind31begin_unwind_no_time_to_explain20hd1c720cdde6a116480dE@PLT ``` ``` leaq "str\"str\"(1412)"(%rip), %rax movq %rax, 24(%rsp) movq $16, 32(%rsp) leaq "str\"str\"(1413)"(%rip), %rax movq %rax, 8(%rsp) movq $19, 16(%rsp) leaq 24(%rsp), %rdi leaq 8(%rsp), %rsi movl $11, %edx callq _ZN6unwind12begin_unwind21h15836560661922107792E ``` Before/after filesizes: rwxrwxr-x 1 brian brian 21479503 Jul 20 22:09 stage2-old/lib/librustc-4e7c5e5c.so rwxrwxr-x 1 brian brian 21475415 Jul 20 22:30 x86_64-unknown-linux-gnu/stage2/lib/librustc-4e7c5e5c.so
2014-07-15auto merge of #15619 : kwantam/rust/master, r=huonwbors-1/+1
- `width()` computes the displayed width of a string, ignoring the width of control characters. - arguably we might do *something* else for control characters, but the question is, what? - users who want to do something else can iterate over chars() - `graphemes()` returns a `Graphemes` struct, which implements an iterator over the grapheme clusters of a &str. - fully compliant with [UAX#29](http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries) - passes all [Unicode-supplied tests](http://www.unicode.org/reports/tr41/tr41-15.html#Tests29) - added code to generate additionial categories in `unicode.py` - `Cn` aka `Not_Assigned` - categories necessary for grapheme cluster breaking - tidied up the exports from libunicode - all exports are exposed through a module rather than directly at crate root. - std::prelude imports UnicodeChar and UnicodeStrSlice from std::char and std::str rather than directly from libunicode closes #7043
2014-07-15Fix errorsAdolfo OchagavĂ­a-1/+0
2014-07-15Deprecate `str::from_utf8_owned`Adolfo OchagavĂ­a-1/+1
Use `String::from_utf8` instead [breaking-change]
2014-07-14add Graphemes iterator; tidy unicode exportskwantam-1/+1
- Graphemes and GraphemeIndices structs implement iterators over grapheme clusters analogous to the Chars and CharOffsets for chars in a string. Iterator and DoubleEndedIterator are available for both. - tidied up the exports for libunicode. crate root exports are now moved into more appropriate module locations: - UnicodeStrSlice, Words, Graphemes, GraphemeIndices are in str module - UnicodeChar exported from char instead of crate root - canonical_combining_class is exported from str rather than crate root Since libunicode's exports have changed, programs that previously relied on the old export locations will need to change their `use` statements to reflect the new ones. See above for more information on where the new exports live. closes #7043 [breaking-change]
2014-07-07Add libunicode; move unicode functions from corekwantam-1/+1
- created new crate, libunicode, below libstd - split Char trait into Char (libcore) and UnicodeChar (libunicode) - Unicode-aware functions now live in libunicode - is_alphabetic, is_XID_start, is_XID_continue, is_lowercase, is_uppercase, is_whitespace, is_alphanumeric, is_control, is_digit, to_uppercase, to_lowercase - added width method in UnicodeChar trait - determines printed width of character in columns, or None if it is a non-NULL control character - takes a boolean argument indicating whether the present context is CJK or not (characters with 'A'mbiguous widths are double-wide in CJK contexts, single-wide otherwise) - split StrSlice into StrSlice (libcore) and UnicodeStrSlice (libunicode) - functionality formerly in StrSlice that relied upon Unicode functionality from Char is now in UnicodeStrSlice - words, is_whitespace, is_alphanumeric, trim, trim_left, trim_right - also moved Words type alias into libunicode because words method is in UnicodeStrSlice - unified Unicode tables from libcollections, libcore, and libregex into libunicode - updated unicode.py in src/etc to generate aforementioned tables - generated new tables based on latest Unicode data - added UnicodeChar and UnicodeStrSlice traits to prelude - libunicode is now the collection point for the std::char module, combining the libunicode functionality with the Char functionality from libcore - thus, moved doc comment for char from core::char to unicode::char - libcollections remains the collection point for std::str The Unicode-aware functions that previously lived in the Char and StrSlice traits are no longer available to programs that only use libcore. To regain use of these methods, include the libunicode crate and use the UnicodeChar and/or UnicodeStrSlice traits: extern crate unicode; use unicode::UnicodeChar; use unicode::UnicodeStrSlice; use unicode::Words; // if you want to use the words() method NOTE: this does *not* impact programs that use libstd, since UnicodeChar and UnicodeStrSlice have been added to the prelude. closes #15224 [breaking-change]
2014-07-04auto merge of #15404 : vhbit/rust/ios-ptr-fixes, r=pcwaltonbors-2/+2
2014-07-04Fixed iOS build after *T removalValerii Hiora-2/+2