about summary refs log tree commit diff
path: root/src/doc/rust.md
AgeCommit message (Collapse)AuthorLines
2014-03-20auto merge of #13023 : thestinger/rust/deep_clone, r=alexcrichtonbors-1/+1
2014-03-20rm obsolete references to `DeepClone`Daniel Micay-1/+1
2014-03-18`char`: s/character/Unicode scalar value/Simon Sapin-2/+6
Tweak the definition of `char` to use the appropriate Unicode terminology.
2014-03-15log: Introduce liblog, the old std::loggingAlex Crichton-1/+4
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-14extra: Put the nail in the coffin, delete libextraAlex Crichton-2/+2
This commit shreds all remnants of libextra from the compiler and standard distribution. Two modules, c_vec/tempfile, were moved into libstd after some cleanup, and the other modules were moved to separate crates as seen fit. Closes #8784 Closes #12413 Closes #12576
2014-03-12Remove remaining nolink usages.(fixes #12810)lpy-1/+0
2014-03-09docs: adjust code blocks to pass with rustdoc.Huon Wilson-46/+47
The changes are basically just because rustdoc runs tests/rendering on more snippets by default (i.e. everything without a `notrust` tag), and not anything significant.
2014-03-06fix typos with with repeated words, just like this sentence.Kang Seonghoon-1/+1
2014-03-05Allow overloading explicit dereferences.Eduard Burtescu-2/+5
2014-02-27Replaced @List with ~List in Rust's recursive exampleBruno de Oliveira Abinader-2/+2
2014-02-24Move extra::json to libserializeAlex Crichton-6/+6
This also inverts the dependency between libserialize and libcollections. cc #8784
2014-02-24Transition to new `Hash`, removing IterBytes and std::to_bytes.Huon Wilson-1/+1
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-21auto merge of #12411 : Arcterus/rust/time, r=alexcrichtonbors-3/+3
More work towards finishing #8784.
2014-02-21auto merge of #12362 : liigo/rust/update-rust-manual, r=alexcrichtonbors-8/+8
change `extern mod` to `extern crate`, `package id` to `crate id`, and some lines wrapping fix, etc.
2014-02-21Move time out of extra (cc #8784)Arcterus-3/+3
2014-02-21insignificant fix to rust manual and tutorialLiigo Zhuang-8/+8
2014-02-21Changed NonCamelCaseTypes lint to warn by defaultmr.Shu-5/+5
Added allow(non_camel_case_types) to librustc where necesary Tried to fix problems with non_camel_case_types outside rustc fixed failing tests Docs updated Moved #[allow(non_camel_case_types)] a level higher. markdown.rs reverted Fixed timer that was failing tests Fixed another timer
2014-02-14extern mod => extern crateAlex Crichton-10/+10
This was previously implemented, and it just needed a snapshot to go through
2014-02-13Add documentation for conditional-compilationTobias Bucher-10/+74
This documents in-source conditions using #[cfg(...)] and configurations pre-defined by the compiler. Fix #7962.
2014-02-10Consolidate codegen-related compiler flagsAlex Crichton-1/+1
Move them all behind a new -C switch. This migrates some -Z flags and some top-level flags behind this -C codegen option. The -C flag takes values of the form "-C name=value" where the "=value" is optional for some flags. Flags affected: * --llvm-args => -C llvm-args * --passes => -C passes * --ar => -C ar * --linker => -C linker * --link-args => -C link-args * --target-cpu => -C target-cpu * --target-feature => -C target-fature * --android-cross-path => -C android-cross-path * --save-temps => -C save-temps * --no-rpath => -C no-rpath * -Z no-prepopulate => -C no-prepopulate-passes * -Z no-vectorize-loops => -C no-vectorize-loops * -Z no-vectorize-slp => -C no-vectorize-slp * -Z soft-float => -C soft-float * -Z gen-crate-map => -C gen-crate-map * -Z prefer-dynamic => -C prefer-dynamic * -Z no-integrated-as => -C no-integrated-as As a bonus, this also promotes the -Z extra-debug-info flag to a first class -g or --debuginfo flag. * -Z debug-info => removed * -Z extra-debug-info => -g or --debuginfo Closes #9770 Closes #12000
2014-02-08Update docs and tests for #[deriving(Show)].Huon Wilson-2/+3
2014-02-06auto merge of #12010 : HeroesGrave/rust/libcollection, r=alexcrichtonbors-1/+1
Part of #8784 Changes: - Everything labeled under collections in libextra has been moved into a new crate 'libcollection'. - Renamed container.rs to deque.rs, since it was no longer 'container traits for extra', just a deque trait. - Crates that depend on the collections have been updated and dependencies sorted. - I think I changed all the imports in the tests to make sure it works. I'm not entirely sure, as near the end of the tests there was yet another `use` that I forgot to change, and when I went to try again, it started rebuilding everything, which I don't currently have time for. There will probably be incompatibility between this and the other pull requests that are splitting up libextra. I'm happy to rebase once those have been merged. The tests I didn't get to run should pass. But I can redo them another time if they don't.
2014-02-07moved collections from libextra into libcollectionsHeroesGrave-1/+1
2014-02-06auto merge of #12077 : colemickens/rust/patch-1, r=alexcrichtonbors-1/+1
2014-02-06Fix a dead URLCole Mickens-1/+1
2014-02-07Removed @self and @Trait.Eduard Burtescu-6/+6
2014-02-06Redesign output flags for rustcAlex Crichton-35/+35
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-04doc: update boxes section on Manual, remove managed pointers referencesjoaoxsouls-57/+12
2014-02-02Move doc/ to src/doc/Alex Crichton-0/+3954
We generate documentation into the doc/ directory, so we shouldn't be intermingling source files with generated files