Commit Graph

35953 Commits

Author SHA1 Message Date
Aaron Turon
6abfac083f Fallout from stabilization 2014-12-30 17:06:08 -08:00
Aaron Turon
6e1879eaf1 Adjustments from review 2014-12-30 12:02:22 -08:00
Aaron Turon
e91d810b9b Libs: Unify concat and concat_vec
We've long had traits `StrVector` and `VectorVector` providing
`concat`/`connect` and `concat_vec`/`connect_vec` respectively. The
reason for the distinction is that coherence rules did not used to be
robust enough to allow impls on e.g. `Vec<String>` versus `Vec<&[T]>`.

This commit consolidates the traits into a single `SliceConcatExt` trait
provided by `slice` and the preldue (where it replaces `StrVector`,
which is removed.)

[breaking-change]
2014-12-30 12:02:22 -08:00
Aaron Turon
4f863a338e Second pass stabilization: slice
This commit takes a second pass through the `slice` module to
stabilize its API. The changes are as follows:

**Stable**:

* `as_mut_slice`
* `as_ptr`, `as_mut_ptr`
* `binary_search_by` (was: `binary_search`)
* `binary_search` (was: `binary_search_elem`)
* `chunks`, `chunks_mut`
* `contains`
* `ends_with`
* `first`, `first_mut` (was: `head`)
* `get_unchecked`, `get_unchecked_mut` (was: `unsafe_get`)
* `get`
* `is_empty`
* `iter`, `iter_mut`
* `len`
* `reverse`
* `sort_by`
* `sort`
* `split_at`, `split_at_mut`
* `split_mut`, `splitn_mut`, `rsplitn_mut`
* `split`, `splitn`, `rsplitn`
* `starts_with`
* `swap`
* `to_vec`
* `windows`

**Deprecated**:

* `head`, `head_mut` (renamed as above)
* `unsafe_get`, `unsafe_mut` (renamed as above)
* `binary_search_elem` (renamed as above)
* `partitioned`, deprecated in favor of a new, more
  general iterator consumer called `partition`.
* `BinarySearchResult`, deprecated in favor of `Result<uint, uint>`

[breaking-change]
2014-12-30 12:02:22 -08:00
Aaron Turon
9d919d2302 Second pass stabilization: vec
This commit takes a second pass through the `vec` module to
stabilize its API. The changes are as follows:

**Stable**:

* `dedup`
* `from_raw_parts`
* `insert`
* `into_iter`
* `is_empty`
* `remove`
* `reserve_exact`
* `reserve`
* `retain`
* `swap_remove`
* `truncate`

**Deprecated**:

* `from_fn`, `from_elem`, `grow_fn` and `grow`, all deprecated in
  favor of iterators. See https://github.com/rust-lang/rfcs/pull/509

* `partition`, `partitioned`, deprecated in favor of a new, more
  general iterator consumer called `partition`.

* `unzip`, deprecated in favor of a new, more general iterator
  consumer called `unzip`.

A few remaining methods are left at experimental status.

[breaking-change]
2014-12-30 12:02:22 -08:00
Aaron Turon
8a5057af2e std::iter: Add partition and unzip methods to iterators 2014-12-30 12:02:21 -08:00
bors
84f5ad8679 auto merge of #20307 : nikomatsakis/rust/assoc-types-normalization-extend-bound, r=nrc
Rewrite associated types to use projection rather than dummy type parameters. This closes almost every (major) open issue, but I'm holding off on that until the code has landed and baked a bit. Probably it should have more tests, as well, but I wanted to get this landed as fast as possible so that we can collaborate on improving it.

The commit history is a little messy, particularly the merge commit at the end. If I get some time, I might just "reset" to the beginning and try to carve up the final state into logical pieces. Let me know if it seems hard to follow. By far the most crucial commit is "Implement associated type projection and normalization."

r? @nick29581
2014-12-30 17:51:21 +00:00
Niko Matsakis
e186accbc4 Fix rebase conflicts 2014-12-30 12:09:21 -05:00
Niko Matsakis
919975d0a5 Address nits. 2014-12-30 09:36:23 -05:00
Niko Matsakis
518ec1259a Normalize associated types in bounds too. Also, make the workaround
for lack of impl-trait-for-trait just a bit more targeted (don't
substitute err, just drop the troublesome bound for now) -- otherwise
substituting false types leads us into trouble when we normalize etc.
2014-12-30 09:36:23 -05:00
Niko Matsakis
cdd5ff842d Add a test case using associated types cross crate. Fixes #18048. 2014-12-30 09:36:23 -05:00
Niko Matsakis
208d32d192 Encode the TypeScheme for associated types 2014-12-30 09:36:23 -05:00
Niko Matsakis
de8e0ae22c Remove the AssocSpace 2014-12-30 09:36:23 -05:00
Niko Matsakis
42e645ca9a Patch more metadata decoding problems. 2014-12-30 09:36:23 -05:00
Niko Matsakis
30e8ab0182 Encode the name for associated items on a trait. Fixes #18048. 2014-12-30 09:36:23 -05:00
Niko Matsakis
c1bc150bc4 Correct licenses. 2014-12-30 09:36:23 -05:00
Niko Matsakis
7ed0e23209 Resolve merge conflicts. This changes should really be integrated back to their respective
commits but oh dear what a pain.
2014-12-30 09:36:23 -05:00
Niko Matsakis
05eb2eeb61 Adjust tests for inferenceGet more conservative about inference for now. Seems better to err on the side of being more correct rather than less. Fix a bug in typing index expressions that was exposed as a result, and add one type annotation that is not required. Delete some random tests that were relying on old behavior and don't seem to add anything anymore. 2014-12-30 09:36:23 -05:00
Niko Matsakis
c197911c60 Add a FIXME relating to these type-testing traits 2014-12-30 09:36:23 -05:00
Niko Matsakis
f1c041a54d Patch long line. 2014-12-30 09:36:23 -05:00
Niko Matsakis
00cf176a5e Add FIXMEs relating to caching of projection results 2014-12-30 09:36:22 -05:00
Niko Matsakis
97d8a668f6 Add a FIXME relating to regions and projection types 2014-12-30 09:36:22 -05:00
Niko Matsakis
d62d4953d2 Add a FIXME to patch up rustdoc 2014-12-30 09:36:22 -05:00
Niko Matsakis
58467fab0f File a FIXME relating to using where clauses, not bounds 2014-12-30 09:36:22 -05:00
Niko Matsakis
df967306e3 Add a FIXME relating to Copy<T> not being checked 2014-12-30 09:36:22 -05:00
Niko Matsakis
adca15a151 Add a FIXME relating to using ast::Name 2014-12-30 09:36:22 -05:00
Niko Matsakis
7836c72eba Patch tests and create new tests related to projection from a HRTB. 2014-12-30 09:36:22 -05:00
Niko Matsakis
3657ae13f5 Don't normalize associated types when in region binders, wait until we instantiate
them. Also fix some assertions and handling of builtin bounds.
2014-12-30 09:36:22 -05:00
Niko Matsakis
2bbd2f9cea Remove the def-id from type parameters. Having this def-id was bad for several reasons:
1. Produced more unique types than is necessary. This increases memory consumption.
2. Linking the type parameter to its definition *seems* like a good idea, but it
   encourages reliance on the bounds listing.
3. It made pretty-printing harder and in particular was causing bad error messages
   when errors occurred before the `TypeParameterDef` entries were fully stored.
2014-12-30 09:36:22 -05:00
Niko Matsakis
964a5fabb7 Update error messages in various compile-fail tests 2014-12-30 09:36:22 -05:00
Niko Matsakis
b7c6e317b0 Make projected types select out of the trait bounds. 2014-12-30 09:36:22 -05:00
Niko Matsakis
de806bc057 Teach project to project associated types out of object types. 2014-12-30 09:36:22 -05:00
Niko Matsakis
5b53b11ad9 Allow object safe traits to access associated types. 2014-12-30 09:36:21 -05:00
Niko Matsakis
becbd81aaa Integrate projection bounds to ExistentialBounds but do not use them for anything. 2014-12-30 09:36:21 -05:00
Niko Matsakis
82787c2252 Convert to use Rc<TraitRef> in object types (finally!). 2014-12-30 09:36:21 -05:00
Niko Matsakis
4404592f36 Implement associated type projection and normalization. 2014-12-30 09:36:21 -05:00
Niko Matsakis
f95bb55a1c Move the scalar types out of static data so that we can put Rc into sty. 2014-12-30 09:34:38 -05:00
Niko Matsakis
771dd54ea6 Rename Polytype to TypeScheme to differentiate type schemes (early bound) from higher-ranked things (late-bound), which also use the Poly prefix. 2014-12-30 09:32:42 -05:00
Niko Matsakis
986f654f3b Rename trait_ref field to predicate, since trait_ref is really
overly general, and the value is always *some* sort of predicate.
2014-12-30 09:32:42 -05:00
Niko Matsakis
c5edd22646 Rewrite the intrinsicck to take the parameter environment into account. Also fixes #20116. 2014-12-30 09:32:42 -05:00
Niko Matsakis
4946e1a463 Move the TypeContents-based "Sized" queries into trans, where the full
types are always known and hence the ParameterEnvironment is not
necessary. For other `Sized` queries, use the trait infrastructure
just like `Copy`.
2014-12-30 09:32:42 -05:00
Niko Matsakis
0b64e5796b Make ExprUseVisitor<..> use inherited parameter environments. 2014-12-30 09:32:42 -05:00
Niko Matsakis
c08d004545 Refactor various queries out of ty and into trans/common 2014-12-30 09:32:42 -05:00
bors
023dfb0c89 auto merge of #19941 : alexcrichton/rust/issue-19767, r=brson
This commit adds support for the compiler to distinguish between different forms
of lookup paths in the compiler itself. Issue #19767 has some background on this
topic, as well as some sample bugs which can occur if these lookup paths are not
separated.

This commits extends the existing command line flag `-L` with the same trailing
syntax as the `-l` flag. Each argument to `-L` can now have a trailing `:all`,
`:native`, `:crate`, or `:dependency`. This suffix indicates what form of lookup
path the compiler should add the argument to. The `dependency` lookup path is
used when looking up crate dependencies, the `crate` lookup path is used when
looking for immediate dependencies (`extern crate` statements), and the `native`
lookup path is used for probing for native libraries to insert into rlibs. Paths
with `all` are used for all of these purposes (the default).

The default compiler lookup path (the rustlib libdir) is by default added to all
of these paths. Additionally, the `RUST_PATH` lookup path is added to all of
these paths.

Closes #19767
2014-12-30 11:11:07 +00:00
bors
d2368c3c11 auto merge of #20320 : alexcrichton/rust/rollup, r=alexcrichton 2014-12-30 08:02:39 +00:00
Alex Crichton
470ae101d6 Test fixes and rebase conflicts 2014-12-29 23:55:49 -08:00
Alex Crichton
cb7599b83e rollup merge of #20317: brson/rust-installer-v2 2014-12-29 19:47:58 -08:00
Brian Anderson
b12dfbb491 Simplify some logic in dist.mk 2014-12-29 19:08:35 -08:00
Brian Anderson
7628806997 mk: Package mingw components in unix installer on windows
This puts stdc++ and the unwinding dll into the main package
and creates a separate rust-mingw package for everything else.
2014-12-29 17:26:05 -08:00
Brian Anderson
022d48566b mk: Make distcheck build binary tarballs on windows
These work, but aren't being built and uploaded because the bots run
'distcheck' not 'dist'.
2014-12-29 17:26:05 -08:00