summary refs log tree commit diff
path: root/src/librustdoc/core.rs
AgeCommit message (Collapse)AuthorLines
2014-09-16Fallout from renamingAaron Turon-1/+1
2014-09-14rustdoc: fix fallout from using ptr::P.Eduard Burtescu-53/+42
2014-09-08rustdoc: fix fallout from the addition of a 'tcx lifetime on tcx.Eduard Burtescu-16/+18
2014-09-07Changed addl_lib_search_paths from HashSet to Vecinrustwetrust-3/+3
This makes the extra library paths given to the gcc linker come in the same order as the -L options on the rustc command line.
2014-07-25rustdoc: Add a --target flagAlex Crichton-3/+6
Closes #13893
2014-07-21rustdoc: Add an --extern flag analagous to rustc'sTom Jakubowski-3/+6
This adds an `--extern` flag to `rustdoc` much like the compiler's to specify the path where a given crate can be found.
2014-07-21rustc: Pass optional additional plugins to compile_inputBrian Anderson-1/+1
This provides a way for clients of the rustc library to add their own features to the pipeline.
2014-07-11Add scaffolding for assigning alpha-numeric codes to rustc diagnosticsJakub Wieczorek-1/+1
2014-07-05rustc: Default #[crate_name] on input, not outputAlex Crichton-5/+2
2014-07-05rustc: Remove CrateId and all related supportAlex Crichton-3/+11
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-06-30rustdoc: incorporate stability index throughoutAaron Turon-1/+14
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-24Convert builtin lints to uppercase names for style consistencyKeegan McAllister-1/+1
2014-06-24Store the registered lints in the SessionKeegan McAllister-2/+4
2014-06-24Replace enum LintId with an extensible alternativeKeegan McAllister-1/+3
2014-06-24Move lint.rs out of middleKeegan McAllister-1/+1
We're going to have more modules under lint, and the paths get unwieldy. We also plan to have lints run at multiple points in the compilation pipeline.
2014-06-14rustc: Obsolete the `@` syntax entirelyAlex Crichton-0/+1
This removes all remnants of `@` pointers from rustc. Additionally, this removes the `GC` structure from the prelude as it seems odd exporting an experimental type in the prelude by default. Closes #14193 [breaking-change]
2014-06-11rustc: Move the AST from @T to Gc<T>Alex Crichton-3/+3
2014-06-09Implement #[plugin_registrar]Keegan McAllister-3/+2
See RFC 22. [breaking-change]
2014-06-05Fallout from the libcollections movementAlex Crichton-1/+1
2014-05-31rustdoc: Suck in all impls from external cratesAlex Crichton-0/+2
There is currently no way to query all impls for a type from an external crate, and with primitive types in play this is also quite difficult. Instead of filtering, just suck in all impls from upstream crates into the local AST, and have them get stripped later. This will allow population of all implementations of traits for primitive types, as well as filling in some corner cases with inlining documentation in other cases.
2014-05-27rustdoc: Only link to local inlined foreign itemsAlex Crichton-0/+6
This commit alters rustdoc to keep a hash set of known inlined items which is a whitelist for generating URLs to. Closes #14438
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-5/+5
[breaking-change]
2014-05-22rustdoc: Fill in external trait methodsAlex Crichton-1/+13
This commit alters rustdoc to crawl the metadata of upstream libraries in order to fill in default methods for traits implemented in downstream crates. This, for example, documents the `insert` function on hash maps. This is a fairly lossy extraction from the metadata. Documentation and attributes are lost, but they aren't used anyway. Unfortunately, argument names are also lost because they are not present in the metadata. Source links are also lost because the spans are not serialized. While not perfect, it appears that presenting this documentation through rustdoc is much better than nothing, so I wanted to land this to allow iteration on it later on.
2014-05-21rustc: rename the lint `level` enum for style.Huon Wilson-1/+1
CamelCase all the way!
2014-05-19rustc: Add official support for weak failureAlex Crichton-1/+1
This commit is part of the ongoing libstd facade efforts (cc #13851). The compiler now recognizes some language items as "extern { fn foo(...); }" and will automatically perform the following actions: 1. The foreign function has a pre-defined name. 2. The crate and downstream crates can only be built as rlibs until a crate defines the lang item itself. 3. The actual lang item has a pre-defined name. This is essentially nicer compiler support for the hokey core-depends-on-std-failure scheme today, but it is implemented the same way. The details are a little more hidden under the covers. In addition to failure, this commit promotes the eh_personality and rust_stack_exhausted functions to official lang items. The compiler can generate calls to these functions, causing linkage errors if they are left undefined. The checking for these items is not as precise as it could be. Crates compiling with `-Z no-landing-pads` will not need the eh_personality lang item, and crates compiling with no split stacks won't need the stack exhausted lang item. For ease, however, these items are checked for presence in all final outputs of the compiler. It is quite easy to define dummy versions of the functions necessary: #[lang = "stack_exhausted"] extern fn stack_exhausted() { /* ... */ } #[lang = "eh_personality"] extern fn eh_personality() { /* ... */ } cc #11922, rust_stack_exhausted is now a lang item cc #13851, libcollections is blocked on eh_personality becoming weak
2014-05-15Add compiler flag to configure output coloringHanno Braun-1/+1
This adds the flag --color, which allows the user to force coloring or turn it off. The default behavior stays the same as before (colorize, if output goes to tty). Why this is beneficial is explained in issue #12881. Please note that this commit doesn't include any regression tests. I thought about how I'd write a test for this and it doesn't seem to be worth the effort to me for a UI change like this. Fixes #12881.
2014-05-12librustdoc: Remove all `~str` usage from librustdoc.Patrick Walton-4/+4
2014-05-11Reorganise driver code.Nick Cameron-7/+8
The goal of this refactoring is to make the rustc driver code easier to understand and use. Since this is as close to an API as we have, I think it is important that it is nice. On getting stuck in, I found that there wasn't as much to change as I'd hoped to make the stage... fns easier to use by tools. This patch only moves code around - mostly just moving code to different files, but a few extracted method refactorings too. To summarise the changes: I added driver::config which handles everything about configuring the compiler. driver::session now just defines and builds session objects. I moved driver code from librustc/lib.rs to librustc/driver/mod.rs so all the code is one place. I extracted methods to make emulating the compiler without being the compiler a little easier. Within the driver directory, I moved code around to more logically fit in the modules.
2014-05-09rustdoc: Hyperlink cross-crate reexportsAlex Crichton-1/+10
This should improve the libcore experience quite a bit when looking at the libstd documentation.
2014-05-07std: Modernize the local_data apiAlex Crichton-2/+1
This commit brings the local_data api up to modern rust standards with a few key improvements: * The `pop` and `set` methods have been combined into one method, `replace` * The `get_mut` method has been removed. All interior mutability should be done through `RefCell`. * All functionality is now exposed as a method on the keys themselves. Instead of importing std::local_data, you now use "key.replace()" and "key.get()". * All closures have been removed in favor of RAII functionality. This means that get() and get_mut() no long require closures, but rather return Option<SmartPointer> where the smart pointer takes care of relinquishing the borrow and also implements the necessary Deref traits * The modify() function was removed to cut the local_data interface down to its bare essentials (similarly to how RefCell removed set/get). [breaking-change]
2014-05-03rustdoc: Stop requiring a crate ID attributeAlex Crichton-2/+4
This is mostly just an artificial requirement as it can use similar logic to the compiler to infer the crate id.
2014-05-03rustdoc: Don't have rustc emit warningsAlex Crichton-0/+2
They're much more useful when building code, much less so when building documentation. Closes #13894
2014-03-31rustdoc: Switch field privacy as necessaryAlex Crichton-4/+4
2014-03-21test: Make manual changes to deal with the fallout from removal ofPatrick Walton-3/+4
`~[T]` in test, libgetopts, compiletest, librustdoc, and libnum.
2014-03-17Fix rustdoc and tests.Eduard Burtescu-7/+5
2014-03-17De-@ filesearch.Eduard Burtescu-2/+2
2014-03-17De-@ Session usage.Eduard Burtescu-13/+26
2014-03-15log: Introduce liblog, the old std::loggingAlex Crichton-1/+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-08librustdoc: Fix librustdoc for the `Vec<T>` change.Patrick Walton-1/+1
2014-02-28rustdoc: Capture all output from rustc by defaultAlex Crichton-1/+1
This helps prevent interleaving of error messages when running rustdoc tests. This has an interesting bit of shuffling with I/O handles, but other than that this is just using the APIs laid out in the previous commit. Closes #12623
2014-02-23Move std::{trie, hashmap} to libcollectionsAlex Crichton-1/+1
These two containers are indeed collections, so their place is in libcollections, not in libstd. There will always be a hash map as part of the standard distribution of Rust, but by moving it out of the standard library it makes libstd that much more portable to more platforms and environments. This conveniently also removes the stuttering of 'std::hashmap::HashMap', although 'collections::HashMap' is only one character shorter.
2014-02-13Replace `crate` usage with `krate`Flavio Percoco-9/+9
This patch replaces all `crate` usage with `krate` before introducing the new keyword. This ensures that after introducing the keyword, there won't be any compilation errors. krate might not be the most expressive substitution for crate but it's a very close abbreviation for it. `module` was already used in several places already.
2014-02-11Remove binary fieldSeo Sanghyeon-1/+0
2014-02-07Removed @self and @Trait.Eduard Burtescu-4/+2
2014-02-06Redesign output flags for rustcAlex Crichton-1/+1
This commit removes the -c, --emit-llvm, -s, --rlib, --dylib, --staticlib, --lib, and --bin flags from rustc, adding the following flags: * --emit=[asm,ir,bc,obj,link] * --crate-type=[dylib,rlib,staticlib,bin,lib] The -o option has also been redefined to be used for *all* flavors of outputs. This means that we no longer ignore it for libraries. The --out-dir remains the same as before. The new logic for files that rustc emits is as follows: 1. Output types are dictated by the --emit flag. The default value is --emit=link, and this option can be passed multiple times and have all options stacked on one another. 2. Crate types are dictated by the --crate-type flag and the #[crate_type] attribute. The flags can be passed many times and stack with the crate attribute. 3. If the -o flag is specified, and only one output type is specified, the output will be emitted at this location. If more than one output type is specified, then the filename of -o is ignored, and all output goes in the directory that -o specifies. The -o option always ignores the --out-dir option. 4. If the --out-dir flag is specified, all output goes in this directory. 5. If -o and --out-dir are both not present, all output goes in the current directory of the process. 6. When multiple output types are specified, the filestem of all output is the same as the name of the CrateId (derived from a crate attribute or from the filestem of the crate file). Closes #7791 Closes #11056 Closes #11667
2014-02-06Avoid cloning ast::CrateConfigSeo Sanghyeon-2/+2
2014-02-02libsyntax: Introduce an `InternedString` type to reduce `@str` in thePatrick Walton-1/+3
compiler and use it for attributes
2014-01-27debuginfo: Fix name attribute for DWARF compile unitsMichael Woerister-2/+2
2014-01-17rustc::driver: Capitalize structs and enumsklutzy-3/+3
driver::session::crate_metadata is unused; removed.
2014-01-16Load macros from external modulesSteven Fackler-1/+3