about summary refs log tree commit diff
path: root/src/librustc/metadata
AgeCommit message (Collapse)AuthorLines
2014-08-07Rename `Share` to `Sync`Alex Crichton-2/+2
This leaves the `Share` trait at `std::kinds` via a `#[deprecated]` `pub use` statement, but the `NoShare` struct is no longer part of `std::kinds::marker` due to #12660 (the build cannot bootstrap otherwise). All code referencing the `Share` trait should now reference the `Sync` trait, and all code referencing the `NoShare` type should now reference the `NoSync` type. The functionality and meaning of this trait have not changed, only the naming. Closes #16281 [breaking-change]
2014-08-05Allow generic foreign functions.Russell-1/+2
Generic extern functions written in Rust have their names mangled, as well as their internal clownshoe __rust_abi functions. This allows e.g. specific monomorphizations of these functions to be used as callbacks. Closes #12502.
2014-08-01Fix misspelled comments.Joseph Crail-4/+4
2014-08-01auto merge of #16141 : alexcrichton/rust/rollup, r=alexcrichtonbors-681/+676
2014-07-31Byte literals!Simon Sapin-6/+1
2014-07-31auto merge of #16073 : mneumann/rust/dragonfly2, r=alexcrichtonbors-2/+8
Not included are two required patches: * LLVM: segmented stack support for DragonFly [1] * jemalloc: simple configure patches [1]: http://reviews.llvm.org/D4705
2014-07-31Move SeekableMemWriter into librbmlErick Tryzelaar-2/+2
2014-07-31remove serialize::ebml, add librbmlErick Tryzelaar-673/+673
Our implementation of ebml has diverged from the standard in order to better serve the needs of the compiler, so it doesn't make much sense to call what we have ebml anyore. Furthermore, our implementation is pretty crufty, and should eventually be rewritten into a format that better suits the needs of the compiler. This patch factors out serialize::ebml into librbml, otherwise known as the Really Bad Markup Language. This is a stopgap library that shouldn't be used by end users, and will eventually be replaced by something better. [breaking-change]
2014-07-29remove seek from std::io::MemWriter, add SeekableMemWriter to librustcErick Tryzelaar-34/+35
Not all users of MemWriter need to seek, but having MemWriter seekable adds between 3-29% in overhead in certain circumstances. This fixes that performance gap by making a non-seekable MemWriter, and creating a new SeekableMemWriter for those circumstances when that functionality is actually needed. ``` test io::mem::test::bench_buf_reader ... bench: 682 ns/iter (+/- 85) test io::mem::test::bench_buf_writer ... bench: 580 ns/iter (+/- 57) test io::mem::test::bench_mem_reader ... bench: 793 ns/iter (+/- 99) test io::mem::test::bench_mem_writer_001_0000 ... bench: 48 ns/iter (+/- 27) test io::mem::test::bench_mem_writer_001_0010 ... bench: 65 ns/iter (+/- 27) = 153 MB/s test io::mem::test::bench_mem_writer_001_0100 ... bench: 132 ns/iter (+/- 12) = 757 MB/s test io::mem::test::bench_mem_writer_001_1000 ... bench: 802 ns/iter (+/- 151) = 1246 MB/s test io::mem::test::bench_mem_writer_100_0000 ... bench: 481 ns/iter (+/- 28) test io::mem::test::bench_mem_writer_100_0010 ... bench: 1957 ns/iter (+/- 126) = 510 MB/s test io::mem::test::bench_mem_writer_100_0100 ... bench: 8222 ns/iter (+/- 434) = 1216 MB/s test io::mem::test::bench_mem_writer_100_1000 ... bench: 82496 ns/iter (+/- 11191) = 1212 MB/s test io::mem::test::bench_seekable_mem_writer_001_0000 ... bench: 48 ns/iter (+/- 2) test io::mem::test::bench_seekable_mem_writer_001_0010 ... bench: 64 ns/iter (+/- 2) = 156 MB/s test io::mem::test::bench_seekable_mem_writer_001_0100 ... bench: 129 ns/iter (+/- 7) = 775 MB/s test io::mem::test::bench_seekable_mem_writer_001_1000 ... bench: 801 ns/iter (+/- 159) = 1248 MB/s test io::mem::test::bench_seekable_mem_writer_100_0000 ... bench: 711 ns/iter (+/- 51) test io::mem::test::bench_seekable_mem_writer_100_0010 ... bench: 2532 ns/iter (+/- 227) = 394 MB/s test io::mem::test::bench_seekable_mem_writer_100_0100 ... bench: 8962 ns/iter (+/- 947) = 1115 MB/s test io::mem::test::bench_seekable_mem_writer_100_1000 ... bench: 85086 ns/iter (+/- 11555) = 1175 MB/s ``` [breaking-change]
2014-07-29Port Rust to DragonFlyBSDMichael Neumann-2/+8
Not included are two required patches: * LLVM: segmented stack support for DragonFly [1] * jemalloc: simple configure patches [1]: http://reviews.llvm.org/D4705
2014-07-28rustc: encode is_sugared_doc on ast::AttributeCorey Richardson-1/+7
2014-07-28rustdoc: show struct field docs when inlinedCorey Richardson-0/+51
Some minor changes to the compiler to expose this information. Very inconvenient since struct fields aren't an item. Adds (yet another) table to metadata. Closes #15739
2014-07-24rustc: Compare paths with --extern, not bytesAlex Crichton-3/+6
The right hand side of the comparison in these checks are values of type Option<&Path> which are normalized versions of the left-hand side, so they're not guaranteed to be byte-for-byte equivalent even though they're the same path. For this reasons, the command line arguments are promoted to paths for comparison of equality. This fixes a bug on windows where if a library was specified with --extern it would then be picked up twice because it was not considered to have been previously registered.
2014-07-24Deprecated `str::raw::from_buf_len`Adolfo Ochagavía-2/+2
Replaced by `string::raw::from_buf_len` [breaking-change]
2014-07-21repair macro docsJohn Clements-2/+2
In f1ad425199b0d89dab275a8c8f6f29a73d316f70, I changed the handling of macros, to prevent macro invocations from occurring in fully expanded source. Instead, I added a side table. It contained only the spans of the macros, because this was the only information required in order to make macro export work. However, librustdoc was also affected by this change, since it extracts macro information in a similar way. As a result of the earlier change, exported macros were no longer documented. In order to repair this, I've adjusted the side table to contain whole items, rather than just the spans.
2014-07-18librustc: Only emit constructor functions as necessary.Luqman Aden-9/+3
2014-07-18librustc: Implement unboxed closures with mutable receiversPatrick Walton-9/+73
2014-07-18auto merge of #15725 : aochagavia/rust/vec, r=alexcrichtonbors-4/+4
* Deprecated `to_owned` in favor of `to_vec` * Deprecated `into_owned` in favor of `into_vec` [breaking-change]
2014-07-17librustc: Remove cross-borrowing of `Box<T>` to `&T` from the language,Patrick Walton-2/+2
except where trait objects are involved. Part of issue #15349, though I'm leaving it open for trait objects. Cross borrowing for trait objects remains because it is needed until we have DST. This will break code like: fn foo(x: &int) { ... } let a = box 3i; foo(a); Change this code to: fn foo(x: &int) { ... } let a = box 3i; foo(&*a); [breaking-change]
2014-07-17Rename functions in the CloneableVector traitAdolfo Ochagavía-4/+4
* Deprecated `to_owned` in favor of `to_vec` * Deprecated `into_owned` in favor of `into_vec` [breaking-change]
2014-07-16librustc: Implement the fully-expanded, UFCS form of explicit self.Patrick Walton-24/+35
This makes two changes to region inference: (1) it allows region inference to relate early-bound regions; and (2) it allows regions to be related before variance runs. The former is needed because there is no relation between the two regions before region substitution happens, while the latter is needed because type collection has to run before variance. We assume that, before variance is inferred, that lifetimes are invariant. This is a conservative overapproximation. This relates to #13885. This does not remove `~self` from the language yet, however. [breaking-change]
2014-07-15change to new trait style for method field refsJohn Clements-2/+3
Per @pnkfelix 's suggestion, using a trait to make these field accesses more readable (and vastly more similar to the original code. oops fix new ast_map fix
2014-07-15Fix errorsAdolfo Ochagavía-3/+2
2014-07-15Deprecate `str::from_char`Adolfo Ochagavía-1/+1
Use `String::from_char` or `.to_str` instead [breaking-change]
2014-07-15Deprecate `str::from_utf8_owned`Adolfo Ochagavía-1/+1
Use `String::from_utf8` instead [breaking-change]
2014-07-14rustc_llvm: Remove the inner llvm moduleBrian Anderson-2/+3
This makes it much saner for clients to use the library since they don't have to worry about shadowing one llvm with another.
2014-07-14rustc: Move ArchiveRO to rustc_llvmBrian Anderson-1/+2
It is a wrapper around LLVM.
2014-07-13refactor Method definition to make space for macrosJohn Clements-2/+2
This change propagates to many locations, but because of the Macro Exterminator (or, more properly, the invariant that it protects), macro invocations can't occur downstream of expansion. This means that in librustc and librustdoc, extracting the desired field can simply assume that it can't be a macro invocation. Functions in ast_util abstract over this check.
2014-07-12auto merge of #15601 : jbclements/rust/disable-default-macro-behavior, ↵bors-28/+16
r=alexcrichton Our AST definition can include macro invocations, which can expand into all kinds of things. Macro invocations are expanded away during expansion time, and the rest of the compiler doesn't have to deal with them. However, we have no way of enforcing this. This patch adds two protective mechanisms. First, it adds a (quick) explicit check that ensures there are no macro invocations remaining in the AST after expansion. Second, it updates the visit and fold mechanisms so that by default, they will not traverse macro invocations. It's easy enough to add this, if desired (it's documented in the source, and examples appear, e.g. in the IdentFinder. Along the way, I also consulted with @sfackler to refactor the macro export mechanism so that it stores macro text spans in a side table, rather than leaving them in the AST.
2014-07-11auto merge of #15586 : aturon/rust/stability-dashboard, r=alexcrichtonbors-0/+4
This PR adds a crate-level dashboard summarizing the stability levels of all items for all submodules of the crate. The information is also written as a json file, intended for consumption by pages like http://huonw.github.io/isrustfastyet/ Along the way, fixes a few bugs in stability tracking and places where rustdoc was not pulling the existing stability data. Closes #13541
2014-07-11use side table to store exported macrosJohn Clements-28/+16
Per discussion with @sfackler, refactored the expander to change the way that exported macros are collected. Specifically, a crate now contains a side table of spans that exported macros go into. This has two benefits. First, the encoder doesn't need to scan through the expanded crate in order to discover exported macros. Second, the expander can drop all expanded macros from the crate, with the pleasant result that a fully expanded crate contains no macro invocations (which include macro definitions).
2014-07-10Bug fixes for stability trackingAaron Turon-0/+4
This commit adds correct stability tracking for struct fields and corrects some places where rustdoc was not pulling the stability data.
2014-07-10rustc: Forbid plugin_registrar in only rlib formAlex Crichton-1/+9
If a plugin registrar is available, the library must be found in dylib form, not just in rlib form. Closes #15475
2014-07-09ast: make Name its own typeCorey Richardson-1/+1
2014-07-08carry self ident forward through re-parsingJohn Clements-7/+8
formerly, the self identifier was being discarded during parsing, which stymies hygiene. The best fix here seems to be to attach a self identifier to ExplicitSelf_, a change that rippled through the rest of the compiler, but without any obvious damage.
2014-07-08auto merge of #15493 : brson/rust/tostr, r=pcwaltonbors-29/+29
This updates https://github.com/rust-lang/rust/pull/15075. Rename `ToStr::to_str` to `ToString::to_string`. The naive renaming ends up with two `to_string` functions defined on strings in the prelude (the other defined via `collections::str::StrAllocating`). To remedy this I removed `StrAllocating::to_string`, making all conversions from `&str` to `String` go through `Show`. This has a measurable impact on the speed of this conversion, but the sense I get from others is that it's best to go ahead and unify `to_string` and address performance for all `to_string` conversions in `core::fmt`. `String::from_str(...)` still works as a manual fast-path. Note that the patch was done with a script, and ended up renaming a number of other `*_to_str` functions, particularly inside of rustc. All the ones I saw looked correct, and I didn't notice any additional API breakage. Closes #15046.
2014-07-08std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.Richo Healey-29/+29
[breaking-change]
2014-07-08Change DST syntax: type -> Sized?Nick Cameron-34/+1
closes #13367 [breaking-change] Use `Sized?` to indicate a dynamically sized type parameter or trait (used to be `type`). E.g., ``` trait Tr for Sized? {} fn foo<Sized? X: Share>(x: X) {} ```
2014-07-07Strip empty strings from link argsSteven Fackler-1/+1
Closes #15487
2014-07-05Test fixes and rebase conflictsAlex Crichton-1/+1
2014-07-05rustc: Add a flag for specifying dependenciesAlex Crichton-8/+308
This comit implements a new flag, --extern, which is used to specify where a crate is located. The purpose of this flag is to bypass the normal crate loading/matching of the compiler to point it directly at the right file. This flag takes the form `--extern foo=bar` where `foo` is the name of a crate and `bar` is the location at which to find the crate. Multiple `--extern` directives are allowed with the same crate name to specify the rlib/dylib pair for a crate. It is invalid to specify more than one rlib or more than one dylib, and it's required that the crates are valid rust crates. I have also added some extensive documentation to metadata::loader about how crate loading should work. RFC: 0035-remove-crate-id
2014-07-05rustc: Modify crate loading to ignore versionsAlex Crichton-87/+34
This commit modifies crate loading to purely work off a `crate_name` and nothing else. This commit also changes the patterns recognized from `lib<foo>-*` to `lib<foo>*` to accomodate the future renamings of output files. RFC: 0035-remove-crate-id
2014-07-05rustc: Remove CrateId and all related supportAlex Crichton-106/+76
This commit removes all support in the compiler for the #[crate_id] attribute and all of its derivative infrastructure. A list of the functionality removed is: * The #[crate_id] attribute no longer exists * There is no longer the concept of a version of a crate * Version numbers are no longer appended to symbol names * The --crate-id command line option has been removed To migrate forward, rename #[crate_id] to #[crate_name] and only the name of the crate itself should be mentioned. The version/path of the old crate id should be removed. For a transitionary state, the #[crate_id] attribute is still accepted if the #[crate_name] is not present, but it is warned about if it is the only identifier present. RFC: 0035-remove-crate-id [breaking-change]
2014-07-05Refactored VecPerParamSpace to hide exposure of `Vec` representation.Felix S. Klock II-1/+1
This basically meant changing the interface so that no borrowed `&Vec` is exposed, by hiding `fn get_vec` and `fn get_mut_vec` and revising `fn all_vecs`. Instead, clients should use one of the other methods; `get_slice`, `pop`, `truncate`, `replace`, `push_all`, or `is_empty_in`, which should work for any case currently used in rustc.
2014-07-03Simplify PatIdent to contain an Ident rather than a PathJohn Clements-4/+4
Rationale: for what appear to be historical reasons only, the PatIdent contains a Path rather than an Ident. This means that there are many places in the code where an ident is artificially promoted to a path, and---much more problematically--- a bunch of elements from a path are simply thrown away, which seems like an invitation to some really nasty bugs. This commit replaces the Path in a PatIdent with a SpannedIdent, which just contains an ident and a span.
2014-07-01rustc: Remove `&str` indexing from the language.Brian Anderson-3/+3
Being able to index into the bytes of a string encourages poor UTF-8 hygiene. To get a view of `&[u8]` from either a `String` or `&str` slice, use the `as_bytes()` method. Closes #12710. [breaking-change]
2014-06-30rustdoc: incorporate stability index throughoutAaron Turon-7/+11
This commit hooks rustdoc into the stability index infrastructure in two ways: 1. It looks up stability levels via the index, rather than by manual attributes. 2. It adds stability level information throughout rustdoc output, rather than just at the top header. In particular, a stability color (with mouseover text) appears next to essentially every item that appears in rustdoc's HTML output. Along the way, the stability index code has been lightly refactored.
2014-06-28auto merge of #15208 : alexcrichton/rust/snapshots, r=pcwaltonbors-6/+7
This change registers new snapshots, allowing `*T` to be removed from the language. This is a large breaking change, and it is recommended that if compiler errors are seen that any FFI calls are audited to determine whether they should be actually taking `*mut T`.
2014-06-28Rename all raw pointers as necessaryAlex Crichton-6/+7
2014-06-26Remove unnecessary to_string callsPiotr Jawniak-2/+2
This commit removes superfluous to_string calls from various places