about summary refs log tree commit diff
path: root/src/libgreen
AgeCommit message (Collapse)AuthorLines
2014-11-20Remove libgreenAaron Turon-3862/+0
With runtime removal complete, there is no longer any reason to provide libgreen. [breaking-change]
2014-11-20Rename remaining Failures to PanicSubhash Bhushan-1/+1
2014-11-17Switch to purely namespaced enumsSteven Fackler-2/+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-2/+2
2014-11-08Runtime removal: fully remove rtioAaron Turon-14/+3
This patch cleans up the remnants of the runtime IO interface. Because this eliminates APIs in `libnative` and `librustrt`, it is a: [breaking-change] This functionality is likely to be available publicly, in some form, from `std` in the future.
2014-11-06Fallout from collection conventionsAlexis Beingessner-2/+2
2014-10-29Rename fail! to panic!Steve Klabnik-28/+28
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-24auto merge of #16388 : Zoxc/rust/stmesg, r=alexcrichtonbors-0/+13
This installs signal handlers to print out stack overflow messages on Linux. It also ensures the main thread has a guard page. This will catch stack overflows in external code. It's done in preparation of switching to stack probes (#16012). I've done some simple tests with overflowing the main thread, native threads and green threads (with and without UV) on x86-64. This might work on ARM, MIPS and x86-32. I've been unable to run the test suite on this because of #16305.
2014-10-24Print stack overflow messages for Windows, Linux and OS XJohn Kåre Alsaker-0/+13
Fixes #17562
2014-10-24Add a lint for not using field pattern shorthandsP1start-2/+2
Closes #17792.
2014-10-19Remove a large amount of deprecated functionalityAlex Crichton-20/+20
Spring cleaning is here! In the Fall! This commit removes quite a large amount of deprecated functionality from the standard libraries. I tried to ensure that only old deprecated functionality was removed. This is removing lots and lots of deprecated features, so this is a breaking change. Please consult the deprecation messages of the deleted code to see how to migrate code forward if it still needs migration. [breaking-change]
2014-10-13Clean up rustc warnings.NODA, Kai-1/+0
compiletest: compact "linux" "macos" etc.as "unix". liballoc: remove a superfluous "use". libcollections: remove invocations of deprecated methods in favor of their suggested replacements and use "_" for a loop counter. libcoretest: remove invocations of deprecated methods; also add "allow(deprecated)" for testing a deprecated method itself. libglob: use "cfg_attr". libgraphviz: add a test for one of data constructors. libgreen: remove a superfluous "use". libnum: "allow(type_overflow)" for type cast into u8 in a test code. librustc: names of static variables should be in upper case. libserialize: v[i] instead of get(). libstd/ascii: to_lowercase() instead of to_lower(). libstd/bitflags: modify AnotherSetOfFlags to use i8 as its backend. It will serve better for testing various aspects of bitflags!. libstd/collections: "allow(deprecated)" for testing a deprecated method itself. libstd/io: remove invocations of deprecated methods and superfluous "use". Also add #[test] where it was missing. libstd/num: introduce a helper function to effectively remove invocations of a deprecated method. libstd/path and rand: remove invocations of deprecated methods and superfluous "use". libstd/task and libsync/comm: "allow(deprecated)" for testing a deprecated method itself. libsync/deque: remove superfluous "unsafe". libsync/mutex and once: names of static variables should be in upper case. libterm: introduce a helper function to effectively remove invocations of a deprecated method. We still see a few warnings about using obsoleted native::task::spawn() in the test modules for libsync. I'm not sure how I should replace them with std::task::TaksBuilder and native::task::NativeTaskBuilder (dependency to libstd?) Signed-off-by: NODA, Kai <nodakai@gmail.com>
2014-10-10Register new snapshotsAlex Crichton-6/+6
Also convert a number of `static mut` to just a plain old `static` and remove some unsafe blocks.
2014-10-09Use the same html_root_url for all docsBrian Anderson-1/+1
2014-10-09Revert "Update html_root_url for 0.12.0 release"Brian Anderson-1/+1
This reverts commit 2288f332301b9e22db2890df256322650a7f3445.
2014-10-07Update html_root_url for 0.12.0 releaseBrian Anderson-1/+1
2014-10-02Test fixes from the rollupAlex Crichton-2/+2
2014-10-01Remove all use of librustuvAaron Turon-86/+1
2014-10-01auto merge of #17630 : sfackler/rust/cfg-warnings, r=brsonbors-13/+9
Closes #17490
2014-09-30librustc: Fix up mutability in method autoderefs if incorrect, andPatrick Walton-1/+1
prefer `Deref` over `DerefMut` in all other circumstances. Closes #12825.
2014-09-30Fix libgreenSteven Fackler-13/+9
2014-09-22librustc: Forbid private types in public APIs.Patrick Walton-2/+2
This breaks code like: struct Foo { ... } pub fn make_foo() -> Foo { ... } Change this code to: pub struct Foo { // note `pub` ... } pub fn make_foo() -> Foo { ... } The `visible_private_types` lint has been removed, since it is now an error to attempt to expose a private type in a public API. In its place a `#[feature(visible_private_types)]` gate has been added. Closes #16463. RFC #48. [breaking-change]
2014-09-16Fallout from renamingAaron Turon-7/+7
2014-09-09Remove some test warnings.Jonas Hietala-0/+1
2014-08-28auto merge of #16664 : aturon/rust/stabilize-option-result, r=alexcrichtonbors-19/+19
Per API meeting https://github.com/rust-lang/meeting-minutes/blob/master/Meeting-API-review-2014-08-13.md # Changes to `core::option` Most of the module is marked as stable or unstable; most of the unstable items are awaiting resolution of conventions issues. However, a few methods have been deprecated, either due to lack of use or redundancy: * `take_unwrap`, `get_ref` and `get_mut_ref` (redundant, and we prefer for this functionality to go through an explicit .unwrap) * `filtered` and `while` * `mutate` and `mutate_or_set` * `collect`: this functionality is being moved to a new `FromIterator` impl. # Changes to `core::result` Most of the module is marked as stable or unstable; most of the unstable items are awaiting resolution of conventions issues. * `collect`: this functionality is being moved to a new `FromIterator` impl. * `fold_` is deprecated due to lack of use * Several methods found in `core::option` are added here, including `iter`, `as_slice`, and variants. Due to deprecations, this is a: [breaking-change]
2014-08-28Fallout from stabilizing core::optionAaron Turon-19/+19
2014-08-27Implement generalized object and type parameter bounds (Fixes #16462)Niko Matsakis-2/+4
2014-08-26DST coercions and DST structsNick Cameron-1/+1
[breaking-change] 1. The internal layout for traits has changed from (vtable, data) to (data, vtable). If you were relying on this in unsafe transmutes, you might get some very weird and apparently unrelated errors. You should not be doing this! Prefer not to do this at all, but if you must, you should use raw::TraitObject rather than hardcoding rustc's internal representation into your code. 2. The minimal type of reference-to-vec-literals (e.g., `&[1, 2, 3]`) is now a fixed size vec (e.g., `&[int, ..3]`) where it used to be an unsized vec (e.g., `&[int]`). If you want the unszied type, you must explicitly give the type (e.g., `let x: &[_] = &[1, 2, 3]`). Note in particular where multiple blocks must have the same type (e.g., if and else clauses, vec elements), the compiler will not coerce to the unsized type without a hint. E.g., `[&[1], &[1, 2]]` used to be a valid expression of type '[&[int]]'. It no longer type checks since the first element now has type `&[int, ..1]` and the second has type &[int, ..2]` which are incompatible. 3. The type of blocks (including functions) must be coercible to the expected type (used to be a subtype). Mostly this makes things more flexible and not less (in particular, in the case of coercing function bodies to the return type). However, in some rare cases, this is less flexible. TBH, I'm not exactly sure of the exact effects. I think the change causes us to resolve inferred type variables slightly earlier which might make us slightly more restrictive. Possibly it only affects blocks with unreachable code. E.g., `if ... { fail!(); "Hello" }` used to type check, it no longer does. The fix is to add a semicolon after the string.
2014-08-20Stage #[repr(packed)] in std::rtCorey Richardson-7/+8
2014-08-20libgreen: use FFI-safe typesCorey Richardson-30/+33
2014-08-18libsyntax: Remove the `use foo = bar` syntax from the language in favorPatrick Walton-2/+2
of `use bar as foo`. Change all uses of `use foo = bar` to `use bar as foo`. Implements RFC #47. Closes #16461. [breaking-change]
2014-08-13Fix various fallout from timer changesBrian Anderson-1/+2
2014-08-08auto merge of #16285 : alexcrichton/rust/rename-share, r=huonwbors-5/+5
This leaves the `Share` trait at `std::kinds` via a `#[deprecated]` `pub use` statement, but the `NoShare` struct is no longer part of `std::kinds::marker` due to #12660 (the build cannot bootstrap otherwise). All code referencing the `Share` trait should now reference the `Sync` trait, and all code referencing the `NoShare` type should now reference the `NoSync` type. The functionality and meaning of this trait have not changed, only the naming. Closes #16281 [breaking-change]
2014-08-07Rename `Share` to `Sync`Alex Crichton-5/+5
This leaves the `Share` trait at `std::kinds` via a `#[deprecated]` `pub use` statement, but the `NoShare` struct is no longer part of `std::kinds::marker` due to #12660 (the build cannot bootstrap otherwise). All code referencing the `Share` trait should now reference the `Sync` trait, and all code referencing the `NoShare` type should now reference the `NoSync` type. The functionality and meaning of this trait have not changed, only the naming. Closes #16281 [breaking-change]
2014-08-06Merge commit '881bfb1a180a1b545daa9da1539ec4c8ebda7ed1' into rollupAlex Crichton-13/+31
2014-08-05Renamed `record_stack_bounds` for clarity.Vadim Chugunov-2/+2
For a good measure, implemented target_record_stack_bounds for 32-bit Windows as well.
2014-08-04libnative should not mess with stack limits in the TIB. Only libgreen has a ↵Vadim Chugunov-2/+2
legitimate need to set them.
2014-08-04Ensure that Registers struct is 16-byte aligned on x86_64.Vadim Chugunov-11/+29
This is important when building with --disable-jemalloc: unlike jemalloc, msvcrt does not align on 16 bytes unless asked to.
2014-08-04stabilize atomics (now atomic)Aaron Turon-14/+14
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-01Fix misspelled comments.Joseph Crail-1/+1
2014-07-31auto merge of #16073 : mneumann/rust/dragonfly2, r=alexcrichtonbors-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-30green: Prevent runtime corruption on spawn failureAlex Crichton-3/+18
Like with libnative, when a green task failed to spawn it would leave the world in a corrupt state where the local scheduler had been dropped as well as the local task. Also like libnative, this patch sets up a "bomb" which when it goes off will restore the state of the world.
2014-07-30rustrt: Allow dropping a brand-new TaskAlex Crichton-1/+1
When a new task fails to spawn, it triggers a task failure of the spawning task. This ends up causing runtime aborts today because of the destructor bomb in the Task structure. The bomb doesn't actually need to go off until *after* the task has run at least once. This now prevents a runtime abort when a native thread fails to spawn.
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-24libsyntax: Remove `~self` and `mut ~self` from the language.Patrick Walton-34/+42
This eliminates the last vestige of the `~` syntax. Instead of `~self`, write `self: Box<TypeOfSelf>`; instead of `mut ~self`, write `mut self: Box<TypeOfSelf>`, replacing `TypeOfSelf` with the self-type parameter as specified in the implementation. Closes #13885. [breaking-change]
2014-07-22auto merge of #15867 : cmr/rust/rewrite-lexer4, r=alexcrichtonbors-0/+1
2014-07-21ignore-lexer-test to broken files and remove some tray hyphensCorey Richardson-0/+1
I blame @ChrisMorgan for the hyphens.
2014-07-19librustc: Implement lifetime elision.Patrick Walton-2/+2
This implements RFC 39. Omitted lifetimes in return values will now be inferred to more useful defaults, and an error is reported if a lifetime in a return type is omitted and one of the two lifetime elision rules does not specify what it should be. This primarily breaks two uncommon code patterns. The first is this: unsafe fn get_foo_out_of_thin_air() -> &Foo { ... } This should be changed to: unsafe fn get_foo_out_of_thin_air() -> &'static Foo { ... } The second pattern that needs to be changed is this: enum MaybeBorrowed<'a> { Borrowed(&'a str), Owned(String), } fn foo() -> MaybeBorrowed { Owned(format!("hello world")) } Change code like this to: enum MaybeBorrowed<'a> { Borrowed(&'a str), Owned(String), } fn foo() -> MaybeBorrowed<'static> { Owned(format!("hello world")) } Closes #15552. [breaking-change]
2014-07-12auto merge of #15610 : brson/rust/0.12.0, r=alexcrichtonbors-1/+1
2014-07-12auto merge of #15588 : alexcrichton/rust/issue-15478, r=cmrbors-11/+13
If modified, you can safely unmap arbitrary memory. These fields are not intended to be modified, so read-only accessors are the only ones that are provided. Closes #15478