about summary refs log tree commit diff
path: root/src/librustuv
AgeCommit message (Collapse)AuthorLines
2014-10-01Remove librustuvAaron Turon-6463/+0
This commit removes the `librustuv` crate. See the [runtime removal RFC](https://github.com/rust-lang/rfcs/pull/230) for more context. See [green-rs](https://github.com/alexcrichton/green-rs/) for a possible migration path if you wish to continue using green-threaded I/O. The library provides its own I/O API surface. [breaking-change]
2014-09-30Fix librustuvSteven Fackler-5/+3
2014-09-23Deprecate `#[ignore(cfg(...))]`Steven Fackler-1/+1
Replace `#[ignore(cfg(a, b))]` with `#[cfg_attr(all(a, b), ignore)]`
2014-09-22librustc: Forbid private types in public APIs.Patrick Walton-2/+1
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-21Fix fallout from Vec stabilizationAlex Crichton-2/+2
2014-09-16Fallout from renamingAaron Turon-14/+14
2014-09-15add Send bound on impl because stricter trait checking requires itNiko Matsakis-1/+1
2014-09-01Updated to new extern crate syntax.wickerwaka-1/+1
Added warning for old deprecated syntax
2014-08-29Register new snapshotsAlex Crichton-15/+0
2014-08-28auto merge of #16664 : aturon/rust/stabilize-option-result, r=alexcrichtonbors-12/+12
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-12/+12
2014-08-27Implement generalized object and type parameter bounds (Fixes #16462)Niko Matsakis-0/+15
2014-08-26DST coercions and DST structsNick Cameron-4/+7
[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-24native: clone/close_accept for win32 pipesAlex Crichton-2/+2
This commits takes a similar strategy to the previous commit to implement close_accept and clone for the native win32 pipes implementation. Closes #15595
2014-08-24rustuv: Implement clone/close_acceptAlex Crichton-173/+290
This commits implements {Tcp,Unix}Acceptor::{clone,close_accept} methods for all of librustuv. This implementation rewrites much of Access, AccessTimeout, and AcceptTimeout to have type parameter for shared state that all acceptors share (a shared queue of sockets). The incoming/outgoing channels have been removed as all timeouts and such are now managed on the event loop rather than concurrently.
2014-08-23Remove stage0 attributes.Vadim Chugunov-1/+0
2014-08-20liblibc: don't use int/uint for intptr_t/uintptr_tCorey Richardson-2/+2
int/uint aren't considered FFI safe, replace them with the actual type they represent (i64/u64 or i32/u32). This is a breaking change, but at most a cast to `uint` or `int` needs to be added. [breaking-change]
2014-08-20Add #[repr(C)] to all the things!Corey Richardson-0/+5
2014-08-18libsyntax: Remove the `use foo = bar` syntax from the language in favorPatrick Walton-1/+1
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-15auto merge of #16435 : vadimcn/rust/windows, r=pcwaltonbors-1/+2
Using "win32" to mean "Windows" is confusing, especially now, that Rust supports win64 builds. Let's call spade a spade.
2014-08-12Replace #[cfg(target_os = "win32")] with #[cfg(target_os = "windows")]Vadim Chugunov-1/+2
2014-08-12auto merge of #16284 : alexcrichton/rust/issue-16272, r=aturonbors-6/+10
There was a bug in both libnative and libuv which prevented child processes from being spawned correctly on windows when one of the arguments was an empty string. The libuv bug has since been fixed upstream, and the libnative bug was fixed as part of this commit. When updating libuv, this also includes a fix for #15149. Closes #15149 Closes #16272
2014-08-09auto merge of #15964 : huonw/rust/gensym-test, r=alexcrichtonbors-5/+3
This requires avoiding `quote_...!` for constructing the parts of the __test module, since that stringifies and reinterns the idents, losing the special gensym'd nature of them. (#15962.)
2014-08-09testsuite: implement #[reexport_test_harness_name] to get access to theHuon Wilson-5/+3
default entrypoint of the --test binary. This allows one to, e.g., run tests under libgreen by starting it manually, passing in the test entrypoint.
2014-08-05native, rustuv: Fix spawning with empty argsAlex Crichton-6/+10
There was a bug in both libnative and libuv which prevented child processes from being spawned correctly on windows when one of the arguments was an empty string. The libuv bug has since been fixed upstream, and the libnative bug was fixed as part of this commit. When updating libuv, this also includes a fix for #15149. Closes #15149 Closes #16272
2014-08-04Change everything returning `libc::sockaddr_storage` to use an &mut out-ptr ↵Andrew Poelstra-20/+23
instead The BSD socket code does some cast tricks with the `libc::sockaddr*` structs, which causes useful data to be stored in struct padding. Since Load/Store instructions do not copy struct padding, this makes these structures dangerous to pass or return by value. In particular, https://github.com/rust-lang/rust/issues/15763 changes return semantics so that a Load instruction is used, breaking the TCP code. Once this PR is merged, that one should merge without error.
2014-08-01Fix misspelled comments.Joseph Crail-1/+1
2014-07-29Port Rust to DragonFlyBSDMichael Neumann-0/+2
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-26std: Stabilize unit, bool, ty, tuple, arc, anyAlex Crichton-6/+6
This commit applies stability attributes to the contents of these modules, summarized here: * The `unit` and `bool` modules have become #[unstable] as they are purely meant for documentation purposes and are candidates for removal. * The `ty` module has been deprecated, and the inner `Unsafe` type has been renamed to `UnsafeCell` and moved to the `cell` module. The `marker1` field has been removed as the compiler now always infers `UnsafeCell` to be invariant. The `new` method i stable, but the `value` field, `get` and `unwrap` methods are all unstable. * The `tuple` module has its name as stable, the naming of the `TupleN` traits as stable while the methods are all #[unstable]. The other impls in the module have appropriate stability for the corresponding trait. * The `arc` module has received the exact same treatment as the `rc` module previously did. * The `any` module has its name as stable. The `Any` trait is also stable, with a new private supertrait which now contains the `get_type_id` method. This is to make the method a private implementation detail rather than a public-facing detail. The two extension traits in the module are marked #[unstable] as they will not be necessary with DST. The `is` method is #[stable], the as_{mut,ref} methods have been renamed to downcast_{mut,ref} and are #[unstable]. The extension trait `BoxAny` has been clarified as to why it is unstable as it will not be necessary with DST. This is a breaking change because the `marker1` field was removed from the `UnsafeCell` type. To deal with this change, you can simply delete the field and only specify the value of the `data` field in static initializers. [breaking-change]
2014-07-24libsyntax: Remove `~self` and `mut ~self` from the language.Patrick Walton-3/+5
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-24Add `string::raw::from_buf`Adolfo Ochagavía-3/+3
2014-07-24Deprecated `str::raw::from_c_str`Adolfo Ochagavía-3/+3
Use `string::raw::from_buf` instead [breaking-change]
2014-07-23collections: Deprecate shift/unshiftBrian Anderson-1/+1
Use insert/remove instead.
2014-07-19librustc: Implement lifetime elision.Patrick Walton-1/+1
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-15auto merge of #15604 : mrmonday/rust/raw-socket-libc, r=alexcrichtonbors-0/+21
This pull request adds some necessary function definitions and types for doing low level networking with Rust.
2014-07-15Add low level support for polling with librustuv.Robert Clipsham-0/+21
* Adds functions for using arbitrary sockets with libuv * Adds types and functions required to support this.
2014-07-14std: Make unlink() more consistentAlex Crichton-1/+4
Currently when a read-only file has unlink() invoked on it on windows, the call will fail. On unix, however, the call will succeed. In order to have a more consistent behavior across platforms, this error is recognized on windows and the file is changed to read-write before removal is attempted.
2014-07-13auto merge of #15584 : alexcrichton/rust/warn-annoyances, r=cmrbors-1/+1
* Don't warn about `#[crate_name]` if `--crate-name` is specified * Don't warn about non camel case identifiers on `#[repr(C)]` structs * Switch `mode` to `mode_t` in libc.
2014-07-12Use a nicer Show impl for NameCorey Richardson-1/+1
2014-07-11Update doc URLs for version bumpBrian Anderson-1/+1
2014-07-10io::process::Command: add fine-grained env builderAaron Turon-1/+1
This commit changes the `io::process::Command` API to provide fine-grained control over the environment: * The `env` method now inserts/updates a key/value pair. * The `env_remove` method removes a key from the environment. * The old `env` method, which sets the entire environment in one shot, is renamed to `env_set_all`. It can be used in conjunction with the finer-grained methods. This renaming is a breaking change. To support these new methods, the internal `env` representation for `Command` has been changed to an optional `HashMap` holding owned `CString`s (to support non-utf8 data). The `HashMap` is only materialized if the environment is updated. The implementation does not try hard to avoid allocation, since the cost of launching a process will dwarf any allocation cost. This patch also adds `PartialOrd`, `Eq`, and `Hash` implementations for `CString`. [breaking-change]
2014-07-09Register new snapshotsAlex Crichton-2/+0
Closes #15544
2014-07-08std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.Richo Healey-3/+3
[breaking-change]
2014-07-05Add #[crate_name] attributes as necessaryAlex Crichton-1/+3
2014-07-04auto merge of #15343 : alexcrichton/rust/0.11.0-release, r=brsonbors-1/+5
2014-07-03Fix spelling errors.Joseph Crail-3/+3
2014-07-02Merge remote-tracking branch 'origin/master' into 0.11.0-releaseAlex Crichton-399/+419
Conflicts: src/libstd/lib.rs
2014-07-02Rename recvfrom -> recv_from, sendto -> send_to.OGINO Masanori-17/+17
POSIX has recvfrom(2) and sendto(2), but their name seem not to be suitable with Rust. We already renamed getpeername(2) and getsockname(2), so I think it makes sense. Alternatively, `receive_from` would be fine. However, we have `.recv()` so I chose `recv_from`. Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-06-29auto merge of #15252 : alexcrichton/rust/issue-15231, r=pcwaltonbors-7/+10
When cloning a stream, the data is already guaranteed to be in a consistent state, so there's no need to perform a zeroing. This prevents segfaults as seen in #15231 Closes #15231
2014-06-29librustc: Remove the fallback to `int` for integers and `f64` forPatrick Walton-2/+2
floating point numbers for real. This will break code that looks like: let mut x = 0; while ... { x += 1; } println!("{}", x); Change that code to: let mut x = 0i; while ... { x += 1; } println!("{}", x); Closes #15201. [breaking-change]