Commit Graph

43664 Commits

Author SHA1 Message Date
Eduard Burtescu
a3727559c6 rustc: use the TLS type context in Repr and UserString. 2015-06-19 01:32:44 +03:00
Eduard Burtescu
1f70a2e370 rustc: allow "lifting" T<'a> to T<'tcx> if the value is part of ty::ctxt<'tcx>. 2015-06-19 01:18:43 +03:00
Eduard Burtescu
d8952e7932 rustc: store the type context in TLS and allow safe access to it. 2015-06-19 01:18:43 +03:00
Eduard Burtescu
6061707348 rustc: leave only one free top-level function in ppaux, and private. 2015-06-19 01:18:43 +03:00
Eduard Burtescu
96ad4a4863 rustc: use Repr and UserString instead of ppaux::ty_to_string. 2015-06-19 01:18:43 +03:00
Eduard Burtescu
4e0cb86a5c rustc: reduce ppaux's public footprint to 5 functions. 2015-06-19 01:18:42 +03:00
Eduard Burtescu
bc383f6294 rustc: enforce stack discipline on ty::ctxt. 2015-06-19 01:18:42 +03:00
Eduard Burtescu
84b49b2d35 rustc_resolve: don't require redundant arguments to resolve_crate. 2015-06-19 01:18:42 +03:00
Eduard Burtescu
2e997ef2d4 rustc: remove ownership of tcx from trans' context. 2015-06-19 01:18:42 +03:00
bors
ff8fee180b Auto merge of #26147 - arielb1:assoc-trans, r=nikomatsakis
Fixes #25700

r? @nikomatsakis
2015-06-18 21:34:04 +00:00
Ariel Ben-Yehuda
21fd312043 Normalize associated types in closure signatures
Fixes #25700.
2015-06-18 23:04:57 +03:00
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
Ariel Ben-Yehuda
56d765d0eb Simplify and type_known_to_meet_builtin_bound and make it more correct when
associated types are involved.
2015-06-18 20:51:43 +03: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