Commit Graph

444 Commits

Author SHA1 Message Date
Alex Crichton 5f625620b5 std: Add issues to all unstable features 2015-08-15 18:09:17 -07:00
Alex Crichton 45bf1ed1a1 rustc: Allow changing the default allocator
This commit is an implementation of [RFC 1183][rfc] which allows swapping out
the default allocator on nightly Rust. No new stable surface area should be
added as a part of this commit.

[rfc]: https://github.com/rust-lang/rfcs/pull/1183

Two new attributes have been added to the compiler:

* `#![needs_allocator]` - this is used by liballoc (and likely only liballoc) to
  indicate that it requires an allocator crate to be in scope.
* `#![allocator]` - this is a indicator that the crate is an allocator which can
  satisfy the `needs_allocator` attribute above.

The ABI of the allocator crate is defined to be a set of symbols that implement
the standard Rust allocation/deallocation functions. The symbols are not
currently checked for exhaustiveness or typechecked. There are also a number of
restrictions on these crates:

* An allocator crate cannot transitively depend on a crate that is flagged as
  needing an allocator (e.g. allocator crates can't depend on liballoc).
* There can only be one explicitly linked allocator in a final image.
* If no allocator is explicitly requested one will be injected on behalf of the
  compiler. Binaries and Rust dylibs will use jemalloc by default where
  available and staticlibs/other dylibs will use the system allocator by
  default.

Two allocators are provided by the distribution by default, `alloc_system` and
`alloc_jemalloc` which operate as advertised.

Closes #27389
2015-08-14 15:13:10 -07:00
Alex Crichton 8d90d3f368 Remove all unstable deprecated functionality
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-12 14:55:17 -07:00
Alex Crichton 837ae4f3d4 rollup merge of #27678: alexcrichton/snapshots
* Lots of core prelude imports removed
* Makefile support for MSVC env vars and Rust crates removed
* Makefile support for morestack removed
2015-08-11 22:42:22 -07:00
Alex Crichton 938099a7eb Register new snapshots
* Lots of core prelude imports removed
* Makefile support for MSVC env vars and Rust crates removed
* Makefile support for morestack removed
2015-08-11 15:11:13 -07:00
Eli Friedman bbbfed2f93 Use https URLs to refer to rust-lang.org where appropriate.
Also fixes a few outdated links.
2015-08-09 14:28:46 -07:00
Alex Crichton 0d8340327c syntax: Don't assume `std` exists for tests
This commit removes the injection of `std::env::args()` from `--test` expanded
code, relying on the test runner itself to call this funciton. This is more
hygienic because we can't assume that `std` exists at the top layer all the
time, and it meaks the injected test module entirely self contained.
2015-08-04 14:02:36 -07:00
Alex Crichton 5cccf3cd25 syntax: Implement #![no_core]
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-08-03 17:23:01 -07:00
Brian Anderson ffa21217d2 std: Tighten up crate docs 2015-08-02 11:09:37 -07:00
FuGangqiang b399729298 trpl: fix link error 2015-07-31 16:25:17 +08:00
bors 6edc994021 Auto merge of #27388 - alexcrichton:remove-curious-inner, r=brson
This isn't actually necessary any more with the advent of `$crate` and changes
in the compiler to expand macros to `::core::$foo` in the context of a
`#![no_std]` crate.

The libcore inner module was also trimmed down a bit to the bare bones.
2015-07-30 18:42:32 +00:00
Alex Crichton 5af6cf9fa4 std: Remove the curious inner module
This isn't actually necessary any more with the advent of `$crate` and changes
in the compiler to expand macros to `::core::$foo` in the context of a
`#![no_std]` crate.

The libcore inner module was also trimmed down a bit to the bare bones.
2015-07-29 14:18:24 -07:00
Manish Goregaokar 35d95515f3 Rollup merge of #27369 - brson:realstd, r=alexcrichton
Since most lang items are actually defined in core, these hack reexports don't actually
do anything useful.
2015-07-30 01:43:53 +05:30
Brian Anderson 6464198508 std: Remove some old #[cfg(test) hacks
Since most lang items are actually defined in core, these hack reexports don't actually
do anything useful.
2015-07-28 16:22:05 -07:00
bors 5b72fa42d4 Auto merge of #27309 - eddyb:snapshot-infdef, r=alexcrichton
FreeBSD i386 snapshot is missing, failed tests (possibly spurious).
r? @alexcrichton
2015-07-28 08:51:21 +00:00
Alex Crichton b3aa1a6d4a std: Deprecate a number of unstable features
Many of these have long since reached their stage of being obsolete, so this
commit starts the removal process for all of them. The unstable features that
were deprecated are:

* cmp_partial
* fs_time
* hash_default
* int_slice
* iter_min_max
* iter_reset_fuse
* iter_to_vec
* map_in_place
* move_from
* owned_ascii_ext
* page_size
* read_and_zero
* scan_state
* slice_chars
* slice_position_elem
* subslice_offset
2015-07-27 16:38:25 -07:00
Eduard Burtescu 5720f7055a Register new snapshots (2015-07-26 a5c12f4). 2015-07-27 13:31:48 +03:00
bors e4f044662b Auto merge of #27233 - tbu-:pr_wtf8, r=alexcrichton 2015-07-25 04:25:33 +00:00
Tobias Bucher c2fca7c957 Add unstable attribute to `char::from_u32_unchecked` 2015-07-24 01:58:38 +02:00
Felix S. Klock II cb5f0b4971 Avoid feature-warnings on stage0. 2015-07-22 15:34:00 +02:00
Felix S. Klock II b325e4f28e Add feature-gates for desugaring-based `box` and placement-`in`.
update test/compile-fail/feature-gate-box-expr.rs to reflect new feature gates.

Part of what lands with Issue 22181.
2015-07-22 15:33:59 +02:00
Brian Anderson 778c89c1bb Address feedback 2015-07-20 17:12:59 -07:00
Brian Anderson 8497c428e5 std: Create separate docs for the primitives
Having the primitive and module docs derived from the same source
causes problems, primarily that they can't contain hyperlinks
cross-referencing each other.

This crates dedicated private modules in `std` to document the
primitive types, then for all primitives that have a corresponding
module, puts hyperlinks in moth the primitive docs and the module docs
cross-linking each other.

This should help clear up confusion when readers find themselves on
the wrong page.
2015-07-20 13:18:06 -07:00
Manish Goregaokar 3a5bc736ae Rollup merge of #26977 - brson:stddoc, r=Gankro
Yet another attempt to make the prose on the std crate page
clearer and more informative.

This does a lot of things: tightens up the opening, adds useful links
(including a link to the search bar), offers guidance on how to use
the docs, and expands the prelude docs as a useful newbie entrypoint.

r? @steveklabnik cc @aturon
2015-07-16 10:48:47 +05:30
Brian Anderson 2881bbad59 Address more feedback 2015-07-14 14:41:50 -07:00
Brian Anderson 6d5ae6b20d Address more feedback 2015-07-14 10:27:33 -07:00
Ulrik Sverdrup 7b51c1c573 Use Vec::drain in BufWriter
I happened past a comment that asked for functionality that we now have.
2015-07-14 11:43:24 +02:00
Brian Anderson 3a180d15f8 Address feedback 2015-07-13 18:38:00 -07:00
Brian Anderson 4089ba873e Fix local path 2015-07-13 17:56:47 -07:00
Brian Anderson 68781e25c5 std: Refining crate docs
Yet another attempt to make the prose on the std crate page
clearer and more informative.

This does a lot of things: tightens up the opening, adds useful links
(including a link to the search bar), offers guidance on how to use
the docs, and expands the prelude docs as a useful newbie entrypoint.
2015-07-13 17:56:47 -07:00
Jonathan Reem 69579e4d37 Test that CStr and CString have equivalent hashes. 2015-07-09 17:41:09 -07:00
Ulrik Sverdrup 6ac0ba3c3a Improve Vec::resize so that it can be used in Read::read_to_end
We needed a more efficient way to zerofill the vector in read_to_end.
This to reduce the memory intialization overhead to a minimum.

Use the implementation of `std::vec::from_elem` (used for the vec![]
macro) for Vec::resize as well. For simple element types like u8, this
compiles to memset, so it makes Vec::resize much more efficient.
2015-07-08 19:40:40 +02:00
Alex Crichton ae0eb675db msvc: Fix TLS destructors
Just like the original article our Windows TLS support is based on predicted,
this symbol must be linked in on MSVC to pull in the necessary support for TLS
variables. This commit fixes a number of unit tests which require that TLS
destructors are run.
2015-07-01 09:35:55 -07:00
Brian Anderson 9b30eabc22 Fix capitalization in std docs
"Rust" and "The Rust Standard Library" are capitalized.
2015-06-24 14:33:41 -07:00
Geoffrey Thomas e13642163a sys/unix/c.rs: Remove unused code
It looks like a lot of this dated to previous incarnations of the io
module, etc., and went unused in the reworking leading up to 1.0. Remove
everything we're not actively using (except for signal handling, which
will be reworked in the next commit).
2015-06-22 00:55:42 -04:00
Alex Crichton ec333380e0 Fix libstd tests 2015-06-18 10:51:31 -07:00
Alex Crichton b4a2823cd6 More test fixes and fallout of stability changes 2015-06-17 09:07:17 -07:00
Alex Crichton ce1a965cf5 Fallout in tests and docs from feature renamings 2015-06-17 09:07:16 -07:00
Alex Crichton 6895311e85 std: Split the `std_misc` feature 2015-06-17 09:06:59 -07:00
Alex Crichton d444d0c357 collections: Split the `collections` feature
This commit also deprecates the `as_string` and `as_slice` free functions in the
`string` and `vec` modules.
2015-06-17 09:06:59 -07:00
Alex Crichton c44f5399e4 alloc: Split apart the global `alloc` feature 2015-06-17 09:06:59 -07:00
Alex Crichton c14d86fd3f core: Split apart the global `core` feature
This commit shards the broad `core` feature of the libcore library into finer
grained features. This split groups together similar APIs and enables tracking
each API separately, giving a better sense of where each feature is within the
stabilization process.

A few minor APIs were deprecated along the way:

* Iterator::reverse_in_place
* marker::NoCopy
2015-06-17 09:06:59 -07:00
Eduard Burtescu 377b0900ae Use `const fn` to abstract away the contents of UnsafeCell & friends. 2015-05-27 11:19:03 +03:00
Oliver Schneider d5985d3036 Rollup merge of #25709 - MatejLach:stdlib_style, r=steveklabnik
Sounds better to me this way.
r @steveklabnik ?
2015-05-23 19:03:19 +02:00
Matej Ľach e790db7518 better describe the stdlib 2015-05-22 16:42:57 +01:00
Steven Fackler e161d5cf73 Stabilize debug builders for 1.2.0 2015-05-19 21:57:39 -07:00
bors 6403a2fc32 Auto merge of #25462 - alexcrichton:favicon-https, r=nrc
Helps prevent mixed content warnings if accessing docs over HTTPS.

Closes #25459
2015-05-16 17:41:28 +00:00
Alex Crichton 0e21beb761 libs: Move favicon URLs to HTTPS
Helps prevent mixed content warnings if accessing docs over HTTPS.

Closes #25459
2015-05-15 16:04:01 -07:00
Ivan Ukhov a8260fe752 std: fix a link 2015-05-15 14:46:51 -04:00
Steve Klabnik 8d522746f3 Rollup merge of #25414 - apasel422:patch-1, r=alexcrichton 2015-05-14 20:30:43 -04:00