summary refs log tree commit diff
path: root/src/libsyntax/lib.rs
AgeCommit message (Collapse)AuthorLines
2014-03-31Bump version to 0.10Alex Crichton-1/+1
2014-03-28Convert most code to new inner attribute syntax.Brian Anderson-11/+11
Closes #2569
2014-03-23Register new snapshotsFlavio Percoco-1/+0
2014-03-22Migrate all users of opt_vec to owned_slice, delete opt_vec.Huon Wilson-1/+0
syntax::opt_vec is now entirely unused, and so can go.
2014-03-22syntax: add the OwnedSlice vector wrapper.Huon Wilson-0/+1
This is a stand-in until we have a saner `~[T]` type (i.e. a proper owned slice). It's a library version of what `~[T]` will be, i.e. an owned pointer and a length.
2014-03-20Register new snapshotsAlex Crichton-3/+3
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-1/+0
It's now in the prelude.
2014-03-15log: Introduce liblog, the old std::loggingAlex Crichton-3/+3
This commit moves all logging out of the standard library into an external crate. This crate is the new crate which is responsible for all logging macros and logging implementation. A few reasons for this change are: * The crate map has always been a bit of a code smell among rust programs. It has difficulty being loaded on almost all platforms, and it's used almost exclusively for logging and only logging. Removing the crate map is one of the end goals of this movement. * The compiler has a fair bit of special support for logging. It has the __log_level() expression as well as generating a global word per module specifying the log level. This is unfairly favoring the built-in logging system, and is much better done purely in libraries instead of the compiler itself. * Initialization of logging is much easier to do if there is no reliance on a magical crate map being available to set module log levels. * If the logging library can be written outside of the standard library, there's no reason that it shouldn't be. It's likely that we're not going to build the highest quality logging library of all time, so third-party libraries should be able to provide just as high-quality logging systems as the default one provided in the rust distribution. With a migration such as this, the change does not come for free. There are some subtle changes in the behavior of liblog vs the previous logging macros: * The core change of this migration is that there is no longer a physical log-level per module. This concept is still emulated (it is quite useful), but there is now only a global log level, not a local one. This global log level is a reflection of the maximum of all log levels specified. The previously generated logging code looked like: if specified_level <= __module_log_level() { println!(...) } The newly generated code looks like: if specified_level <= ::log::LOG_LEVEL { if ::log::module_enabled(module_path!()) { println!(...) } } Notably, the first layer of checking is still intended to be "super fast" in that it's just a load of a global word and a compare. The second layer of checking is executed to determine if the current module does indeed have logging turned on. This means that if any module has a debug log level turned on, all modules with debug log levels get a little bit slower (they all do more expensive dynamic checks to determine if they're turned on or not). Semantically, this migration brings no change in this respect, but runtime-wise, this will have a perf impact on some code. * A `RUST_LOG=::help` directive will no longer print out a list of all modules that can be logged. This is because the crate map will no longer specify the log levels of all modules, so the list of modules is not known. Additionally, warnings can no longer be provided if a malformed logging directive was supplied. The new "hello world" for logging looks like: #[phase(syntax, link)] extern crate log; fn main() { debug!("Hello, world!"); }
2014-03-14lint: add lint for use of a `~[T]`.Huon Wilson-0/+1
This is useless at the moment (since pretty much every crate uses `~[]`), but should help avoid regressions once completely removed from a crate.
2014-03-06syntax: Conditionally deriving(Hash) with WritersAlex Crichton-1/+1
If #[feature(default_type_parameters)] is enabled for a crate, then deriving(Hash) will expand with Hash<W: Writer> instead of Hash<SipState> so more hash algorithms can be used.
2014-03-05Refactor and fix FIXME's in mtwt hygiene codeEdward Wang-0/+1
- Moves mtwt hygiene code into its own file - Fixes FIXME's which leads to ~2x speed gain in expansion pass - It is now @-free
2014-03-04auto merge of #12697 : thestinger/rust/vec, r=huonwbors-0/+1
This exists for the sake of compatibility during the ~[T] -> Vec<T> transition. It will be removed in the future.
2014-03-04mark the `map` method on Vec<T> as deprecatedDaniel Micay-0/+1
This exists for the sake of compatibility during the ~[T] -> Vec<T> transition. It will be removed in the future.
2014-03-04doc: use the newer faviconAdrien Tétar-1/+1
2014-03-02Make visible types public in rustcSteven Fackler-1/+0
2014-03-01Publicise types/add #[allow(visible_private_types)] to a variety of places.Huon Wilson-0/+1
There's a lot of these types in the compiler libraries, and a few of the older or private stdlib ones. Some types are obviously meant to be public, others not so much.
2014-02-20move extra::test to libtestLiigo Zhuang-1/+0
2014-02-14extern mod => extern crateAlex Crichton-4/+4
This was previously implemented, and it just needed a snapshot to go through
2014-02-14Removed libextra dependency from libsyntax.HeroesGrave-1/+1
2014-02-07moved collections from libextra into libcollectionsHeroesGrave-0/+1
2014-02-05pull extra::{serialize, ebml} into a separate libserialize crateJeff Olson-0/+1
- `extra::json` didn't make the cut, because of `extra::json` required dep on `extra::TreeMap`. If/when `extra::TreeMap` moves out of `extra`, then `extra::json` could move into `serialize` - `libextra`, `libsyntax` and `librustc` depend on the newly created `libserialize` - The extensions to various `extra` types like `DList`, `RingBuf`, `TreeMap` and `TreeSet` for `Encodable`/`Decodable` were moved into the respective modules in `extra` - There is some trickery, evident in `src/libextra/lib.rs` where a stub of `extra::serialize` is set up (in `src/libextra/serialize.rs`) for use in the stage0 build, where the snapshot rustc is still making deriving for `Encodable` and `Decodable` point at extra. Big props to @huonw for help working out the re-export solution for this extra: inline extra::serialize stub fix stuff clobbered in rebase + don't reexport serialize::serialize no more globs in libserialize syntax: fix import of libserialize traits librustc: fix bad imports in encoder/decoder add serialize dep to librustdoc fix failing run-pass tests w/ serialize dep adjust uuid dep more rebase de-clobbering for libserialize fixing tests, pushing libextra dep into cfg(test) fix doc code in extra::json adjust index.md links to serialize and uuid library
2014-02-05auto merge of #12025 : lilac/rust/feature-gate-quote, r=brsonbors-0/+2
Closes #11630.
2014-02-04Replaced with a single "quote" feature gate.James Deng-2/+2
2014-02-04Register new snapshotsAlex Crichton-5/+0
2014-02-04Feature gate all quasi-quoting macros.James Deng-0/+2
2014-02-03syntax: Remove io_error usageAlex Crichton-0/+5
2014-02-02Move term, terminfo out of extra.xales-0/+1
cc #8784
2014-01-16Load macros from external modulesSteven Fackler-0/+1
2014-01-12Bump version to 0.10-preBrian Anderson-1/+1
2014-01-09libsyntax: Renamed types, traits and enum variants to CamelCase.Eduard Burtescu-0/+2
2014-01-07doc: Add rustc and syntax to the indexBrian Anderson-4/+12
2014-01-02Bump version to 0.9Brian Anderson-1/+1
2013-12-29Rename PkgId to CrateIdLuis de Bethencourt-1/+1
2013-12-26Register new snapshotsAlex Crichton-2/+0
2013-12-19Rename pkgid to crate_idCorey Richardson-0/+2
Closes #11035
2013-12-15Register new snapshotsAlex Crichton-7/+1
Understand 'pkgid' in stage0. As a bonus, the snapshot now contains now metadata (now that those changes have landed), and the snapshot download is half as large as it used to be!
2013-12-10Make crate hash stable and externally computable.Jack Moffitt-0/+3
This replaces the link meta attributes with a pkgid attribute and uses a hash of this as the crate hash. This makes the crate hash computable by things other than the Rust compiler. It also switches the hash function ot SHA1 since that is much more likely to be available in shell, Python, etc than SipHash. Fixes #10188, #8523.
2013-12-06Link rustllvm statically, and distribute a static snapshotAlex Crichton-0/+1
In order to keep up to date with changes to the libraries that `llvm-config` spits out, the dependencies to the LLVM are a dynamically generated rust file. This file is now automatically updated whenever LLVM is updated to get kept up-to-date. At the same time, this cleans out some old cruft which isn't necessary in the makefiles in terms of dependencies. Closes #10745 Closes #10744
2013-12-03Register new snapshotsAlex Crichton-1/+0
2013-11-29Add generation of static libraries to rustcAlex Crichton-1/+2
This commit implements the support necessary for generating both intermediate and result static rust libraries. This is an implementation of my thoughts in https://mail.mozilla.org/pipermail/rust-dev/2013-November/006686.html. When compiling a library, we still retain the "lib" option, although now there are "rlib", "staticlib", and "dylib" as options for crate_type (and these are stackable). The idea of "lib" is to generate the "compiler default" instead of having too choose (although all are interchangeable). For now I have left the "complier default" to be a dynamic library for size reasons. Of the rust libraries, lib{std,extra,rustuv} will bootstrap with an rlib/dylib pair, but lib{rustc,syntax,rustdoc,rustpkg} will only be built as a dynamic object. I chose this for size reasons, but also because you're probably not going to be embedding the rustc compiler anywhere any time soon. Other than the options outlined above, there are a few defaults/preferences that are now opinionated in the compiler: * If both a .dylib and .rlib are found for a rust library, the compiler will prefer the .rlib variant. This is overridable via the -Z prefer-dynamic option * If generating a "lib", the compiler will generate a dynamic library. This is overridable by explicitly saying what flavor you'd like (rlib, staticlib, dylib). * If no options are passed to the command line, and no crate_type is found in the destination crate, then an executable is generated With this change, you can successfully build a rust program with 0 dynamic dependencies on rust libraries. There is still a dynamic dependency on librustrt, but I plan on removing that in a subsequent commit. This change includes no tests just yet. Our current testing infrastructure/harnesses aren't very amenable to doing flavorful things with linking, so I'm planning on adding a new mode of testing which I believe belongs as a separate commit. Closes #552
2013-11-28Register new snapshotsAlex Crichton-2/+0
2013-11-26Add SmallVector to libsyntaxSteven Fackler-0/+1
2013-11-26rustc: Add lint for obsolete attributesklutzy-1/+0
This also moves `#[auto_{en,de}code]` checker from syntax to lint.
2013-11-11Remove #[fixed_stack_segment] and #[rust_stack]Alex Crichton-0/+2
These two attributes are no longer useful now that Rust has decided to leave segmented stacks behind. It is assumed that the rust task's stack is always large enough to make an FFI call (due to the stack being very large). There's always the case of stack overflow, however, to consider. This does not change the behavior of stack overflow in Rust. This is still normally triggered by the __morestack function and aborts the whole process. C stack overflow will continue to corrupt the stack, however (as it did before this commit as well). The future improvement of a guard page at the end of every rust stack is still unimplemented and is intended to be the mechanism through which we attempt to detect C stack overflow. Closes #8822 Closes #10155
2013-11-08Specify package_id for rust libs, to avoid spurious warningsAndrei Formiga-0/+1
2013-11-03Rename files to match current recommendations.Chris Morgan-0/+87
New standards have arisen in recent months, mostly for the use of rustpkg, but the main Rust codebase has not been altered to match these new specifications. This changeset rectifies most of these issues. - Renamed the crate source files `src/libX/X.rs` to `lib.rs`, for consistency with current styles; this affects extra, rustc, rustdoc, rustpkg, rustuv, std, syntax. - Renamed `X/X.rs` to `X/mod.rs,` as is now recommended style, for `std::num` and `std::terminfo`. - Shifted `src/libstd/str/ascii.rs` out of the otherwise unused `str` directory, to be consistent with its import path of `std::ascii`; libstd is flat at present so it's more appropriate thus. While this removes some `#[path = "..."]` directives, it does not remove all of them, and leaves certain other inconsistencies, such as `std::u8` et al. which are actually stored in `src/libstd/num/` (one subdirectory down). No quorum has been reached on this issue, so I felt it best to leave them all alone at present. #9208 deals with the possibility of making libstd more hierarchical (such as changing the crate to match the current filesystem structure, which would make the module path `std::num::u8`). There is one thing remaining in which this repository is not rustpkg-compliant: rustpkg would have `src/std/` et al. rather than `src/libstd/` et al. I have not endeavoured to change that at this point as it would guarantee prompt bitrot and confusion. A change of that magnitude needs to be discussed first.