summary refs log tree commit diff
path: root/src/librustc_metadata
AgeCommit message (Collapse)AuthorLines
2016-01-15Preserve struct/variant kinds in metadataVadim Petrochenkov-11/+32
Add tests for use of empty structs in cross-crate scenarios
2016-01-08Also store MIR of closures in crate metadata.Michael Woerister-6/+9
2016-01-07Refactor away extension traits RegionEscape and HasTypeFlagsJeffrey Seyfried-2/+2
2016-01-05Refactor compiler to make use of dep-tracking-maps. Also, in cases whereNiko Matsakis-11/+6
we were using interior mutability (RefCells, TyIvar), add some reads/writes.
2016-01-02Auto merge of #30264 - GuillaumeGomez:patch-5, r=Manishearthbors-1/+14
r? @Manishearth Also: should I merged both commits? Not sure if it's really useful to keep the first one.
2016-01-02Add E0463 error explanationGuillaume Gomez-1/+14
2015-12-31Rollup merge of #30565 - michaelwoerister:opaque_encoder, r=brsonSimonas Kazlauskas-325/+278
This PR changes the `emit_opaque` and `read_opaque` methods in the RBML library to use a space-efficient binary encoder that does not emit any tags and uses the LEB128 variable-length integer format for all numbers it emits. The space savings are nice, albeit a bit underwhelming, especially for dynamic libraries where metadata is already compressed. | RLIBs | NEW | OLD | |--------------|--------|-----------| |libstd | 8.8 MB | 10.5 MB | |libcore |15.6 MB | 19.7 MB | |libcollections| 3.7 MB | 4.8 MB | |librustc |34.0 MB | 37.8 MB | |libsyntax |28.3 MB | 32.1 MB | | SOs | NEW | OLD | |---------------|-----------|--------| | libstd | 4.8 MB | 5.1 MB | | librustc | 8.6 MB | 9.2 MB | | libsyntax | 7.8 MB | 8.4 MB | At least this should make up for the size increase caused recently by also storing MIR in crate metadata. Can this be a breaking change for anyone? cc @rust-lang/compiler
2015-12-31Auto merge of #30585 - Ms2ger:ExplicitSelfCategory, r=brsonbors-12/+12
2015-12-30Rebasing and review commentsNick Cameron-4/+5
2015-12-30use structured errorsNick Cameron-47/+65
2015-12-29Add a hint when given --extern with an indeterminate typeCorey Richardson-0/+2
@ubsan brought up this relatively poor error message. This adds a help message hinting when the problem actually is, and how to fix it.
2015-12-28Use a more efficient encoding for opaque data in RBML.Michael Woerister-325/+278
2015-12-28Rename ExplicitSelfCategory's variants and stop re-exporting them.Ms2ger-12/+12
2015-12-28rewrite the method-receiver matching codeAriel Ben-Yehuda-4/+1
the old code was *so terrible*.
2015-12-22Fix def paths creation for items inlined from external crates.Michael Woerister-17/+45
Avoid duplicating the last element of the def path which led to paths like "std::slice::into_vec::into_vec".
2015-12-21Register new snapshotsAlex Crichton-2/+0
Lots of cruft to remove!
2015-12-18Rollup merge of #30384 - nrc:diagnostics, r=@nikomatsakisManish Goregaokar-12/+11
Should make it possible to add JSON or HTML errors. Also tidies up a lot.
2015-12-17Auto merge of #30325 - jseyfried:fixes_30078, r=nrcbors-1/+1
This fixes a bug in which unused imports can get wrongly marked as used when checking for unused qualifications in `resolve_path` (issue #30078), and it removes unused imports that were previously undetected because of the bug.
2015-12-17Remove unused importsJeffrey Seyfried-1/+1
2015-12-17Auto merge of #30354 - petrochenkov:defuse, r=sanxiynbors-1/+0
A relic of some old resolution algorithm?
2015-12-16Auto merge of #30341 - pnkfelix:call-site-scope, r=nikomatsakisbors-0/+13
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-17move error handling from libsyntax/diagnostics.rs to libsyntax/errors/*Nick Cameron-12/+11
Also split out emitters into their own module.
2015-12-16rustc: Remove def::DefUseVadim Petrochenkov-1/+0
2015-12-16Rollup merge of #30320 - nrc:err-names, r=@nikomatsakisManish Goregaokar-1/+2
We can now handle name resolution errors and get past type checking (if we're a bit lucky). This is the first step towards doing code completion for partial programs (we need error recovery in the parser and early access to save-analysis).
2015-12-15Ensure borrows of fn/closure params do not outlive invocations.Felix S. Klock II-0/+13
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-12Implement `#[deprecated]` attribute (RFC 1270)Vadim Petrochenkov-11/+65
2015-12-11Make name resolution errors non-fatalNick Cameron-1/+2
2015-12-10Make MIR encodable and store it in crate metadata.Michael Woerister-5/+91
2015-12-09Auto merge of #30140 - michaelwoerister:tls-encoding, r=nikomatsakisbors-106/+234
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-106/+234
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-07Auto merge of #30087 - petrochenkov:indi, r=nrcbors-5/+5
I've measured the time/memory consumption before and after - the difference is lost in statistical noise, so it's mostly a code simplification. Sizes of `enum`s are not affected. r? @nrc I wonder if AST/HIR visitors could run faster if `P`s are systematically removed (except for cases where they control `enum` sizes). Theoretically they should. Remaining unnecessary `P`s can't be easily removed because many folders accept `P<X>`s as arguments, but these folders can be converted to accept `X`s instead without loss of efficiency. When I have a mood for some mindless refactoring again, I'll probably try to convert the folders, remove remaining `P`s and measure again.
2015-12-07Remove some unnecessary indirection from HIR structuresVadim Petrochenkov-5/+5
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-14/+12
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-12-03Use the extern item-path for documentation linksmitaa-3/+15
The local item-path includes the local crates path to the extern crate declaration which breaks cross-crate rustdoc links if the extern crate is not linked into the crate root or renamed via `extern foo as bar`.
2015-11-26fix tidyAriel Ben-Yehuda-16/+15
2015-11-26split the metadata code into rustc_metadataAriel Ben-Yehuda-0/+9710
tests & rustdoc still broken