Commit Graph

43652 Commits

Author SHA1 Message Date
bors
9cc0b22475 Auto merge of #26192 - alexcrichton:features-clean, r=aturon
This commit shards the all-encompassing `core`, `std_misc`, `collections`, and `alloc` features into finer-grained components that are much more easily opted into and tracked. This reflects the effort to push forward current unstable APIs to either stabilization or removal. Keeping track of unstable features on a much more fine-grained basis will enable the library subteam to quickly analyze a feature and help prioritize internally about what APIs should be stabilized.

A few assorted APIs were deprecated along the way, but otherwise this change is just changing the feature name associated with each API. Soon we will have a dashboard for keeping track of all the unstable APIs in the standard library, and I'll also start making issues for each unstable API after performing a first-pass for stabilization.
2015-06-18 19:14:52 +00:00
Alex Crichton
ec333380e0 Fix libstd tests 2015-06-18 10:51:31 -07:00
bors
f451812763 Auto merge of #26385 - nham:fix_25396, r=alexcrichton
Currently in the E0252 message, traits and modules are all called types (as in "a type named `Foo` has already been imported", even when `Foo` was a trait or module). This commit changes that to additionally detect when the import in question is a trait or module and report it accordingly.

Fixes #25396.
2015-06-18 16:17:04 +00:00
bors
7a13b93b00 Auto merge of #26392 - oli-obk:unused_functions, r=dotdash
These aren't used anywhere and to my current knowledge it's unlikely that they are going to be used in the future
2015-06-18 12:06:25 +00:00
Oliver Schneider
59638d15c1 remove unused functions from trans and llvm 2015-06-18 13:23:41 +02:00
bors
1ef14d9411 Auto merge of #26358 - nham:fix_24081, r=alexcrichton
Previously, it said "import `Foo` conflicts with existing submodule" even
when it was a type alias, enum, or trait. The message now says the conflict
is with "type in this module" in the case of the first two, and "trait in
this module" for the last one.

Fixes #24081.
2015-06-18 10:30:46 +00:00
bors
941af7be24 Auto merge of #26389 - Manishearth:rollup, r=Manishearth
- Successful merges: #26314, #26342, #26348, #26349, #26369, #26387
- Failed merges:
2015-06-18 08:54:35 +00:00
Manish Goregaokar
2424800453 Rollup merge of #26387 - frewsxcv:regression-tests-25180, r=eddyb
Closes #25180
2015-06-18 13:38:10 +05:30
Manish Goregaokar
81024d9931 Rollup merge of #26369 - IvanUkhov:collections, r=eddyb 2015-06-18 13:38:10 +05:30
Manish Goregaokar
3afc385ae1 Rollup merge of #26349 - petrochenkov:bitwise, r=steveklabnik
I'm surprised that bitwise operators `&`, `|` and `^` are implemented for `bool` arguments, because inspection of boolean's bits is not something that should be encouraged and because `&&` -> `&` is a common typo, but if they are implemented, then their behavior should be documented.
2015-06-18 13:38:10 +05:30
Manish Goregaokar
b5f2b098d7 Rollup merge of #26348 - eefriedman:unused-interiorsafety, r=luqmana 2015-06-18 13:38:09 +05:30
Manish Goregaokar
39e4d03e35 Rollup merge of #26342 - steveklabnik:quix_reference_fix, r=alexcrichton
https://github.com/rust-lang/rust/pull/26323/files#r32503568
2015-06-18 13:38:09 +05:30
Manish Goregaokar
b780bc513c Rollup merge of #26314 - steveklabnik:gh26312, r=bluss
Fixes #26312
2015-06-18 13:38:09 +05:30
bors
b20728c0de Auto merge of #26364 - frewsxcv:regression-tests-22864, r=bluss
Fixes https://github.com/rust-lang/rust/issues/22864
2015-06-18 07:19:32 +00:00
bors
a19ed8ad15 Auto merge of #26340 - bluss:bench-sigfix, r=alexcrichton
test: Fix a bug in bench result formatting

It would skip the middle part if it was 0, displaying a number a 1000
times too small. The MB/s number next to it gave it away.

Fixed it looks like this:

```
test h ... bench:   1,000,129 ns/iter (+/- 4,730)
```
2015-06-18 04:52:28 +00:00
bors
1d33318018 Auto merge of #26336 - dotdash:raw_ptr_coercions, r=nrc
Unlike coercing from reference to unsafe pointer, coercing between two
unsafe pointers doesn't need an AutoDerefRef, because there is no region
that regionck would need to know about.

In unoptimized libcore, this reduces the number of "auto_deref" allocas
from 174 to 4.
2015-06-18 03:16:40 +00:00
Corey Farwell
fba9cecab7 Add regression test for #25180
Closes #25180
2015-06-17 19:37:27 -07:00
Nick Hamann
b637f6b1bd Fix the E0252 error message to use better names for things.
Currently in the E0252 message, traits and modules are all called types
(as in "a type named `Foo` has already been imported", even when `Foo` was
a trait or module). This commit changes that to additionally detect when
the import in question is a trait or module and report it accordingly.

Fixes #25396.
2015-06-17 19:41:55 -05:00
bors
20d23d8e57 Auto merge of #26347 - nagisa:macro-exp, r=nrc
r? @nrc, because breakage was caused by https://github.com/rust-lang/rust/pull/25318
2015-06-18 00:26:23 +00:00
bors
713d9176ad Auto merge of #26326 - nikomatsakis:optimize-fulfillment-cache-in-tcx, r=pcwalton
When we successfully resolve a trait reference with no type/lifetime parameters, like `i32: Foo` or `Box<u32>: Sized`, this is in fact globally true. This patch adds a simple global to the tcx to cache such cases. The main advantage of this is really about caching things like `Box<Vec<Foo>>: Sized`. It also points to the need to revamp our caching infrastructure -- the current caches make selection cost cheaper, but we still wind up paying a high cost in the confirmation process, and in particular unrolling out dependent obligations. Moreover, we should probably do caching more uniformly and with a key that takes the where-clauses into account. But that's for later.

For me, this shows up as a reasonably nice win (20%) on Servo's script crate (when built in dev mode). This is not as big as my initial measurements suggested, I think because I was building my rustc with more debugging enabled at the time. I've not yet done follow-up profiling and so forth to see where the new hot spots are. Bootstrap times seem to be largely unaffected.

cc @pcwalton 

This is technically a [breaking-change] in that functions with unsatisfiable where-clauses may now yield errors where before they may have been accepted. Even before, these functions could never have been *called* by actual code. In the future, such functions will probably become illegal altogether, but in this commit they are still accepted, so long as they do not rely on the unsatisfiable where-clauses. As before, the functions still cannot be called in any case.
2015-06-17 22:50:17 +00:00
bors
8af39cebc5 Auto merge of #26321 - srwalter:remove-i386-textrel, r=alexcrichton
This prevents a relocation in the text section.  Text relocations are
incompatible with hardened kernels.

https://github.com/rust-lang/rust/issues/5714
2015-06-17 20:04:19 +00:00
bors
37cc79f81c Auto merge of #26315 - steveklabnik:gh26287, r=alexcrichton
The font can make this hard to read, and we don't even strictly need
the annotation, so let's just remove it

Fixes #26287
2015-06-17 18:09:10 +00:00
bors
6065bed37b Auto merge of #26062 - eefriedman:cleanup-cached, r=nikomatsakis
Using the wrong landing pad has obvious bad effects, like dropping a value
twice.

Testcase written by Alex Crichton.

Fixes #25089.
2015-06-17 16:14:30 +00:00
Alex Crichton
913c2273eb Add comment about stabilizing CString::from_ptr
This naming needs to consider the raw vs ptr naming of
Box/CStr/CString/slice/etc.
2015-06-17 09:07:17 -07:00
Alex Crichton
c9b40a30c0 std: Stabilize vec_map::Entry::or_insert{,_with}
These functions mirror the other Entry APIs of other maps, and were mistakenly
just not stabilized the first time around.
2015-06-17 09:07:17 -07:00
Alex Crichton
edf933538b std: Hide some internal functions more aggressively
* Add `#[doc(hidden)]`
* Rename away from `Error::description`
2015-06-17 09:07:17 -07:00
Alex Crichton
252ef28593 std: Update stable since for core::char
Also add `#[doc(hidden)]` to a few internal functions.
2015-06-17 09:07:17 -07:00
Alex Crichton
b4a2823cd6 More test fixes and fallout of stability changes 2015-06-17 09:07:17 -07:00
Alex Crichton
aa931e9c6f std: Move free-functions to associated functions
This commit moves the free functions in the `rc`, `arc`, and `boxed` modules to
associated functions on their respective types, following the recent trend
towards this pattern. The previous free functions are all left in-place with
`#[deprecated]` pointers towards the new locations.

This commit also deprecates `arc::get_mut` and `Arc::make_unique` with no
replacement as they are racy in the face of weak pointers.
2015-06-17 09:07:17 -07:00
Alex Crichton
3346fb0442 std: Deprecate the thunk module
This has been replaced with `FnBox`
2015-06-17 09:07:17 -07:00
Alex Crichton
d645f8fc28 std: Deprecate the scoped feature
The `thread::scoped` function will never be stabilized as-is and the API will
likely change significantly if it does, so this function is deprecated for
removal.
2015-06-17 09:07:17 -07:00
Alex Crichton
04f7eba909 std: Deprecate the future feature
This commit deprecates the `sync::Future` type to be developed outside in
crates.io instead.
2015-06-17 09:07:17 -07:00
Alex Crichton
96cce02924 std: Deprecate the exit_status feature
These two functions should be replaceable with the `process::exit` function.
2015-06-17 09:07:17 -07:00
Alex Crichton
0d818b4ee4 std: Deprecate the io::BufStream type
Questions about the utility of this type has caused it to move to crates.io in
the `bufstream` crate, so this type can be deprecated.
2015-06-17 09:07:16 -07:00
Alex Crichton
2d389c125e std: Stabilize the str_matches feature
This commit stabilizes the `str::{matches, rmatches}` functions and iterators,
but renames the unstable feature for the `str::{matches,rmatches}_indices`
function to `str_match_indices` due to the comment present on the functions
about the iterator's return value.
2015-06-17 09:07:16 -07:00
Alex Crichton
17a1059d83 std: Stabilize the iter_{once,empty} features
This commit stabilizes these two iterator primitives as they have gone through
the RFC process and had some time to bake now.
2015-06-17 09:07:16 -07:00
Alex Crichton
f3580879b9 std: Stabilize the once_new feature
This function follows the well-established "constructor" pattern and the
initialization constant will likely be deprecated in favor of it once `const_fn`
is stabilized.
2015-06-17 09:07:16 -07:00
Alex Crichton
c032d6fd39 std: Stabilize the sync_poison feature
These accessor/constructor methods for a `PoisonError` are quite standard for a
wrapper type and enable manipulation of the underlying type.
2015-06-17 09:07:16 -07:00
Alex Crichton
68b628b165 std: Deprecate Vec::from_raw_buf
This function is more naturally expressed as slice::from_raw_buf plus a call to
to_vec.
2015-06-17 09:07:16 -07:00
Alex Crichton
f85c4f62d8 std: Deprecate all permutation-related slice methods
These methods have been unstable for quite some time, and it's not clear that
these should remain in the standard library.
2015-06-17 09:07:16 -07:00
Alex Crichton
cdb69e2747 std: Stabilize the remaining wrapping_* functions
This commit stabilizes the remaining `wrapping_*` functions on the primitive
integer types as they follow the same conventions as other wrapping methods are
were likely just initially unstable to be conservative.
2015-06-17 09:07:16 -07:00
Alex Crichton
8797c9ec6e std: Deprecate f{32,64}::consts::PI_2
These constants have been unstable for some time now already
2015-06-17 09:07:16 -07:00
Alex Crichton
a05ed9936d std: Remove two internal str_internals functions
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-17 09:07:16 -07:00
Alex Crichton
f55c366a8a std: Deprecate the IntSliceExt trait
This trait has seen very little usage and while safe, may not belong in the
standard library.
2015-06-17 09:07:16 -07:00
Alex Crichton
c72e01ef7f std: Deprecate result::fold
This function has seen very little use and it seems better to explore this
functionality through iterator adaptors instead of specialized functions.
2015-06-17 09:07:16 -07:00
Alex Crichton
153de4c5d9 std: Deprecate the copy_{,mut_}lifetime functions
Unsafe patterns such as `slice::from_raw_parts` and `CStr::from_ptr` have shown
that dealing with lifetimes, while useful, is often a hindrance. Consequently
these functions are rarely called today and are being deprecated.
2015-06-17 09:07:16 -07:00
Alex Crichton
669d1cd9e2 std: Deprecate iter::{Unfold, Iterate}
Neither of these iterators has seen enough usage to justify their position in
the standard library, so these unstable iterators are being slated for deletion.
2015-06-17 09:07:16 -07:00
Alex Crichton
02a8d5b570 std: Deprecate the RandomAccessIterator trait
This trait has not proven itself over time as being core and fundamentally
useful to iterators, so it's being deprecated to allow time to iterate on it out
of tree.
2015-06-17 09:07:16 -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