summary refs log tree commit diff
path: root/src/librustc/metadata/decoder.rs
AgeCommit message (Collapse)AuthorLines
2015-02-12Pacify the merciless nrc.Niko Matsakis-3/+3
2015-02-12Update metadata to reflect that predicates/schemes/trait-defs are now severedNiko Matsakis-11/+29
2015-02-02`for x in xs.iter()` -> `for x in &xs`Jorge Aparicio-3/+3
2015-02-01More deprecating of i/u suffixes in librariesAlfie John-2/+2
2015-01-30Merge remote-tracking branch 'origin/master' into rollupAlex Crichton-0/+7
Conflicts: src/liballoc/lib.rs src/libcore/ops.rs
2015-01-30std: Stabilize FromStr and parseAlex Crichton-1/+1
This commits adds an associated type to the `FromStr` trait representing an error payload for parses which do not succeed. The previous return value, `Option<Self>` did not allow for this form of payload. After the associated type was added, the following attributes were applied: * `FromStr` is now stable * `FromStr::Err` is now stable * `FromStr::from_str` is now stable * `StrExt::parse` is now stable * `FromStr for bool` is now stable * `FromStr for $float` is now stable * `FromStr for $integral` is now stable * Errors returned from stable `FromStr` implementations are stable * Errors implement `Display` and `Error` (both impl blocks being `#[stable]`) Closes #15138
2015-01-30Use `#[rustc_paren_sugar]` as a more extensible way of deciding whenNiko Matsakis-0/+7
paren sugar is legal.
2015-01-29Auto merge of #21677 - japaric:no-range, r=alexcrichtonbors-1/+1
Note: Do not merge until we get a newer snapshot that includes #21374 There was some type inference fallout (see 4th commit) because type inference with `a..b` is not as good as with `range(a, b)` (see #21672). r? @alexcrichton
2015-01-29s/Show/Debug/gJorge Aparicio-1/+1
2015-01-28Rename found_ast to FoundAst and qualify uses.Ms2ger-5/+5
This matches contemporary Rust style.
2015-01-26Fallout of io => old_ioAlex Crichton-5/+5
2015-01-19remove unnecessary parentheses from range notationJorge Aparicio-1/+1
2015-01-16Record negative trait_impls separatedlyFlavio Percoco-0/+23
2015-01-13Return the Vec from decoder::get_item_attrs.Ms2ger-6/+4
Using a closure unnecessarily obfuscates the code.
2015-01-07rollup merge of #20721: japaric/snapAlex Crichton-3/+3
Conflicts: src/libcollections/vec.rs src/libcore/fmt/mod.rs src/librustc/lint/builtin.rs src/librustc/session/config.rs src/librustc_trans/trans/base.rs src/librustc_trans/trans/context.rs src/librustc_trans/trans/type_.rs src/librustc_typeck/check/_match.rs src/librustdoc/html/format.rs src/libsyntax/std_inject.rs src/libsyntax/util/interner.rs src/test/compile-fail/mut-pattern-mismatched.rs
2015-01-07use slicing sugarJorge Aparicio-3/+3
2015-01-07std: Stabilize the std::hash moduleAlex Crichton-3/+2
This commit aims to prepare the `std::hash` module for alpha by formalizing its current interface whileholding off on adding `#[stable]` to the new APIs. The current usage with the `HashMap` and `HashSet` types is also reconciled by separating out composable parts of the design. The primary goal of this slight redesign is to separate the concepts of a hasher's state from a hashing algorithm itself. The primary change of this commit is to separate the `Hasher` trait into a `Hasher` and a `HashState` trait. Conceptually the old `Hasher` trait was actually just a factory for various states, but hashing had very little control over how these states were used. Additionally the old `Hasher` trait was actually fairly unrelated to hashing. This commit redesigns the existing `Hasher` trait to match what the notion of a `Hasher` normally implies with the following definition: trait Hasher { type Output; fn reset(&mut self); fn finish(&self) -> Output; } This `Hasher` trait emphasizes that hashing algorithms may produce outputs other than a `u64`, so the output type is made generic. Other than that, however, very little is assumed about a particular hasher. It is left up to implementors to provide specific methods or trait implementations to feed data into a hasher. The corresponding `Hash` trait becomes: trait Hash<H: Hasher> { fn hash(&self, &mut H); } The old default of `SipState` was removed from this trait as it's not something that we're willing to stabilize until the end of time, but the type parameter is always required to implement `Hasher`. Note that the type parameter `H` remains on the trait to enable multidispatch for specialization of hashing for particular hashers. Note that `Writer` is not mentioned in either of `Hash` or `Hasher`, it is simply used as part `derive` and the implementations for all primitive types. With these definitions, the old `Hasher` trait is realized as a new `HashState` trait in the `collections::hash_state` module as an unstable addition for now. The current definition looks like: trait HashState { type Hasher: Hasher; fn hasher(&self) -> Hasher; } The purpose of this trait is to emphasize that the one piece of functionality for implementors is that new instances of `Hasher` can be created. This conceptually represents the two keys from which more instances of a `SipHasher` can be created, and a `HashState` is what's stored in a `HashMap`, not a `Hasher`. Implementors of custom hash algorithms should implement the `Hasher` trait, and only hash algorithms intended for use in hash maps need to implement or worry about the `HashState` trait. The entire module and `HashState` infrastructure remains `#[unstable]` due to it being recently redesigned, but some other stability decision made for the `std::hash` module are: * The `Writer` trait remains `#[experimental]` as it's intended to be replaced with an `io::Writer` (more details soon). * The top-level `hash` function is `#[unstable]` as it is intended to be generic over the hashing algorithm instead of hardwired to `SipHasher` * The inner `sip` module is now private as its one export, `SipHasher` is reexported in the `hash` module. And finally, a few changes were made to the default parameters on `HashMap`. * The `RandomSipHasher` default type parameter was renamed to `RandomState`. This renaming emphasizes that it is not a hasher, but rather just state to generate hashers. It also moves away from the name "sip" as it may not always be implemented as `SipHasher`. This type lives in the `std::collections::hash_map` module as `#[unstable]` * The associated `Hasher` type of `RandomState` is creatively called... `Hasher`! This concrete structure lives next to `RandomState` as an implemenation of the "default hashing algorithm" used for a `HashMap`. Under the hood this is currently implemented as `SipHasher`, but it draws an explicit interface for now and allows us to modify the implementation over time if necessary. There are many breaking changes outlined above, and as a result this commit is a: [breaking-change]
2015-01-06Register new snapshotsAlex Crichton-2/+2
Conflicts: src/librbml/lib.rs src/libserialize/json_stage0.rs src/libserialize/serialize_stage0.rs src/libsyntax/ast.rs src/libsyntax/ext/deriving/generic/mod.rs src/libsyntax/parse/token.rs
2015-01-07Replace full slice notation with index callsNick Cameron-3/+3
2015-01-05rollup merge of #20482: kmcallister/macro-reformAlex Crichton-7/+8
Conflicts: src/libflate/lib.rs src/libstd/lib.rs src/libstd/macros.rs src/libsyntax/feature_gate.rs src/libsyntax/parse/parser.rs src/libsyntax/show_span.rs src/test/auxiliary/macro_crate_test.rs src/test/compile-fail/lint-stability.rs src/test/run-pass/intrinsics-math.rs src/test/run-pass/tcp-connect-timeouts.rs
2015-01-05DecodeInlinedItem: convert to "unboxed" closuresJorge Aparicio-9/+9
2015-01-05Reformat metadata for exported macrosKeegan McAllister-7/+8
Instead of copy-pasting the whole macro_rules! item from the original .rs file, we serialize a separate name, attributes list, and body, the latter as pretty-printed TTs. The compilation of macro_rules! macros is decoupled somewhat from the expansion of macros in item position. This filters out comments, and facilitates selective imports.
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-3/+3
2015-01-03sed -i -s 's/\bmod,/self,/g' **/*.rsJorge Aparicio-1/+1
2015-01-02rollup merge of #20416: nikomatsakis/coherenceAlex Crichton-3/+9
Conflicts: src/test/run-pass/issue-15734.rs src/test/run-pass/issue-3743.rs
2015-01-02rollup merge of #20385: nick29581/x-objectAlex Crichton-3/+3
Closes #19056
2015-01-02std: Stabilize the prelude moduleAlex Crichton-1/+3
This commit is an implementation of [RFC 503][rfc] which is a stabilization story for the prelude. Most of the RFC was directly applied, removing reexports. Some reexports are kept around, however: * `range` remains until range syntax has landed to reduce churn. * `Path` and `GenericPath` remain until path reform lands. This is done to prevent many imports of `GenericPath` which will soon be removed. * All `io` traits remain until I/O reform lands so imports can be rewritten all at once to `std::io::prelude::*`. This is a breaking change because many prelude reexports have been removed, and the RFC can be consulted for the exact list of removed reexports, as well as to find the locations of where to import them. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0503-prelude-stabilization.md [breaking-change] Closes #20068
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.
2014-12-31rustc: replace `GetCrateDataCb` alias with an unboxed closureJorge Aparicio-16/+17
2015-01-01Fix a bug with cross-crate trait implsNick Cameron-3/+3
Closes #19056
2014-12-30Patch more metadata decoding problems.Niko Matsakis-5/+6
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-30Convert to use `Rc<TraitRef>` in object types (finally!).Niko Matsakis-5/+5
2014-12-30Implement associated type projection and normalization.Niko Matsakis-1/+14
2014-12-30Rename `Polytype` to `TypeScheme` to differentiate type schemes (early ↵Niko Matsakis-2/+2
bound) from higher-ranked things (late-bound), which also use the `Poly` prefix.
2014-12-29Switch Region information from uint to u32.Huon Wilson-1/+1
This reduces memory use for building librustc with -O from 1.88 to 1.76 GB.
2014-12-27save-analysis: emit names of items that a glob import actually imports.Nick Cameron-0/+8
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-22rollup merge of #19891: nikomatsakis/unique-fn-types-3Alex Crichton-1/+1
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-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-3/+3
2014-12-20rustc: middle: move TraitItemKind from resolve to def.Eduard Burtescu-4/+3
2014-12-19librustc: use `#[deriving(Copy)]`Jorge Aparicio-3/+1
2014-12-19Implement "perfect forwarding" for HR impls (#19730).Niko Matsakis-2/+2
2014-12-19Centralize on using `Binder` to introduce new binding levels, rather than ↵Niko Matsakis-2/+2
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-2/+2
2014-12-14Parse `unsafe impl` but don't do anything particularly interesting with the ↵Niko Matsakis-4/+10
results.
2014-12-14Parse `unsafe trait` but do not do anything with it beyond parsing and ↵Niko Matsakis-0/+5
integrating into rustdoc etc.
2014-12-13librustc: use unboxed closuresJorge Aparicio-30/+43
2014-12-13librustc: fix falloutJorge Aparicio-1/+3
2014-12-12Switch to using predicates to drive checking. Correct various tests --Niko Matsakis-2/+14
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`).