about summary refs log tree commit diff
path: root/src/librustc/metadata
AgeCommit message (Collapse)AuthorLines
2015-01-02Fix an infinite loop in the stability check that was the result ofNiko Matsakis-3/+9
various bugs in `trait_id_of_impl`. The end result was that looking up the "trait_id_of_impl" with a trait's def-id yielded the same trait again, even though it ought to have yielded None.
2015-01-01auto merge of #20363 : japaric/rust/moar-uc, r=nmatsakisbors-25/+22
The the last argument of the `ItemDecorator::expand` method has changed to `Box<FnMut>`. Syntax extensions will break. [breaking-change] --- This PR removes pretty much all the remaining uses of boxed closures from the libraries. There are still boxed closures under the `test` directory, but I think those should be removed or replaced with unboxed closures at the same time we remove boxed closures from the language. In a few places I had to do some contortions (see the first commit for an example) to work around issue #19596. I have marked those workarounds with FIXMEs. In the future when `&mut F where F: FnMut` implements the `FnMut` trait, we should be able to remove those workarounds. I've take care to avoid placing the workaround functions in the public API. Since `let f = || {}` always gets type checked as a boxed closure, I have explictly annotated those closures (with e.g. `|&:| {}`) to force the compiler to type check them as unboxed closures. Instead of removing the type aliases (like `GetCrateDataCb`), I could have replaced them with newtypes. But this seemed like overcomplicating things for little to no gain. I think we should be able to remove the boxed closures from the languge after this PR lands. (I'm being optimistic here) r? @alexcrichton or @aturon cc @nikomatsakis
2014-12-31rustc: replace `pick` alias with an unboxed closureJorge Aparicio-5/+1
2014-12-31rustc: replace `GetCrateDataCb` alias with an unboxed closureJorge Aparicio-18/+19
2014-12-31rustc: unbox closures used in let bindingsJorge Aparicio-2/+2
2015-01-01Fix a bug with cross-crate trait implsNick Cameron-8/+7
Closes #19056
2015-01-01auto merge of #20374 : nikomatsakis/rust/assoc-types, r=nikomatsakisbors-0/+1
These mostly derive from problems that @japaric encountered. r? @pcwalton
2014-12-31Incorporate fix from japaric for cross-crate ICENiko Matsakis-0/+1
2014-12-30Fallout from stabilizationAaron Turon-1/+1
2014-12-30auto merge of #20307 : ↵bors-80/+167
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-30Encode the TypeScheme for associated typesNiko Matsakis-0/+3
2014-12-30Patch more metadata decoding problems.Niko Matsakis-6/+8
2014-12-30Encode the name for associated items on a trait. Fixes #18048.Niko Matsakis-0/+2
2014-12-30Adjust tests for inferenceGet more conservative about inference for now. ↵Niko Matsakis-1/+1
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-30Remove the def-id from type parameters. Having this def-id was bad for ↵Niko Matsakis-6/+6
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-30Integrate projection bounds to `ExistentialBounds` but do not use them for ↵Niko Matsakis-10/+23
anything.
2014-12-30Convert to use `Rc<TraitRef>` in object types (finally!).Niko Matsakis-14/+14
2014-12-30Implement associated type projection and normalization.Niko Matsakis-13/+79
2014-12-30Move the scalar types out of static data so that we can put `Rc` into sty.Niko Matsakis-31/+32
2014-12-30Rename `Polytype` to `TypeScheme` to differentiate type schemes (early ↵Niko Matsakis-6/+6
bound) from higher-ranked things (late-bound), which also use the `Poly` prefix.
2014-12-30auto merge of #19941 : alexcrichton/rust/issue-19767, r=brsonbors-15/+21
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-29rollup merge of #20194: nick29581/dst-syntaxAlex Crichton-1/+1
Part of #19607. r? @nikomatsakis
2014-12-30More rebase fixes.Huon Wilson-7/+7
2014-12-29Intern Region in tcx.Huon Wilson-2/+3
This makes sty only 32 bytes on machines with 64-bit pointers.
2014-12-29Intern BareFnTys to make sty slightly smaller.Huon Wilson-2/+4
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-29Switch Region information from uint to u32.Huon Wilson-7/+14
This reduces memory use for building librustc with -O from 1.88 to 1.76 GB.
2014-12-29Store Substs in an arena in the tcx.Huon Wilson-7/+7
This current inflates memory use more than 3 times.
2014-12-27save-analysis: emit names of items that a glob import actually imports.Nick Cameron-0/+15
There is also some work here to make resolve a bit more stable - it no longer overwrites a specific import with a glob import. [breaking-change] Import shadowing of single/list imports by globs is now forbidden. An interesting case is where a glob import imports a re-export (`pub use`) of a single import. This still counts as a single import for the purposes of shadowing .You can usually fix any bustage by re-ordering such imports. A single import may still shadow (override) a glob import or the prelude.
2014-12-26Accept `?Sized` as well as `Sized?`Nick Cameron-1/+1
Includes a bit of refactoring to store `?` unbounds as bounds with a modifier, rather than in their own world, in the AST at least.
2014-12-23rustc: Add knowledge of separate lookup pathsAlex Crichton-15/+21
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-22rollup merge of #19891: nikomatsakis/unique-fn-types-3Alex Crichton-3/+12
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-22Adjust metadata for new fields and enum variants. Yawn.Niko Matsakis-2/+11
2014-12-22Rote changes that don't care to distinguish between a fn pointer and a fn item.Niko Matsakis-1/+1
2014-12-21Fallout of std::str stabilizationAlex Crichton-92/+92
2014-12-21rollup merge of #20081: tomjakubowski/issue-19646Alex Crichton-0/+6
Encode foreign item attributes and stability levels and visit foreign items in the stability visitor. cc @Gankro
2014-12-21rollup merge of #19926: eddyb/less-styAlex Crichton-100/+97
r? @nikomatsakis
2014-12-21Remove a ton of public reexportsCorey Farwell-2/+2
Remove most of the public reexports mentioned in #19253 These are all leftovers from the enum namespacing transition In particular: * src/libstd/num/strconv.rs * ExponentFormat * SignificantDigits * SignFormat * src/libstd/path/windows.rs * PathPrefix * src/libstd/sys/windows/timer.rs * Req * src/libcollections/str.rs * MaybeOwned * src/libstd/collections/hash/map.rs * Entry * src/libstd/collections/hash/table.rs * BucketState * src/libstd/dynamic_lib.rs * Rtld * src/libstd/io/net/ip.rs * IpAddr * src/libstd/os.rs * MemoryMapKind * MapOption * MapError * src/libstd/sys/common/net.rs * SocketStatus * InAddr * src/libstd/sys/unix/timer.rs * Req [breaking-change]
2014-12-20Visit + encode stability for foreign itemsTom Jakubowski-0/+4
Fix #19649
2014-12-20metadata: Encode attrs for foreign items.Tom Jakubowski-0/+2
Related to #19649 and #16289
2014-12-20rustc: middle: move TraitItemKind from resolve to def.Eduard Burtescu-6/+4
2014-12-20rustc: middle: move Export and ExportMap from resolve to def.Eduard Burtescu-7/+7
2014-12-20rustc: middle: use cheaper Name in resolve::Export instead of String.Eduard Burtescu-6/+4
2014-12-20middle: resolve: fix inconsistencies around ExportMap and remove the 2 suffix.Eduard Burtescu-9/+9
2014-12-20rustc: use Ty instead of passing ty::sty around.Eduard Burtescu-100/+97
2014-12-19librustc: use `#[deriving(Copy)]`Jorge Aparicio-17/+7
2014-12-19Implement "perfect forwarding" for HR impls (#19730).Niko Matsakis-3/+3
2014-12-19Make all predicates higher-ranked, not just trait references.Niko Matsakis-11/+11
2014-12-19Centralize on using `Binder` to introduce new binding levels, rather than ↵Niko Matsakis-16/+16
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-19Create distinct types for a PolyTraitRef (with bindings) and a normal TraitRef.Niko Matsakis-10/+12
2014-12-18librustc: Always parse `macro!()`/`macro![]` as expressions if notPatrick Walton-1/+1
followed by a semicolon. This allows code like `vec![1i, 2, 3].len();` to work. This breaks code that uses macros as statements without putting semicolons after them, such as: fn main() { ... assert!(a == b) assert!(c == d) println(...); } It also breaks code that uses macros as items without semicolons: local_data_key!(foo) fn main() { println("hello world") } Add semicolons to fix this code. Those two examples can be fixed as follows: fn main() { ... assert!(a == b); assert!(c == d); println(...); } local_data_key!(foo); fn main() { println("hello world") } RFC #378. Closes #18635. [breaking-change]