about summary refs log tree commit diff
path: root/src/librustc/middle/astencode.rs
AgeCommit message (Collapse)AuthorLines
2013-04-10Reason about nested free variables that appear in a functionNiko Matsakis-1/+4
signature. In a nutshell, the idea is to (1) report an error if, for a region pointer `'a T`, the lifetime `'a` is longer than any lifetimes that appear in `T` (in other words, if a borrowed pointer outlives any portion of its contents) and then (2) use this to assume that in a function like `fn(self: &'a &'b T)`, the relationship `'a <= 'b` holds. This is needed for #5656. Fixes #5728.
2013-04-09Cleanup substitutions and treatment of generics around traits in a number of ↵Niko Matsakis-18/+24
ways. - In a TraitRef, use the self type consistently to refer to the Self type: - trait ref in `impl Trait<A,B,C> for S` has a self type of `S`. - trait ref in `A:Trait` has the self type `A` - trait ref associated with a trait decl has self type `Self` - trait ref associated with a supertype has self type `Self` - trait ref in an object type `@Trait` has no self type - Rewrite `each_bound_traits_and_supertraits` to perform substitutions as it goes, and thus yield a series of trait refs that are always in the same 'namespace' as the type parameter bound given as input. Before, we left this to the caller, but this doesn't work because the caller lacks adequare information to perform the type substitutions correctly. - For provided methods, substitute the generics involved in the provided method correctly. - Introduce TypeParameterDef, which tracks the bounds declared on a type parameter and brings them together with the def_id and (in the future) other information (maybe even the parameter's name!). - Introduce Subst trait, which helps to cleanup a lot of the repetitive code involved with doing type substitution. - Introduce Repr trait, which makes debug printouts far more convenient. Fixes #4183. Needed for #5656.
2013-04-05Refactor so that references to traits are not represented using a type with aNiko Matsakis-16/+24
bare function store (which is not in fact a kind of value) but rather ty::TraitRef. Removes many uses of fail!() and other telltale signs of type-semantic mismatch. cc #4183 (not a fix, but related)
2013-04-05Rather than storing a list of ty::method per trait, store one ty::methodNiko Matsakis-0/+1
per method and list of def-ids per trait.
2013-03-30rustc: fix astencode testErick Tryzelaar-12/+1
2013-03-29Merge remote-tracking branch 'remotes/origin/incoming' into serialErick Tryzelaar-4/+4
2013-03-29Merge remote-tracking branch 'remotes/origin/incoming' into serialErick Tryzelaar-39/+0
2013-03-29librustc: Remove `fail_unless!`Patrick Walton-4/+4
2013-03-29Register snapshotsBrian Anderson-39/+0
2013-03-29Merge remote-tracking branch 'remotes/origin/incoming' into serialErick Tryzelaar-1/+1
2013-03-29std: remove Encoder::read_rec and Decoder::emit_recErick Tryzelaar-4/+4
2013-03-28Removing unused importsAlex Crichton-1/+1
2013-03-27auto merge of #5578 : erickt/rust/incoming, r=jbclements,ericktbors-0/+39
Hey folks, This patch series does some work on the json decoder, specifically with auto decoding of enums. Previously, we would take this code: ``` enum A { B, C(~str, uint) } ``` and would encode a value of this enum to either `["B", []]` or `["C", ["D", 123]]`. I've changed this to `"B"` or `["C", "D", 123]`. This matches the style of the O'Caml json library [json-wheel](http://mjambon.com/json-wheel.html). I've added tests to make sure all this work. In order to make this change, I added passing a `&[&str]` vec to `Decode::emit_enum_variant` so the json decoder can convert the name of a variant into it's position. I also changed the impl of `Encodable` for `Option<T>` to have the right upper casing. I also did some work on the parser, which allows for `fn foo<T: ::cmp::Eq>() { ... }` statements (#5572), fixed the pretty printer properly expanding `debug!("...")` expressions, and removed `ast::expr_vstore_fixed`, which doesn't appear to be used anymore.
2013-03-27Autoref the argument to the index operator (#4920)Niko Matsakis-5/+5
2013-03-27std: Decode::read_enum_variant should pass in the variant namesErick Tryzelaar-0/+39
Because the json::Decoder uses the string variant name, we need a way to correlate the string to the enum index. This passes in a static &[&str] to read_enum_variant, which allows the json::Decoder to know which branch it's trying to process.
2013-03-26rustc: Purge of HashMap, fixing segfaulting casesAlex Crichton-2/+4
Various FIXME comments added around to denote copies which when removed cause the compiler to segfault at some point before stage2. None of these copies should even be necessary.
2013-03-26rustc: Remove uses of oldmap::HashMapAlex Crichton-10/+10
2013-03-20rustc: Remove some bad copies throughoutAlex Crichton-3/+3
2013-03-14librustc: Remove another deprecated use of `as Trait`. rs=burningtreePatrick Walton-2/+2
2013-03-13librustc: Don't accept `as Trait` anymore; fix all occurrences of it.Patrick Walton-1/+1
2013-03-13Remove `++` mode from the compiler (it is parsed as `+` mode)Niko Matsakis-1/+1
and obsolete `-` mode altogether (it *was* parsed as `+` mode).
2013-03-11librustc: Replace all uses of `fn()` with `&fn()`. rs=defunPatrick Walton-2/+2
2013-03-08Finish de-implicit-selfing everything but the test suiteBen Striegel-3/+3
2013-03-08test: Removing dvec usesAlex Crichton-1/+1
2013-03-08rustc: Remove uses of DVecAlex Crichton-5/+4
2013-03-07librustc: Convert all uses of `assert` over to `fail_unless!`Patrick Walton-5/+7
2013-03-06Make object types not implement associated trait. Fixes #5087.Niko Matsakis-20/+0
2013-03-06Fix bug in coherence that causes all cross-crate impls to be regarded asNiko Matsakis-2/+3
inherent impls, not just those of the `impl Type` variety.
2013-03-05rustc: remove some copiesErick Tryzelaar-1/+1
2013-03-05auto merge of #5212 : thestinger/rust/iter, r=graydonbors-12/+13
A small step towards fixing #2827
2013-03-04Adding missing imports for tests, and gate off othersAlex Crichton-0/+5
2013-03-04Remove unused imports throughout src/Alex Crichton-9/+0
2013-03-03replace option::iter with a BaseIter implDaniel Micay-12/+13
2013-03-02librustc: Remove `fn@`, `fn~`, and `fn&` from librustc. rs=defunPatrick Walton-1/+1
2013-03-01Merge remote-tracking branch 'remotes/origin/incoming' into incomingErick Tryzelaar-3/+11
2013-03-01Merge remote branch 'nmatsakis/issue-4808-representation-of-extern-fn' into ↵Patrick Walton-3/+11
incoming
2013-03-01Merge remote-tracking branch 'remotes/origin/incoming' into incomingErick Tryzelaar-10/+2
2013-02-28Remove legacy object creation mode, and convert remaining uses of itNiko Matsakis-9/+1
2013-02-28Change bare functions so that they are represented by a single pointer.Niko Matsakis-3/+11
The basic idea is that we add a new kind of adjustment, AutoAddEnv, that pads an extern fn into a closure by adding the extra NULL word. Then there are a few misc changes in trans to get the LLVM types to match up. Fixes #4808.
2013-02-28librustc: Mark all type implementations public. rs=impl-publicityPatrick Walton-1/+1
2013-02-28Merge remote-tracking branch 'remotes/origin/incoming' into incomingErick Tryzelaar-3/+3
2013-02-27Introduce lifetime declarations into the lists of type parameters.Niko Matsakis-4/+4
Major changes are: - replace ~[ty_param] with Generics structure, which includes both OptVec<TyParam> and OptVec<Lifetime>; - the use of syntax::opt_vec to avoid allocation for empty lists; cc #4846
2013-02-27Merge remote-tracking branch 'remotes/origin/incoming' into incomingErick Tryzelaar-2/+2
2013-02-25libsyntax: progress on making syntax::visit vecs_implicitly_copyable-freeErick Tryzelaar-4/+4
2013-02-23remove oldsmallintmapDaniel Micay-2/+2
Closes #4738
2013-02-22De-implicit-self librustcBen Striegel-87/+98
2013-02-21librustc: Fix broken test.Luqman Aden-2/+2
2013-02-21Get rid of structural records in libsyntax and the last bit in librustc.Luqman Aden-3/+3
2013-02-20librustc: Separate most trait bounds with '+'. rs=plussingPatrick Walton-4/+4
2013-02-20librustc: tidyLuqman Aden-2/+4