about summary refs log tree commit diff
path: root/src/librustc_metadata/tydecode.rs
AgeCommit message (Collapse)AuthorLines
2016-09-20rustc_metadata: remove ty{en,de}code and move to auto-derived serialization.Eduard Burtescu-598/+0
2016-09-20rustc_metadata: side-step ty{en,de}code for everything but Ty.Eduard Burtescu-158/+6
2016-09-20Remove librbml and the RBML-tagged auto-encoder/decoder.Eduard Burtescu-1/+1
2016-09-20rustc_metadata: go only through rustc_serialize in astencode.Eduard Burtescu-12/+12
2016-09-08Refactor `TyStruct`/`TyEnum`/`TyUnion` into `TyAdt`Vadim Petrochenkov-17/+1
2016-09-03Fix type encoding/decoding for unionsVadim Petrochenkov-0/+8
Fix union debuginfo test on lldb
2016-08-27rustc: use Vec<Kind> in Substs, where Kind is a &TyS | &Region tagged pointer.Eduard Burtescu-9/+9
2016-08-27rustc: pass ty::Region behind an interned 'tcx reference.Eduard Burtescu-8/+6
2016-08-17rustc: remove ParamSpace from Substs.Eduard Burtescu-37/+16
2016-08-17rustc: split Generics of a method from its parent Generics.Eduard Burtescu-2/+22
2016-08-17rustc: remove SelfSpace from ParamSpace.Eduard Burtescu-3/+3
2016-08-17rustc: reduce Substs and Generics to a simple immutable API.Eduard Burtescu-21/+32
2016-08-17rustc: move trait objects from TraitRef to ExistentialTraitRef.Eduard Burtescu-24/+37
2016-08-13Rename empty/bang to neverAndrew Cann-1/+1
Split Ty::is_empty method into is_never and is_uninhabited
2016-08-13Remove obsolete divergence related stuffAndrew Cann-7/+1
Replace FnOutput with Ty Replace FnConverging(ty) with ty Purge FnDiverging, FunctionRetTy::NoReturn and FunctionRetTy::None
2016-08-13Start implementation of RFC 1216 (make ! a type)Andrew Cann-0/+1
Add `TyKind::Empty` and fix resulting build errors.
2016-08-12rustc: add TyAnon (impl Trait) to the typesystem.Eduard Burtescu-0/+7
2016-07-03prefer `if let` to match with `None => {}` arm in some placesZack M. Davis-9/+6
This is a spiritual succesor to #34268/8531d581, in which we replaced a number of matches of None to the unit value with `if let` conditionals where it was judged that this made for clearer/simpler code (as would be recommended by Manishearth/rust-clippy's `single_match` lint). The same rationale applies to matches of None to the empty block.
2016-06-05rustc: add ReErased to be used by trait selection, MIR and trans.Eduard Burtescu-6/+3
2016-05-31make region-param-def encoding more DRYNiko Matsakis-1/+1
we used to have two separate routines, one in tyencode/tydecode, and one in encode/decode.
2016-05-31add `Issue32330` warning marker to bound regionsNiko Matsakis-2/+15
This indicates whether this `BoundRegion` will change from late to early bound when issue 32330 is fixed. It also indicates the function on which the lifetime is declared.
2016-05-11rustc: More interning for data used in Ty<'tcx>.Eduard Burtescu-3/+3
2016-05-11rustc: Split 'tcx into 'gcx and 'tcx for InferCtxt and its users.Eduard Burtescu-3/+3
2016-05-11rustc: Replace &'a TyCtxt<'tcx> with a TyCtxt<'a, 'tcx> wrapper.Eduard Burtescu-3/+3
2016-04-13Auto merge of #32780 - soltanmm:consider-the-following, r=nikomatsakisbors-0/+12
Replace consider_unification_despite_ambiguity with new obligation variant Is work towards #32730. Addresses part one of #32286. Addresses #24210 and #26046 to some degree. r? @nikomatsakis
2016-04-06Replace consider_unification_despite_ambiguity with obligation variantMasood Malekghassemi-0/+12
2016-04-06rustc: move middle::{def,def_id,pat_util} to hir.Eduard Burtescu-1/+1
2016-04-06rustc: move rustc_front to rustc::hir.Eduard Burtescu-1/+1
2016-03-31librustc_metadata: use bug!(), span_bug!()Benjamin Herr-16/+16
2016-03-27rustc: move cfg, infer, traits and ty from middle to top-level.Eduard Burtescu-3/+3
2016-03-27rustc: move middle::subst into middle::ty.Eduard Burtescu-2/+2
2016-03-24remove ErasedRegions from substitutionsNiko Matsakis-12/+1
This hack has long since outlived its usefulness; the transition to trans passing around full substitutions is basically done. Instead of `ErasedRegions`, just supply substitutions with a suitable number of `'static` entries, and invoke `erase_regions` when needed (the latter of which we already do).
2016-03-09Track fn type and lifetime parameters in TyFnDef.Eduard Burtescu-1/+2
2016-03-09Split TyBareFn into TyFnDef and TyFnPtr.Eli Friedman-2/+2
There's a lot of stuff wrong with the representation of these types: TyFnDef doesn't actually uniquely identify a function, TyFnPtr is used to represent method calls, TyFnDef in the sub-expression of a cast isn't correctly reified, and probably some other stuff I haven't discovered yet. Splitting them seems like the right first step, though.
2016-03-03Rename middle::ty::ctxt to TyCtxtJeffrey Seyfried-4/+4
2016-01-07Refactor away extension traits RegionEscape and HasTypeFlagsJeffrey Seyfried-1/+1
2015-12-28Use a more efficient encoding for opaque data in RBML.Michael Woerister-3/+5
2015-12-28rewrite the method-receiver matching codeAriel Ben-Yehuda-2/+0
the old code was *so terrible*.
2015-12-16Auto merge of #30341 - pnkfelix:call-site-scope, r=nikomatsakisbors-0/+11
Ensure borrows of fn/closure params do not outlive invocations. Does this by adding a new CallSiteScope to the region (or rather code extent) hierarchy, which outlives even the ParameterScope (which in turn outlives the DestructionScope of a fn/closure's body). Fix #29793 r? @nikomatsakis
2015-12-15Ensure borrows of fn/closure params do not outlive invocations.Felix S. Klock II-0/+11
resolve_lifetime.rs: Switch from BlockScope to FnScope in ScopeChain construction. Lifetimes introduced by a fn signature are scoped to the call-site for that fn. (Note `add_scope_and_walk_fn` must only add FnScope for the walk of body, *not* of the fn signature.) region.rs: Introduce new CodeExtentData::CallSiteScope variant. Use CodeExtentData as the cx.parent, rather than just a NodeId. Change DestructionScopeData to CallSiteScopeData. regionck.rs: Thread call_site_scope via Rcx; constrain fn return values. (update; incorporated review feedback from niko.)
2015-12-09Auto merge of #30140 - michaelwoerister:tls-encoding, r=nikomatsakisbors-0/+4
With this commit, metadata encoding and decoding can make use of thread-local encoding and decoding contexts. These allow implementers of `serialize::Encodable` and `Decodable` to access information and datastructures that would otherwise not be available to them. For example, we can automatically translate def-id and span information during decoding because the decoding context knows which crate the data is decoded from. Or it allows to make `ty::Ty` decodable because the context has access to the `ty::ctxt` that is needed for creating `ty::Ty` instances. Some notes: - `tls::with_encoding_context()` and `tls::with_decoding_context()` (as opposed to their unsafe versions) try to prevent the TLS data getting out-of-sync by making sure that the encoder/decoder passed in is actually the same as the one stored in the context. This should prevent accidentally reading from the wrong decoder. - There are no real tests in this PR. I had a unit tests for some of the core aspects of the TLS implementation but it was kind of brittle, a lot of code for mocking `ty::ctxt`, `crate_metadata`, etc and did actually test not so much. The code will soon be tested by the first incremental compilation auto-tests that rely on MIR being properly serialized. However, if people think that some tests should be added before this can land, I'll try to provide some that make sense. r? @nikomatsakis
2015-12-09Add scoped thread-local encoding and decoding contexts to cstore.Michael Woerister-0/+4
With this commit, metadata encoding and decoding can make use of thread-local encoding and decoding contexts. These allow implementers of serialize::Encodable and Decodable to access information and datastructures that would otherwise not be available to them. For example, we can automatically translate def-id and span information during decoding because the decoding context knows which crate the data is decoded from. Or it allows to make ty::Ty decodable because the context has access to the ty::ctxt that is needed for creating ty::Ty instances.
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-1/+1
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * The `#![no_std]` attribute * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-11-26split the metadata code into rustc_metadataAriel Ben-Yehuda-0/+711
tests & rustdoc still broken