about summary refs log tree commit diff
path: root/src/libnative
AgeCommit message (Collapse)AuthorLines
2014-09-16Fallout from renamingAaron Turon-62/+62
2014-09-13librustc: Forbid inherent implementations that aren't adjacent to thePatrick Walton-0/+1
type they provide an implementation for. This breaks code like: mod foo { struct Foo { ... } } impl foo::Foo { ... } Change this code to: mod foo { struct Foo { ... } impl Foo { ... } } Additionally, if you used the I/O path extension methods `stat`, `lstat`, `exists`, `is_file`, or `is_dir`, note that these methods have been moved to the the `std::io::fs::PathExtensions` trait. This breaks code like: fn is_it_there() -> bool { Path::new("/foo/bar/baz").exists() } Change this code to: use std::io::fs::PathExtensions; fn is_it_there() -> bool { Path::new("/foo/bar/baz").exists() } Closes #17059. RFC #155. [breaking-change]
2014-09-09rollup merge of #17020 : nodakai/libnative-c_intAlex Crichton-34/+22
2014-09-08libnative/io: generic retry() for Unix 64 bit read/write().NODA, Kai-34/+22
Win32/WinSock APIs never call WSASetLastError() with WSAEINTR unless a programmer specifically cancels the ongoing blocking call by a deprecated WinSock1 API WSACancelBlockingCall(). So the errno check was simply removed and retry() became an id function on Windows. Note: Windows' equivalent of SIGINT is always handled in a separate thread: http://msdn.microsoft.com/en-us/library/windows/desktop/ms682541%28v=vs.85%29.aspx "CTRL+C and CTRL+BREAK Signals" Also, incidentally rename a type parameter and clean up some module imports.
2014-09-07auto merge of #16942 : alexcrichton/rust/remove-net-assert, r=brsonbors-1/+1
This assert was likely inherited from some point, but it's not quite valid as a no-timeout read may enter this loop, but data could be stolen by any other read after the socket is deemed readable. I saw this fail in a recent bors run where the assertion was tripped.
2014-09-06readdir: return error instead of failing on invalid UTF-16Peter Atashian-26/+19
Fixes #15279 Signed-off-by: Peter Atashian <retep998@gmail.com>
2014-09-04auto merge of #16982 : jbcrail/rust/comment-and-string-corrections, ↵bors-8/+8
r=alexcrichton I corrected spelling and capitalization errors in comments and strings.
2014-09-03Fix spelling errors and capitalization.Joseph Crail-8/+8
2014-09-03libnative/io/file_unix: remove superfluous retry().NODA, Kai-24/+12
These syscalls don't return EINTR: http://pubs.opengroup.org/onlinepubs/9699919799/functions/fstat.html http://pubs.opengroup.org/onlinepubs/9699919799/functions/mkdir.html http://pubs.opengroup.org/onlinepubs/9699919799/functions/unlink.html http://pubs.opengroup.org/onlinepubs/9699919799/functions/rename.html http://pubs.opengroup.org/onlinepubs/9699919799/functions/rmdir.html http://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html http://pubs.opengroup.org/onlinepubs/9699919799/functions/symlink.html http://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html http://pubs.opengroup.org/onlinepubs/9699919799/functions/fstatat.html http://pubs.opengroup.org/onlinepubs/9699919799/functions/utime.html
2014-09-02native: Remove a bogus assert in net::readAlex Crichton-1/+1
This assert was likely inherited from some point, but it's not quite valid as a no-timeout read may enter this loop, but data could be stolen by any other read after the socket is deemed readable. I saw this fail in a recent bors run where the assertion was tripped.
2014-08-30Unify non-snake-case lints and non-uppercase statics lintsP1start-2/+2
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-28auto merge of #16664 : aturon/rust/stabilize-option-result, r=alexcrichtonbors-3/+3
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-3/+3
2014-08-27Implement generalized object and type parameter bounds (Fixes #16462)Niko Matsakis-2/+2
2014-08-24native: clone/close_accept for win32 pipesAlex Crichton-40/+108
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-24native: Add some documentation for acceptAlex Crichton-0/+34
Document the new code for how close_accept and timeouts are implemented.
2014-08-24native: TCP close/close_accept for windowsAlex Crichton-78/+228
This commit implements TcpAcceptor::{close, close_accept} for windows via WSAEVENT types.
2014-08-24native: Implement clone/close_accept for unixAlex Crichton-46/+156
This commits implements {Tcp,Unix}Acceptor::{clone,close_accept} methods for unix. A windows implementation is coming in a later commit. The clone implementation is based on atomic reference counting (as with all other clones), and the close_accept implementation is based on selecting on a self-pipe which signals that a close has been seen.
2014-08-23Complete renaming of win32 to windowsVadim Chugunov-10/+9
2014-08-20libgreen: use FFI-safe typesCorey Richardson-1/+2
2014-08-20liblibc: don't use int/uint for intptr_t/uintptr_tCorey Richardson-0/+1
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/+13
2014-08-18libsyntax: Remove the `use foo = bar` syntax from the language in favorPatrick Walton-18/+18
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-12libnative: process spawning should not close inherited file descriptorsIvan Petkov-1/+1
* The caller should be responsible for cleaning up file descriptors * If a caller safely creates a file descriptor (via native::io::file::open) the returned structure (FileDesc) will try to clean up the file, failing in the process and writing error messages to the screen. * This should not happen as the caller has no public interface for telling the FileDesc structure to NOT free the underlying fd. * Alternatively, if another file is opened under the same fd held by the FileDesc structure returned by native::io::file::open, it will close the wrong file upon destruction.
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-1/+4
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-07windows: Fix INVALID_HANDLE_VALUEPeter Atashian-13/+13
Made INVALID_HANDLE_VALUE actually a HANDLE. Removed all useless casts during INVALID_HANDLE_VALUE comparisons. Signed-off-by: Peter Atashian <retep998@gmail.com>
2014-08-07windows: Fix several tests on 64-bit.Peter Atashian-0/+20
Signed-off-by: Peter Atashian <retep998@gmail.com>
2014-08-06Merge commit '881bfb1a180a1b545daa9da1539ec4c8ebda7ed1' into rollupAlex Crichton-2/+2
2014-08-06auto merge of #16258 : aturon/rust/stabilize-atomics, r=alexcrichtonbors-12/+12
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-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-05native, rustuv: Fix spawning with empty argsAlex Crichton-1/+4
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-05auto merge of #16243 : alexcrichton/rust/fix-utime-for-windows, r=brsonbors-2/+2
Apparently the units are in milliseconds, not in seconds!
2014-08-04stabilize atomics (now atomic)Aaron Turon-12/+12
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-04Change everything returning `libc::sockaddr_storage` to use an &mut out-ptr ↵Andrew Poelstra-27/+30
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-02native: Fix utime() for windowsAlex Crichton-2/+2
Apparently the units are in milliseconds, not in seconds!
2014-08-01Fix misspelled comments.Joseph Crail-2/+2
2014-07-31auto merge of #16073 : mneumann/rust/dragonfly2, r=alexcrichtonbors-1/+13
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-30native: Don't deadlock the runtime on spawn failureAlex Crichton-2/+2
Previously, the call to bookkeeping::increment() was never paired with a decrement when the spawn failed (due to unwinding). This fixes the problem by returning a "bomb" from increment() which will decrement on drop, and then moving the bomb into the child task's procedure which will be dropped naturally.
2014-07-29Port Rust to DragonFlyBSDMichael Neumann-1/+13
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-17/+8
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-24Test fixes from the rollupAlex Crichton-3/+3
Closes #15807 (Deprecate some unsafe functions in `str::raw` and remove `OwnedStr` trait) Closes #15859 (Implement `Show` for `CString` and fix warning compiling tests for libcollections) Closes #15911 (Updated LLVM for iOS) Closes #15925 (libsyntax: Remove `~self` and `mut ~self` from the language.) Closes #15930 (Add examples for Checked[Add|Sub|Mul|Div]) Closes #15933 (rustdoc: make table of contents optional) Closes #15937 (librustc: Make bare functions implement the `FnMut` trait.) Closes #15938 (librustc: Check structure constructors against their types.) Closes #15939 (rustdoc: Add a --crate-name option) Closes #15942 (Document trie collections) Closes #15943 (Document SmallIntMap)
2014-07-24libsyntax: Remove `~self` and `mut ~self` from the language.Patrick Walton-9/+14
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 a null pointer check to CString::newAdolfo Ochagavía-5/+5
This also removes checks in other methods of `CString` Breaking changes: * `CString::new` now fails if `buf` is null. To avoid this add a check before creatng a new `CString` . * The `is_null` and `is_not_null` methods are deprecated, because a `CString` cannot be null. * Other methods which used to fail if the `CString` was null do not fail anymore [breaking-change]
2014-07-22auto merge of #15867 : cmr/rust/rewrite-lexer4, r=alexcrichtonbors-0/+2
2014-07-21Add a ton of ignore-lexer-testCorey Richardson-0/+2
2014-07-15Deprecate `str::from_utf16`Adolfo Ochagavía-1/+1
Use `String::from_utf16` instead [breaking-change]
2014-07-13native: Search the child's PATH on win32Alex Crichton-1/+21
In order to have the spawning semantics be the same for unix/windows, the child's PATH environment variable needs to be searched rather than the parent's environment variable. If the child is inheriting the parent's PATH, then no action need be taken as windows will do the heavy lifting. If the child specifies its own PATH, then it is searched beforehand for the target program and the result is favored if a hit is found. cc #15149, but does not close the issue because libgreen still needs to be updated.
2014-07-11Update doc URLs for version bumpBrian Anderson-1/+1