Commit Graph

38838 Commits

Author SHA1 Message Date
Niko Matsakis
3343e9c169 Add new test for impl precedence and remove unnecessary coherence rules that prevent the test from compiling. 2015-02-22 02:14:27 +01:00
Flavio Percoco
6d1844c806 Record default implementations in a separate step 2015-02-22 02:14:27 +01:00
Niko Matsakis
3ebc2abc6a tweak exhaustive matching of ty_infer 2015-02-22 02:14:27 +01:00
Niko Matsakis
640000a7c0 fix treatment of parameters and associated types 2015-02-22 02:14:27 +01:00
Flavio Percoco
1cc5a87c08 Don't report bug for IntVar and FloatVar 2015-02-22 02:14:27 +01:00
Flavio Percoco
38ef5ee48f Check constituent types are known 2015-02-22 02:14:27 +01:00
Niko Matsakis
e8df95d77f mark candidate set ambig for defaulted traits where self-type is not yet known 2015-02-22 02:14:27 +01:00
Niko Matsakis
24bdce4bbf some comments and nits 2015-02-22 02:14:26 +01:00
Flavio Percoco
64d33d892a check supertraits 2015-02-22 02:14:26 +01:00
Niko Matsakis
f7a75e0341 Add new test case showing that supertraits are not enough 2015-02-22 02:14:26 +01:00
Flavio Percoco
7213ef1a8f Test all the things 2015-02-22 02:14:26 +01:00
Flavio Percoco
0be1e430cf Fix error codes 2015-02-22 02:14:26 +01:00
Niko Matsakis
40fffc9e3f Some nits and cleanup 2015-02-22 02:14:26 +01:00
Flavio Percoco
d215411911 Make Send/Sync go through the default implementation path 2015-02-22 02:14:26 +01:00
Flavio Percoco
1e3ed61d82 Coherence for default trait implementations
- Don't allow multiple default trait implementations
- Allow positive trait implementations just for structs and enums when
  there's a default implementation for such trait.
2015-02-22 02:14:25 +01:00
Flavio Percoco
f0e9bd9099 address nits 2015-02-22 02:14:25 +01:00
Flavio Percoco
d38aab397e Rename DefTrait to DefaultImpl 2015-02-22 02:14:25 +01:00
Flavio Percoco
7e382132a5 Make default_trait_impls private and add accessor 2015-02-22 02:14:25 +01:00
Flavio Percoco
d523acb495 Use a Vec<N> instead of VecPerParamSpace<N> 2015-02-22 02:14:25 +01:00
Flavio Percoco
4b09209efe Ensure default trait impls hold 2015-02-22 02:14:25 +01:00
Flavio Percoco
58a8103df9 Fix rustdoc fallout 2015-02-22 02:14:25 +01:00
Flavio Percoco
7ae8889286 Add negative impls for Sync 2015-02-22 02:14:24 +01:00
Flavio Percoco
bd511f73be Add negative impls for *const T and *mut T 2015-02-22 02:14:24 +01:00
Flavio Percoco
ad3e748128 Don't allow default impls for traits outside their crate 2015-02-22 02:14:24 +01:00
Flavio Percoco
839a9de8d3 Prefer other implementations over default ones 2015-02-22 02:14:24 +01:00
Flavio Percoco
a962d47ef8 look for default trait candidates 2015-02-22 02:14:24 +01:00
Flavio Percoco
4148d5361a Fix fallout from libsyntax implementation 2015-02-22 02:14:24 +01:00
Flavio Percoco
6a2f16e136 Add support for default trait impls in libsyntax 2015-02-22 02:14:24 +01:00
bors
2b01a37ec3 Auto merge of #21959 - dhuseby:bitrig-support, r=brson
This patch adds the necessary pieces to support rust on Bitrig https://bitrig.org
2015-02-21 09:20:48 +00:00
bors
522d09dfec Auto merge of #22541 - Manishearth:rollup, r=Gankro
Continued from #22520
2015-02-19 18:36:59 +00:00
Manish Goregaokar
49771bafa5 Round 8 tex fixes 2015-02-19 23:18:20 +05:30
Alex Crichton
163be7525a Merge remote-tracking branch 'origin/master' into rollup 2015-02-19 07:03:43 -08:00
Alex Crichton
0cd54b85ef Round 5 test fixes and rebase conflicts 2015-02-19 07:03:18 -08:00
bors
0b664bb843 Auto merge of #22517 - brson:relnotes, r=Gankro
p=1 please
2015-02-19 10:54:08 +00:00
bors
149f002437 Auto merge of #22497 - nikomatsakis:suffixes, r=alexcrichton
The old suffixes now issue warnings unless a feature-gate is given.

Fixes #22496.

r? @alexcrichton
2015-02-19 07:59:27 +00:00
Alex Crichton
cb29c468f3 Fix from niko for cfail tests 2015-02-18 18:01:03 -08:00
Alex Crichton
b8d35deda3 rollup merge of #22517: brson/relnotes
p=1 please
2015-02-18 17:58:01 -08:00
Alex Crichton
b7c0813eb7 Round 4 test fixes and rebase conflicts 2015-02-18 17:57:35 -08:00
Brian Anderson
c4bb064b3a Update AUTHORS.txt and RELEASES.md 2015-02-18 17:02:34 -08:00
Niko Matsakis
63f51ee90c Exempt phantom fns from the object safety check 2015-02-18 16:38:17 -08:00
Alex Crichton
d6e939a2df Round 3 test fixes and conflicts 2015-02-18 16:34:04 -08:00
bors
22992358bc Auto merge of #22436 - nikomatsakis:issue-22246-bound-lifetimes-of-assoc-types, r=nikomatsakis
Take 2. This PR includes a bunch of refactoring that was part of an experimental branch implementing [implied bounds]. That particular idea isn't ready to go yet, but the refactoring proved useful for fixing #22246. The implied bounds branch also exposed #22110 so a simple fix for that is included here. I still think some more refactoring would be a good idea here -- in particular I think most of the code in wf.rs is kind of duplicating the logic in implicator and should go, but I decided to post this PR and call it a day before diving into that. I'll write a bit more details about the solutions I adopted in the various bugs. I patched the two issues I was concerned about, which was the handling of supertraits and HRTB (the latter turned out to be fine, so I added a comment explaining why.)

r? @pnkfelix (for now, anyway)
cc @aturon 

[implied bounds]: http://smallcultfollowing.com/babysteps/blog/2014/07/06/implied-bounds/
2015-02-18 23:58:38 +00:00
Alex Crichton
1506b34e0c rollup merge of #22286: nikomatsakis/variance-4b
Conflicts:
	src/librustc/middle/infer/combine.rs
	src/librustc_typeck/check/wf.rs
2015-02-18 15:52:01 -08:00
Alex Crichton
3e7a04cb3c Round 2 test fixes and conflicts 2015-02-18 15:48:45 -08:00
Alex Crichton
231eeaa35b rollup merge of #22502: nikomatsakis/deprecate-bracket-bracket
Conflicts:
	src/libcollections/slice.rs
	src/libcollections/str.rs
	src/librustc/middle/lang_items.rs
	src/librustc_back/rpath.rs
	src/librustc_typeck/check/regionck.rs
	src/libstd/ffi/os_str.rs
	src/libsyntax/diagnostic.rs
	src/libsyntax/parse/parser.rs
	src/libsyntax/util/interner.rs
	src/test/run-pass/regions-refcell.rs
2015-02-18 15:48:40 -08:00
Alex Crichton
2cdbd288ac rollup merge of #22210: aturon/stab-final-borrow
Conflicts:
	src/libcollections/btree/map.rs
	src/libcollections/str.rs
	src/libcollections/vec.rs
	src/libcore/borrow.rs
	src/libcore/hash/mod.rs
	src/libstd/collections/hash/map.rs
	src/libstd/collections/hash/set.rs
2015-02-18 15:34:48 -08:00
Alex Crichton
365bd9a9e3 Round 1 fixes and rebase conflicts 2015-02-18 15:27:42 -08:00
Aaron Turon
a99e698628 Stabilize std::borrow
This commit stabilizes `std::borrow`, making the following modifications
to catch up the API with language changes:

* It renames `BorrowFrom` to `Borrow`, as was originally intended (but
  blocked for technical reasons), and reorders the parameters
  accordingly.

* It moves the type parameter of `ToOwned` to an associated type. This
  is somewhat less flexible, in that each borrowed type must have a
  unique owned type, but leads to a significant simplification for
  `Cow`. Flexibility can be regained by using newtyped slices, which is
  advisable for other reasons anyway.

* It removes the owned type parameter from `Cow`, making the type much
  less verbose.

* Deprecates the `is_owned` and `is_borrowed` predicates in favor of
  direct matching.

The above API changes are relatively minor; the basic functionality
remains the same, and essentially the whole module is now marked
`#[stable]`.

[breaking-change]
2015-02-18 15:23:58 -08:00
Niko Matsakis
9ea84aeed4 Replace all uses of &foo[] with &foo[..] en masse. 2015-02-18 17:36:03 -05:00
Niko Matsakis
64cd30e0ca Declare &foo[] to be obsolete syntax. Modify the obsolete mechanism to
support warnings.
2015-02-18 17:35:50 -05:00