Niko Matsakis
de8e0ae22c
Remove the AssocSpace
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
f1c041a54d
Patch long line.
2014-12-30 09:36:23 -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
b7c6e317b0
Make projected types select out of the trait bounds.
2014-12-30 09:36:22 -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
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
Huon Wilson
91db254c81
More rebase fixes.
2014-12-30 00:11:30 +11:00
Huon Wilson
ce3c949115
Intern BareFnTys to make sty slightly smaller.
...
This cuts the ty_bare_fn variant to 48 bytes rather than 56. There
doesn't seem to be a noticable memory usage decrease from this.
2014-12-29 23:55:24 +11:00
Huon Wilson
4f2b0f032a
Store Substs in an arena in the tcx.
...
This current inflates memory use more than 3 times.
2014-12-29 23:55:24 +11:00
bors
4a4c89c7a4
auto merge of #20119 : FlaPer87/rust/oibit-send-and-friends, r=nikomatsakis
...
More work on opt-in built in traits. `Send` and `Sync` are not opt-in, `OwnedPtr` renamed to `UniquePtr` and the `Send` and `Sync` traits are now unsafe.
NOTE: This likely needs to be rebased on top of the yet-to-land snapshot.
r? @nikomatsakis
cc #13231
2014-12-27 13:11:48 +00:00
Flavio Percoco
607f60712c
Keep track of the whole error chain
2014-12-26 17:26:33 +01:00
Flavio Percoco
fb803a8570
Require types to opt-in Sync
2014-12-26 17:26:32 +01:00
Niko Matsakis
a583ba2fa0
Remove McResult
from the mem-categorization interface.
2014-12-25 07:04:07 -05:00
Alex Crichton
de11710d80
rollup merge of #19891 : nikomatsakis/unique-fn-types-3
...
Conflicts:
src/libcore/str.rs
src/librustc_trans/trans/closure.rs
src/librustc_typeck/collect.rs
src/libstd/path/posix.rs
src/libstd/path/windows.rs
2014-12-22 12:51:23 -08:00
Niko Matsakis
2a43b352f7
Rote changes that don't care to distinguish between a fn pointer and a fn item.
2014-12-22 12:27:07 -05:00
Alex Crichton
082bfde412
Fallout of std::str stabilization
2014-12-21 23:31:42 -08:00
Jorge Aparicio
e64a0072d6
librustc: use #[deriving(Copy)]
2014-12-19 10:51:00 -05:00
Niko Matsakis
f45c0ef51e
Implement "perfect forwarding" for HR impls ( #19730 ).
2014-12-19 03:29:31 -05:00
Niko Matsakis
c2ca1a4b62
Make all predicates higher-ranked, not just trait references.
2014-12-19 03:29:30 -05:00
Niko Matsakis
1205fd88df
Centralize on using Binder
to introduce new binding levels, rather than having FnSig carry an implicit binding level. This means that we be more typesafe in general, since things that instantiate bound regions can drop the Binder to reflect that.
2014-12-19 03:29:30 -05:00
Niko Matsakis
416e62924e
Rename the code that replaces unbound variables to "freshen" rather than "skolemize" -- strictly speaking, this is not skolemization, because it is not discharging quantifiers. Also, the trait selection code will still be doing true skolemization, so it would be a confusing overlap of names.
2014-12-19 03:29:30 -05:00
Niko Matsakis
3cf0fbeee9
Create distinct types for a PolyTraitRef (with bindings) and a normal TraitRef.
2014-12-19 03:29:30 -05:00
Flavio Percoco
127dac4990
Don't make unboxed closures implicitly copiable
...
The fix just checks if the bound is `Copy` and returns an `Err` if so.
Closes : #19817
2014-12-16 11:44:10 +01:00
Niko Matsakis
092d04a40a
Rename FnStyle trait to Unsafety.
2014-12-14 11:11:55 -05:00
Niko Matsakis
d258d68db6
Remove proc
types/expressions from the parser, compiler, and
...
language. Recommend `move||` instead.
2014-12-14 04:21:56 -05:00
Niko Matsakis
97cf91aa30
Fix the opt-out-copy behavior so that values with dtor etc are considered affine
2014-12-12 20:25:21 -05:00
Niko Matsakis
9f492fefef
Switch to using predicates to drive checking. Correct various tests --
...
in most cases, just the error message changed, but in some cases we
are reporting new errors that OUGHT to have been reported before but
we're overlooked (mostly involving the `'static` bound on `Send`).
2014-12-12 20:25:21 -05:00
Niko Matsakis
4efaddf7c9
Start restructuring to support generalized where clauses etc.
2014-12-12 20:24:34 -05:00
bors
ef4982f0f8
auto merge of #19466 : nikomatsakis/rust/recursion-limit, r=eddyb
...
This is particularly important for deeply nested types, which generate deeply nested impls. This is a fix for #19318 . It's possible we could also improve this particular case not to increment the recursion count, but it's worth being able to adjust the recursion limit anyhow.
cc @jdm
r? @pcwalton
2014-12-09 14:02:45 +00:00
Niko Matsakis
34812b891d
Stop masking overflow and propagate it out more aggressively; also improve error reporting to suggest to user how to fix.
2014-12-08 15:51:38 -05:00
Niko Matsakis
3ee85d828e
Kill dead code
2014-12-08 15:51:38 -05:00
Niko Matsakis
a16f60b117
Add a feature opt opt_out_copy
that allows people to revert to the older
...
behavior temporarily. This feature will eventually transition to REJECTED.
2014-12-08 13:47:45 -05:00
Niko Matsakis
096a28607f
librustc: Make Copy
opt-in.
...
This change makes the compiler no longer infer whether types (structures
and enumerations) implement the `Copy` trait (and thus are implicitly
copyable). Rather, you must implement `Copy` yourself via `impl Copy for
MyType {}`.
A new warning has been added, `missing_copy_implementations`, to warn
you if a non-generic public type has been added that could have
implemented `Copy` but didn't.
For convenience, you may *temporarily* opt out of this behavior by using
`#![feature(opt_out_copy)]`. Note though that this feature gate will never be
accepted and will be removed by the time that 1.0 is released, so you should
transition your code away from using it.
This breaks code like:
#[deriving(Show)]
struct Point2D {
x: int,
y: int,
}
fn main() {
let mypoint = Point2D {
x: 1,
y: 1,
};
let otherpoint = mypoint;
println!("{}{}", mypoint, otherpoint);
}
Change this code to:
#[deriving(Show)]
struct Point2D {
x: int,
y: int,
}
impl Copy for Point2D {}
fn main() {
let mypoint = Point2D {
x: 1,
y: 1,
};
let otherpoint = mypoint;
println!("{}{}", mypoint, otherpoint);
}
This is the backwards-incompatible part of #13231 .
Part of RFC #3 .
[breaking-change]
2014-12-08 13:47:44 -05:00
Niko Matsakis
db75f8aa91
Move infer out of middle::typeck
and into just middle
.
2014-12-04 10:04:51 -05:00
Niko Matsakis
f2731ffb52
Adjust nits from pcwalton.
2014-12-04 01:49:42 -05:00
Niko Matsakis
39221a013f
Implement the Fn
trait for bare fn pointers in the compiler rather than doing it using hard-coded impls. This means that it works also for more complex fn types involving bound regions. Fixes #19126 .
2014-12-04 01:49:42 -05:00
Niko Matsakis
d85ff16173
Treat builtin bounds like all other kinds of trait matches. Introduce a simple hashset in the fulfillment context to catch cases where we register the exact same obligation twice. This helps prevent duplicate error reports but also handles the recursive obligations created by builtin bounds.
2014-12-02 19:05:14 -05:00
Alex Crichton
e8d743ec1d
rollup merge of #19329 : steveklabnik/doc_style_cleanup2
2014-11-26 16:51:02 -08:00
Steve Klabnik
cd5c8235c5
/*! -> //!
...
Sister pull request of https://github.com/rust-lang/rust/pull/19288 , but
for the other style of block doc comment.
2014-11-26 16:50:14 -08:00
Alex Crichton
f4a775639c
rollup merge of #19298 : nikomatsakis/unboxed-closure-parse-the-plus
...
Implements RFC 438.
Fixes #19092 .
This is a [breaking-change]: change types like `&Foo+Send` or `&'a mut Foo+'a` to `&(Foo+Send)` and `&'a mut (Foo+'a)`, respectively.
r? @brson
2014-11-26 16:49:46 -08:00
Alex Crichton
f40fa8304f
rollup merge of #19288 : steveklabnik/doc_style_cleanup
...
This is considered good convention.
This is about half of them in total, I just don't want an impossible to land patch. 😄
2014-11-26 16:49:36 -08:00
Niko Matsakis
f4e29e7e9a
Fixup various places that were doing &T+'a
and do &(T+'a)
2014-11-26 11:42:06 -05:00
Steve Klabnik
f38e4e6d97
/** -> ///
...
This is considered good convention.
2014-11-25 21:24:16 -05:00
Ricky Taylor
729bf447ab
Search for implemented kinds recursively on Trait types. Fixes #15155 and #13155 .
2014-11-23 12:24:34 +00:00
Niko Matsakis
b64c7b83dd
Refactor QPath to take an ast::TraitRef
2014-11-19 05:53:40 -05:00
Eduard Burtescu
9f7aa7fa76
rustc: middle: remove obsolete ty::get.
2014-11-19 06:24:35 +02:00
Eduard Burtescu
5bc98954d5
rustc: fix fallout of adding the 'tcx
lifetime to Ty
.
2014-11-19 06:24:34 +02:00