about summary refs log tree commit diff
path: root/src/librustc/metadata
AgeCommit message (Collapse)AuthorLines
2013-11-08Generalize AST and ty::Generics to accept multiple lifetimes.Niko Matsakis-106/+155
2013-11-08Added a FIXME with issue number to change package_idAndrei Formiga-1/+1
2013-11-08Added default value for package_id attribute when encoding metadata for lib ↵Andrei Formiga-4/+15
crates
2013-11-04libsyntax/librustc: Allow calling variadic foreign functions.Luqman Aden-3/+13
2013-11-04Move io::file to io::fs and fns out of FileAlex Crichton-2/+2
This renames the `file` module to `fs` because that more accurately describes its current purpose (manipulating the filesystem, not just files). Additionally, this adds an UnstableFileStat structure as a nested structure of FileStat to signify that the fields should not be depended on. The structure is currently flagged with #[unstable], but it's unlikely that it has much meaning. Closes #10241
2013-11-03Remove all blocking std::os blocking functionsAlex Crichton-15/+21
This commit moves all thread-blocking I/O functions from the std::os module. Their replacements can be found in either std::rt::io::file or in a hidden "old_os" module inside of native::file. I didn't want to outright delete these functions because they have a lot of special casing learned over time for each OS/platform, and I imagine that these will someday get integrated into a blocking implementation of IoFactory. For now, they're moved to a private module to prevent bitrot and still have tests to ensure that they work. I've also expanded the extensions to a few more methods defined on Path, most of which were previously defined in std::os but now have non-thread-blocking implementations as part of using the current IoFactory. The api of io::file is in flux, but I plan on changing it in the next commit as well. Closes #10057
2013-11-01Stop propagating link arguments across cratesAlex Crichton-38/+0
This is a fairly brittle modle that doesn't scale well across many crates. It's unlikely that all of the downstream crates will have all of the original native dependencies of all the upstream crates. In the case that FFI functions are reachable, then it should be the responsibility of the downstream crate to link against the correct library, or the upstream crate should prevent the functions from being reachable.
2013-10-29Assorted cleanups suggested by reviewers.Jed Davis-1/+2
2013-10-29Add repr attributes in various places that need them.Jed Davis-2/+2
2013-10-29Add parser for `#[repr(...)]`; nothing uses it yet.Jed Davis-0/+1
Also export enum attrs into metadata, and add a convenient interface for obtaining the repr hint from either a local or remote definition.
2013-10-28auto merge of #10079 : alexcrichton/rust/no-reader-util, r=brsonbors-8/+7
These methods are all excellent candidates for default methods, so there's no need to require extra imports of various traits. Additionally, this was able to remove all the weird underscores after the method names. Yay!
2013-10-28Remove the extension traits for Readers/WritersAlex Crichton-8/+7
These methods are all excellent candidates for default methods, so there's no need to require extra imports of various traits.
2013-10-26Make addl_lib_search_paths a HashSet (Closes #7718).Joshua Yanovski-2/+2
2013-10-24Remove std::io once and for all!Alex Crichton-4/+5
2013-10-24Remove std::io from ebmlAlex Crichton-295/+271
2013-10-24Remove even more of std::ioAlex Crichton-23/+21
Big fish fried here: extra::json most of the compiler extra::io_util removed extra::fileinput removed Fish left to fry extra::ebml
2013-10-22libsyntax/librustc: Allow specifying mut on ~self.Luqman Aden-2/+3
2013-10-22libsyntax/librustc: Allow specifying mut on by-value self.Luqman Aden-2/+3
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-91/+91
Who doesn't like a massive renaming?
2013-10-16path2: Remove some API functionsKevin Ballard-5/+4
Delete the following API functions: - set_dirname() - with_dirname() - set_filestem() - with_filestem() - add_extension() - file_path() Also change pop() to return a boolean instead of an owned copy of the old filename.
2013-10-16path2: Update based on more review feedbackKevin Ballard-19/+16
Standardize the is_sep() functions to be the same in both posix and windows, and re-export from path. Update extra::glob to use this. Remove the usage of either, as it's going away. Move the WindowsPath-specific methods out of WindowsPath and make them top-level functions of path::windows instead. This way you cannot accidentally write code that will fail to compile on non-windows architectures without typing ::windows anywhere. Remove GenericPath::from_c_str() and just impl BytesContainer for CString instead. Remove .join_path() and .push_path() and just implement BytesContainer for Path instead. Remove FilenameDisplay and add a boolean flag to Display instead. Remove .each_parent(). It only had one caller, so just inline its definition there.
2013-10-15path2: Adjust the API to remove all the _str mutation methodsKevin Ballard-13/+13
Add a new trait BytesContainer that is implemented for both byte vectors and strings. Convert Path::from_vec and ::from_str to one function, Path::new(). Remove all the _str-suffixed mutation methods (push, join, with_*, set_*) and modify the non-suffixed versions to use BytesContainer.
2013-10-15path2: Replace the path module outrightKevin Ballard-40/+52
Remove the old path. Rename path2 to path. Update all clients for the new path. Also make some miscellaneous changes to the Path APIs to help the adoption process.
2013-10-10Remove named extern blocks from the ASTAlex Crichton-30/+33
There's currently a fair amount of code which is being ignored on unnamed blocks (which are the default now), and I opted to leave it commented out for now. I intend on very soon revisiting on how we perform linking with extern crates in an effort to support static linking.
2013-10-09option: rewrite the API to use compositionDaniel Micay-5/+5
2013-10-07auto merge of #9674 : ben0x539/rust/raw-str, r=alexcrichtonbors-2/+2
This branch parses raw string literals as in #9411.
2013-10-07Fix merge fallout of privacy changesAlex Crichton-0/+1
2013-10-08add new enum ast::StrStyle as field to ast::lit_strBenjamin Herr-2/+2
For the benefit of the pretty printer we want to keep track of how string literals in the ast were originally represented in the source code. This commit changes parser functions so they don't extract strings from the token stream without at least also returning what style of string literal it was. This is stored in the resulting ast node for string literals, obviously, for the package id in `extern mod = r"package id"` view items, for the inline asm in `asm!()` invocations. For `asm!()`'s other arguments or for `extern "Rust" fn()` items, I just the style of string, because it seemed disproportionally cumbersome to thread that information through the string processing that happens with those string literals, given the limited advantage raw string literals would provide in these positions. The other syntax extensions don't seem to store passed string literals in the ast, so they also discard the style of strings they parse.
2013-10-07Extract privacy checking from name resolutionAlex Crichton-13/+5
This commit is the culmination of my recent effort to refine Rust's notion of privacy and visibility among crates. The major goals of this commit were to remove privacy checking from resolve for the sake of sane error messages, and to attempt a much more rigid and well-tested implementation of visibility throughout rust. The implemented rules for name visibility are: 1. Everything pub from the root namespace is visible to anyone 2. You may access any private item of your ancestors. "Accessing a private item" depends on what the item is, so for a function this means that you can call it, but for a module it means that you can look inside of it. Once you look inside a private module, any accessed item must be "pub from the root" where the new root is the private module that you looked into. These rules required some more analysis results to get propagated from trans to privacy in the form of a few hash tables. I added a new test in which my goal was to showcase all of the privacy nuances of the language, and I hope to place any new bugs into this file to prevent regressions. Overall, I was unable to completely remove the notion of privacy from resolve. One use of privacy is for dealing with glob imports. Essentially a glob import can only import *public* items from the destination, and because this must be done at namespace resolution time, resolve must maintain the notion of "what items are public in a module". There are some sad approximations of privacy, but I unfortunately can't see clear methods to extract them outside. The other use case of privacy in resolve now is one that must stick around regardless of glob imports. When dealing with privacy, checking a private path needs to know "what the last private thing was" when looking at a path. Resolve is the only compiler pass which knows the answer to this question, so it maintains the answer on a per-path resolution basis (works similarly to the def_map generated). Closes #8215
2013-10-01auto merge of #9560 : pcwalton/rust/xc-tuple-structs, r=pcwaltonbors-2/+7
r? @thestinger
2013-10-01librustc: Inline cross-crate tuple struct constructorsPatrick Walton-2/+7
2013-10-01remove the `float` typeDaniel Micay-2/+0
It is simply defined as `f64` across every platform right now. A use case hasn't been presented for a `float` type defined as the highest precision floating point type implemented in hardware on the platform. Performance-wise, using the smallest precision correct for the use case greatly saves on cache space and allows for fitting more numbers into SSE/AVX registers. If there was a use case, this could be implemented as simply a type alias or a struct thanks to `#[cfg(...)]`. Closes #6592 The mailing list thread, for reference: https://mail.mozilla.org/pipermail/rust-dev/2013-July/004632.html
2013-09-30rustc: Remove usage of fmt!Alex Crichton-122/+122
2013-09-30rustc: Convert lang_item to use an iteratorblake2-ppc-3/+2
2013-09-27auto merge of #9550 : alexcrichton/rust/remove-printf, r=thestingerbors-11/+11
The 0.8 release was cut, down with printf!
2013-09-26Update the compiler to not use printf/printflnAlex Crichton-11/+11
2013-09-26Add 'continue' as a synonym for 'loop'Brian Anderson-16/+16
2013-09-24Correctly encode item visibility in metadataAlex Crichton-25/+52
This fixes private statics and functions from being usable cross-crates, along with some bad privacy error messages. This is a reopening of #8365 with all the privacy checks in privacy.rs instead of resolve.rs (where they should be anyway). These maps of exported items will hopefully get used for generating documentation by rustdoc Closes #8592
2013-09-23librustc: Remove garbage collected functions from front/{config,test} and ↵Patrick Walton-3/+2
metadata/{tydecode,tyencode}
2013-09-16Resume inlining globals across cratesAlex Crichton-1/+7
In #8185 cross-crate condition handlers were fixed by ensuring that globals didn't start appearing in different crates with different addressed. An unfortunate side effect of that pull request is that constants weren't inlined across crates (uint::bits is unknown to everything but libstd). This commit fixes this inlining by using the `available_eternally` linkage provided by LLVM. It partially reverts #8185, and then adds support for this linkage type. The main caveat is that not all statics could be inlined into other crates. Before this patch, all statics were considered "inlineable items", but an unfortunate side effect of how we deal with `&static` and `&[static]` means that these two cases cannot be inlined across crates. The translation of constants was modified to propogate this condition of whether a constant should be considered inlineable into other crates. Closes #9036
2013-09-16auto merge of #9206 : alexcrichton/rust/issue-9188, r=catamorphismbors-1/+2
While they may have the same name within various scopes, this changes static names to use path_pretty_name to append some hash information at the end of the symbol. We're then guaranteed that each static has a unique NodeId, so this NodeId is as the "hash" of the pretty name. Closes #9188
2013-09-14Guarantee that statics have unique namesAlex Crichton-1/+2
While they may have the same name within various scopes, this changes static names to use path_pretty_name to append some hash information at the end of the symbol. We're then guaranteed that each static has a unique NodeId, so this NodeId is as the "hash" of the pretty name. Closes #9188
2013-09-14auto merge of #9115 : erickt/rust/master, r=ericktbors-2/+2
This is a series of patches to modernize option and result. The highlights are: * rename `.unwrap_or_default(value)` and etc to `.unwrap_or(value)` * add `.unwrap_or_default()` that uses the `Default` trait * add `Default` implementations for vecs, HashMap, Option * add `Option.and(T) -> Option<T>`, `Option.and_then(&fn() -> Option<T>) -> Option<T>`, `Option.or(T) -> Option<T>`, and `Option.or_else(&fn() -> Option<T>) -> Option<T>` * add `option::ToOption`, `option::IntoOption`, `option::AsOption`, `result::ToResult`, `result::IntoResult`, `result::AsResult`, `either::ToEither`, and `either::IntoEither`, `either::AsEither` * renamed `Option::chain*` and `Result::chain*` to `and_then` and `or_else` to avoid the eventual collision with `Iterator.chain`. * Added a bunch of impls of `Default` * Added a `#[deriving(Default)]` syntax extension * Removed impls of `Zero` for `Option<T>` and vecs.
2013-09-13rustc/rustpkg: Use a target-specific subdirectory in build/ and lib/Tim Chevalier-6/+11
As per rustpkg.md, rustpkg now builds in a target-specific subdirectory of build/, and installs libraries into a target-specific subdirectory of lib. Closes #8672
2013-09-12std: Rename {Option,Result}::chain{,_err}* to {and_then,or_else}Erick Tryzelaar-2/+2
2013-09-11ident->name cleanupJohn Clements-2/+3
2013-09-11Rename encode_struct_field_names to encode_struct_fields to reflect what it ↵SiegeLord-3/+3
actually does
2013-09-11Properly encode/decode structural variants.SiegeLord-25/+48
2013-09-06Remove even more usage of clownshoes in symbolsAlex Crichton-2/+3
This removes another large chunk of this odd 'clownshoes' identifier showing up in symbol names. These all originated from external crates because the encoded items were encoded independently of the paths calculated in ast_map. The encoding of these paths now uses the helper function in ast_map to calculate the "pretty name" for an impl block. Unfortunately there is still no information about generics in the symbol name, but it's certainly vastly better than before hash::__extensions__::write::_version::v0.8 becomes hash::Writer$SipState::write::hversion::v0.8 This also fixes bugs in which lots of methods would show up as `meth_XXX`, they now only show up as `meth` and throw some extra characters onto the version string.
2013-09-05Rename str::from_bytes to str::from_utf8, closes #8985Florian Hahn-3/+3