summary refs log tree commit diff
path: root/src/libstd/sys/common
AgeCommit message (Collapse)AuthorLines
2015-09-14Mark all extern functions as nounwindBjörn Steinbrink-0/+6
Unwinding across an FFI boundary is undefined behaviour, so we can mark all external function as nounwind. The obvious exception are those functions that actually perform the unwinding.
2015-09-11std: Internalize almost all of `std::rt`Alex Crichton-3/+1670
This commit does some refactoring to make almost all of the `std::rt` private. Specifically, the following items are no longer part of its API: * DEFAULT_ERROR_CODE * backtrace * unwind * args * at_exit * cleanup * heap (this is just alloc::heap) * min_stack * util The module is now tagged as `#[doc(hidden)]` as the only purpose it's serve is an entry point for the `panic!` macro via the `begin_unwind` and `begin_unwind_fmt` reexports.
2015-09-08some more clippy-based improvementsAndre Bogus-16/+10
2015-09-04Add line numbers to windows-gnu backtracesDiggory Blake-2/+253
Fix formatting Remove unused imports Refactor Fix msvc build Fix line lengths Formatting Enable backtrace tests Fix using directive on mac pwd info Work-around buildbot PWD bug, and fix libbacktrace configuration Use alternative to `env -u` which is not supported on bitrig Disable tests on 32-bit windows gnu
2015-09-03Use `null()`/`null_mut()` instead of `0 as *const T`/`0 as *mut T`Vadim Petrochenkov-3/+4
2015-08-27Auto merge of #27808 - SimonSapin:utf16decoder, r=alexcrichtonbors-6/+5
* Rename `Utf16Items` to `Utf16Decoder`. "Items" is meaningless. * Generalize it to any `u16` iterator, not just `[u16].iter()` * Make it yield `Result` instead of a custom `Utf16Item` enum that was isomorphic to `Result`. This enable using the `FromIterator for Result` impl. * Replace `Utf16Item::to_char_lossy` with a `Utf16Decoder::lossy` iterator adaptor. This is a [breaking change], but only for users of the unstable `rustc_unicode` crate. I’d like this functionality to be stabilized and re-exported in `std` eventually, as the "low-level equivalent" of `String::from_utf16` and `String::from_utf16_lossy` like #27784 is the low-level equivalent of #27714. CC @aturon, @alexcrichton
2015-08-23Add Send/Sync traits on LookupHost structGuillaume Gomez-0/+3
2015-08-23Refactor low-level UTF-16 decoding.Simon Sapin-6/+5
* Rename `utf16_items` to `decode_utf16`. "Items" is meaningless. * Move it to `rustc_unicode::char`, exposed in `std::char`. * Generalize it to any `u16` iterable, not just `&[u16]`. * Make it yield `Result` instead of a custom `Utf16Item` enum that was isomorphic to `Result`. This enable using the `FromIterator for Result` impl. * Add a `REPLACEMENT_CHARACTER` constant. * Document how `result.unwrap_or(REPLACEMENT_CHARACTER)` replaces `Utf16Item::to_char_lossy`.
2015-08-15std: Add issues to all unstable featuresAlex Crichton-2/+4
2015-08-13Auto merge of #27684 - alexcrichton:remove-deprecated, r=aturonbors-106/+11
This commit removes all unstable and deprecated functions in the standard library. A release was recently cut (1.3) which makes this a good time for some spring cleaning of the deprecated functions.
2015-08-13Auto merge of #27693 - nagisa:remutex-docs, r=alexcrichtonbors-3/+10
Initial version of PR had an DerefMut implementation, which was later removed because it may cause mutable reference aliasing. Suggest how to implement mutability with reentrant mutex and remove the claim we implement DerefMut.
2015-08-12Remove all unstable deprecated functionalityAlex Crichton-106/+11
This commit removes all unstable and deprecated functions in the standard library. A release was recently cut (1.3) which makes this a good time for some spring cleaning of the deprecated functions.
2015-08-12Fix ReentrantMutex documentation wrt DerefMutSimonas Kazlauskas-3/+10
Initial version of PR had an DerefMut implementation, which was later removed because it may cause mutable reference aliasing. Suggest how to implement mutability with reentrant mutex and remove the claim we implement DerefMut.
2015-08-11Register new snapshotsAlex Crichton-21/+0
* Lots of core prelude imports removed * Makefile support for MSVC env vars and Rust crates removed * Makefile support for morestack removed
2015-08-10Remove morestack supportAlex Crichton-319/+4
This commit removes all morestack support from the compiler which entails: * Segmented stacks are no longer emitted in codegen. * We no longer build or distribute libmorestack.a * The `stack_exhausted` lang item is no longer required The only current use of the segmented stack support in LLVM is to detect stack overflow. This is no longer really required, however, because we already have guard pages for all threads and registered signal handlers watching for a segfault on those pages (to print out a stack overflow message). Additionally, major platforms (aka Windows) already don't use morestack. This means that Rust is by default less likely to catch stack overflows because if a function takes up more than one page of stack space it won't hit the guard page. This is what the purpose of morestack was (to catch this case), but it's better served with stack probes which have more cross platform support and no runtime support necessary. Until LLVM supports this for all platform it looks like morestack isn't really buying us much. cc #16012 (still need stack probes) Closes #26458 (a drive-by fix to help diagnostics on stack overflow)
2015-08-03syntax: Implement #![no_core]Alex Crichton-2/+8
This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The `#![no_std]` attribute now injects `extern crate core` at the top of the crate as well as the libcore prelude into all modules (in the same manner as the standard library's prelude). The `#![no_core]` attribute disables both std and core injection. [rfc]: https://github.com/rust-lang/rfcs/pull/1184
2015-07-27Fix escaping of characters in Debug for OsStrdiaphore-15/+25
Fixes #27211 Fix Debug for {char, str} in core::fmt
2015-07-23wtf8, char: Replace uses of `mem::transmute` with more specific functionsTobias Bucher-12/+19
2015-07-21Auto merge of #27073 - alexcrichton:less-proc-fs, r=brsonbors-4/+4
This can fail on linux for various reasons, such as the /proc filesystem not being mounted. There are already many cases where we can't set up stack guards, so just don't worry about this case and communicate that no guard was enabled. I've confirmed that this allows the compiler to run in a chroot without /proc mounted. Closes #22642
2015-07-21std: Be resilient to failure in pthread_getattr_npAlex Crichton-4/+4
This can fail on linux for various reasons, such as the /proc filesystem not being mounted. There are already many cases where we can't set up stack guards, so just don't worry about this case and communicate that no guard was enabled. I've confirmed that this allows the compiler to run in a chroot without /proc mounted. Closes #22642
2015-07-20std: Add IntoRaw{Fd,Handle,Socket} traitsAlex Crichton-0/+6
This commit is an implementation of [RFC 1174][rfc] which adds three new traits to the standard library: * `IntoRawFd` - implemented on Unix for all I/O types (files, sockets, etc) * `IntoRawHandle` - implemented on Windows for files, processes, etc * `IntoRawSocket` - implemented on Windows for networking types [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1174-into-raw-fd-socket-handle-traits.md Closes #27062
2015-07-15Add specializations of read_to_end for Stdin, TcpStream and File,Alisdair Owens-0/+140
allowing them to read into a buffer containing uninitialized data, rather than pay the cost of zeroing.
2015-07-11fixing trailing whitespaceDave Huseby-1/+1
2015-07-11adding support for i686-unknown-freebsd targetDave Huseby-7/+9
2015-07-01Add netbsd amd64 supportAlex Newman-0/+2
2015-06-17More test fixes and fallout of stability changesAlex Crichton-25/+1
2015-06-17std: Stabilize the sync_poison featureAlex Crichton-4/+4
These accessor/constructor methods for a `PoisonError` are quite standard for a wrapper type and enable manipulation of the underlying type.
2015-06-17std: Remove two internal `str_internals` functionsAlex Crichton-25/+0
These were just exposed to be used elsewhere at some point, but neither is currently being used so just make them private again.
2015-06-17std: Split the `std_misc` featureAlex Crichton-4/+4
2015-06-10Rollup merge of #26146 - steveklabnik:remove_unsafe_pointer, r=GankroManish Goregaokar-1/+1
Using two terms for one thing is confusing, these are called 'raw pointers' today.
2015-06-09Exise 'unsafe pointer' in favor of 'raw pointer'Steve Klabnik-1/+1
Using two terms for one thing is confusing, these are called 'raw pointers' today.
2015-06-09fix example in comments about demanglingAndrew Straw-1/+1
2015-06-08Auto merge of #26077 - SimonSapin:patch-6, r=alexcrichtonbors-6/+6
With the latter is provided by the `From` conversion trait, the former is now completely redundant. Their code is identical. Let’s deprecate now and plan to remove in the next cycle. (It’s `#[unstable]`.) r? @alexcrichton CC @nagisa
2015-06-08Replace usage of String::from_str with String:fromSimon Sapin-6/+6
2015-06-08Auto merge of #25823 - oli-obk:static_to_const_lint, r=alexcrichtonbors-1/+1
r? @eddyb
2015-06-07change some statics to constantsOliver 'ker' Schneider-1/+1
2015-06-03Rollup merge of #25974 - richo:stack-msg, r=alexcrichtonManish Goregaokar-8/+4
These are implemented in asm, they're just not inlined. Open questions are: * Should I just inline them? They're.. big, but it seems as though this needs violates the #[inline(always)] gaurantees the others make. * Does something (llvm?) provide these as intrinsics? The structure of this code suggests that we could be hoisting off something else, instead of flagrantly ignoring it like we do for power and mips.
2015-06-02std: clarify comments about sp* implementationsRicho Healey-8/+4
2015-05-28Implement RFC 1047 - socket timeoutsSteven Fackler-7/+39
Closes #25619
2015-05-27Use `const fn` to abstract away the contents of UnsafeCell & friends.Eduard Burtescu-46/+41
2015-05-17Make debug builders take &mut self, add entries methodSteven Fackler-10/+10
[breaking-change]
2015-05-09Squeeze the last bits of `task`s in documentation in favor of `thread`Barosl Lee-4/+4
An automated script was run against the `.rs` and `.md` files, subsituting every occurrence of `task` with `thread`. In the `.rs` files, only the texts in the comment blocks were affected.
2015-05-07std: Remove a double-box in ReentrantMutexAlex Crichton-7/+11
Perform unsafe initialization up front and then only afterward the mutex is in place do we initialize it.
2015-05-07std: Remove unused helper_thread.rs fileAlex Crichton-170/+0
This module has been removed for quite some time!
2015-05-07std: Rename sys::foo2 modules to sys::fooAlex Crichton-1/+1
Now that `std::old_io` has been removed for quite some time the naming real estate here has opened up to allow these modules to move back to their proper names.
2015-05-03Change 'inner' field name to 'fd'/'socket' on Unix/Windows in Debug implsNick Hamann-3/+6
2015-05-03Unwrap address values in Debug implementations for ↵Nick Hamann-13/+28
TcpStream/TcpListener/UdpSocket. This now omits address fields in Debug implementations when a proper address value cannot be unwrapped.
2015-05-03Implement Debug for std::net::{UdpSocket,TcpStream,TcpListener,Shutdown}Nick Hamann-0/+29
Fixes #23134.
2015-05-01Rollup merge of #25021 - frewsxcv:an-utf, r=steveklabnikManish Goregaokar-4/+4
Even spelled out, one would say 'a Universal Character Set'
2015-04-30Replaces instanced of 'an UTF' with 'a UTF'Corey Farwell-4/+4
Even spelled out, one would say 'a Universal Character Set'