summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2014-03-31Bump version to 0.10Alex Crichton-26/+26
2014-03-30Rename `from_iterator` to `from_iter` for consistency.Brian Anderson-1/+1
2014-03-30Removed deprecated functions `map` and `flat_map` for vectors and slices.Marvin Löbel-1/+4
2014-03-28auto merge of #13168 : jankobler/rust/verify-grammar-02, r=brsonbors-15/+16
This fixes some problems with make verify-grammar llnextgen still reports a lot of errors FYI: My build directory /my-test/build is different from the source directory /my-test/rust. cd /my-test/build /my-test/rust/configure --prefix=/my-test/bin make make install make verify-grammar
2014-03-28Rename Pod into CopyFlavio Percoco-3/+3
Summary: So far, we've used the term POD "Plain Old Data" to refer to types that can be safely copied. However, this term is not consistent with the other built-in bounds that use verbs instead. This patch renames the Pod kind into Copy. RFC: 0003-opt-in-builtin-traits Test Plan: make check Reviewers: cmr Differential Revision: http://phabricator.octayn.net/D3
2014-03-27doc: Update the tutorial about bounds for traitsAlex Crichton-15/+17
2014-03-27verify-grammar llnextgenJan Kobler-15/+15
When calling make verify-grammar a lot of errors are reported by llnextgen. Only simple errors like: missing semicolons, missing single quotes, usage of parentheses instead of squared brackets or usage of single quote instead of double quote are fixed by this patch. This can only be tested, when llnextgen is installed. Signed-off-by: Jan Kobler <eng1@koblersystems.de>
2014-03-27verify-grammar keyword crateJan Kobler-0/+1
When calling make verify-grammar or when llnextgen is not installed: python2.7 src/etc/extract_grammar.py <src/doc/rust.md an error is reported by extract_grammar.py that the keyword "crate" is not defined. This patch adds the keyword "crate" to the grammar in rust.md. Signed-off-by: Jan Kobler <eng1@koblersystems.de>
2014-03-26auto merge of #13117 : alexcrichton/rust/no-crate-map, r=brsonbors-5/+27
This can be done now that logging has been moved out and libnative is the default (not libgreen)
2014-03-25auto merge of #13106 : CLUSTERfoo/rust/docs/labelled_breaks, r=brsonbors-4/+61
* Include tip given by Leo Testard in mailing list about labeled `break` and `continue`: https://mail.mozilla.org/pipermail/rust-dev/2014-March/009145.html * cross-reference named lifetimes in tutorial -> lifetimes guide * Broke named lifetimes section into two sub-sections. * Added mention of `'static` lifetime.
2014-03-24auto merge of #12900 : alexcrichton/rust/rewrite-sync, r=brsonbors-2/+2
* Remove clone-ability from all primitives. All shared state will now come from the usage of the primitives being shared, not the primitives being inherently shareable. This allows for fewer allocations for stack-allocated primitives. * Add `Mutex<T>` and `RWLock<T>` which are stack-allocated primitives for purely wrapping a piece of data * Remove `RWArc<T>` in favor of `Arc<RWLock<T>>` * Remove `MutexArc<T>` in favor of `Arc<Mutex<T>>` * Shuffle around where things are located * The `arc` module now only contains `Arc` * A new `lock` module contains `Mutex`, `RWLock`, and `Barrier` * A new `raw` module contains the primitive implementations of `Semaphore`, `Mutex`, and `RWLock` * The Deref/DerefMut trait was implemented where appropriate * `CowArc` was removed, the functionality is now part of `Arc` and is tagged with `#[experimental]`. * The crate now has #[deny(missing_doc)] * `Arc` now supports weak pointers This is not a large-scale rewrite of the functionality contained within the `sync` crate, but rather a shuffling of who does what an a thinner hierarchy of ownership to allow for better composability.
2014-03-24test: Update all tests with the sync changesAlex Crichton-2/+2
2014-03-24doc: Update the runtime guide with green changesAlex Crichton-5/+27
This updates a few code examples about booting libgreen/libnative and also spells out how the event loop factory is required.
2014-03-24Correct overly broad definition of `'static` kind bound.Felix S. Klock II-2/+3
While double-checking my understanding of the meaning of `'static`, I made the following test program: ```rust fn foo<X:'static>(_x: X) { } #[cfg(not(acceptable))] fn bar() { let a = 3; let b = &a; foo(b); } #[cfg(acceptable)] fn bar() { static c : int = 4;; let d : &'static int = &c; foo(d); } fn main() { bar(); } ``` Transcript of compiling above program, illustrating that the `--cfg acceptable` variant of `bar` compiles successfully, showing that the `'static` kind bound only disallows non-`static` references, not *all* references: ``` % rustc --version /Users/fklock/opt/rust-dbg/bin/rustc 0.10-pre (caf17fe 2014-03-21 02:21:50 -0700) host: x86_64-apple-darwin % rustc /tmp/s.rs /tmp/s.rs:7:5: 7:8 error: instantiating a type parameter with an incompatible type `&int`, which does not fulfill `'static` /tmp/s.rs:7 foo(b); ^~~ error: aborting due to previous error % rustc --cfg acceptable /tmp/s.rs % ./s % ``` (Note that the explicit type annotation on `let d : &'static int` is necessary; it did not suffice for me to just write `let d = &'static c;`. That might be a latent bug, I am not sure yet.) Anyway, a fix to the documentation seemed prudent.
2014-03-24Added suggested notesnoam-2/+39
* Note on while loop not supporting named breaks. * Note on hygienic macros (and example of such within loops)
2014-03-23docs: named lifetimesnoam-4/+24
* Include tip given by Leo Testard in mailing list about labeled `break` and `continue`: https://mail.mozilla.org/pipermail/rust-dev/2014-March/009145.html * cross-reference named lifetimes in tutorial -> lifetimes guide * Broke named lifetimes section into two sub-sections. * Added mention of `'static` lifetime.
2014-03-22auto merge of #13084 : Havvy/rust/master, r=alexcrichtonbors-7/+7
The indentation looks off in the guide because the main() function is not shown, so I'm dedenting the visible function.
2014-03-22auto merge of #13076 : FlaPer87/rust/remove-freeze, r=alexcrichtonbors-14/+6
This PR removes the `Freeze` kind and the `NoFreeze` marker completely. Fixes #12577 cc @nikomatsakis r?
2014-03-22Unindent stringifier() in tasks guideRyan Scheel (Havvy)-7/+7
2014-03-22doc: Remove Freeze / NoFreeze from docsFlavio Percoco-14/+6
2014-03-21Copy-edit a sentence about borrowing referencesMatt Brubeck-1/+1
2014-03-20auto merge of #13023 : thestinger/rust/deep_clone, r=alexcrichtonbors-2/+2
2014-03-20Mention Share in the tutorialFlavio Percoco-0/+4
2014-03-20Mention share in guide-unsafe instead of freezeFlavio Percoco-2/+2
2014-03-20rename std::vec -> std::sliceDaniel Micay-18/+18
Closes #12702
2014-03-20rm obsolete references to `DeepClone`Daniel Micay-2/+2
2014-03-18Typo fixes.Lindsey Kuper-9/+9
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-15Test fixes and rebase conflictsAlex Crichton-0/+1
This commit switches over the backtrace infrastructure from piggy-backing off the RUST_LOG environment variable to using the RUST_BACKTRACE environment variable (logging is now disabled in libstd).
2014-03-15log: Introduce liblog, the old std::loggingAlex Crichton-4/+7
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-15doc: Remove reference to the 'extra' libraryAlex Crichton-1/+0
Forgot to remove this as part of the previous removal of libextra
2014-03-14auto merge of #12896 : alexcrichton/rust/goodbye-extra, r=brsonbors-13/+4
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-14auto merge of #12887 : huonw/rust/danger-guide, r=alexcrichtonbors-79/+607
docs: begin a "low-level & unsafe code" guide. This aims to cover the basics of writing safe unsafe code. At the moment it is just designed to be a better place for the `asm!()` docs than the detailed release notes wiki page, and I took the time to write up some other things. More examples are needed, especially of things that can subtly go wrong; and vast areas of `unsafe`-ty aren't covered, e.g. `static mut`s and thread-safety in general.
2014-03-15docs: begin a "low-level & unsafe code" guide.Huon Wilson-79/+607
This aims to cover the basics of writing safe unsafe code. At the moment it is just designed to be a better place for the `asm!()` docs than the detailed release notes wiki page, and I took the time to write up some other things. More examples are needed, especially of things that can subtly go wrong; and vast areas of `unsafe`-ty aren't covered, e.g. `static mut`s and thread-safety in general.
2014-03-14extra: Put the nail in the coffin, delete libextraAlex Crichton-13/+4
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-14auto merge of #12869 : thestinger/rust/cmp, r=brsonbors-2/+0
The `Float` trait provides correct `min` and `max` methods on floating point types, providing a consistent result regardless of the order the parameters are passed. These generic functions do not take the necessary performance hit to correctly support a partial order, so the true requirement should be given as a type bound. Closes #12712
2014-03-14cmp: switch `min` and `max` to `TotalOrd`Daniel Micay-2/+0
The `Float` trait provides correct `min` and `max` methods on floating point types, providing a consistent result regardless of the order the parameters are passed. These generic functions do not take the necessary performance hit to correctly support a partial order, so the true requirement should be given as a type bound. Closes #12712
2014-03-13auto merge of #12815 : alexcrichton/rust/chan-rename, r=brsonbors-67/+64
* Chan<T> => Sender<T> * Port<T> => Receiver<T> * Chan::new() => channel() * constructor returns (Sender, Receiver) instead of (Receiver, Sender) * local variables named `port` renamed to `rx` * local variables named `chan` renamed to `tx` Closes #11765
2014-03-13std: Rename Chan/Port types and constructorAlex Crichton-67/+64
* Chan<T> => Sender<T> * Port<T> => Receiver<T> * Chan::new() => channel() * constructor returns (Sender, Receiver) instead of (Receiver, Sender) * local variables named `port` renamed to `rx` * local variables named `chan` renamed to `tx` Closes #11765
2014-03-13Remove Rc's borrow method to avoid conflicts with RefCell's borrow in ↵Eduard Burtescu-1/+1
Rc<RefCell<T>>.
2014-03-12docs: add two unlisted libraries to the index page.Huon Wilson-0/+2
2014-03-12Remove remaining nolink usages.(fixes #12810)lpy-1/+0
2014-03-12Update users for the std::rand -> librand move.Huon Wilson-7/+7
2014-03-11doc: remove outdated tutorial entry, restore removed Makefile entriesAdrien Tétar-6/+3
2014-03-11doc: auto-generate LaTeX includesAdrien Tétar-7/+0
2014-03-09doc: CSS fixesAdrien Tétar-10/+24
- fixup and refactor highlighting code - have a proper print stylesheet
2014-03-09doc: remove node.js dependencyAdrien Tétar-692/+2
`prep.js` outputs its own HTML directives, which `pandoc` cannot recognize when converting the document into LaTeX (this is why the PDF docs have never been highlighted as of now). Note that if we were to add the `.rust` class to snippets, we could probably use pandoc's native highlighting capatibilities i.e. Kate.
2014-03-09docs: render rustdoc docs with rustdoc, hack around sundown code-fenceHuon Wilson-39/+54
parsing limitations. Sundown parses ``` ~~~ as a valid codeblock (i.e. mismatching delimiters), which made using rustdoc on its own documentation impossible (since it used nested codeblocks to demonstrate how testable codesnippets worked). This modifies those snippets so that they're delimited by indentation, but this then means they're tested by `rustdoc --test` & rendered as Rust code (because there's no way to add `notrust` to indentation-delimited code blocks). A comment is added to stop the compiler reading the text too closely, but this unfortunately has to be visible in the final docs, since that's the text on which the highlighting happens.
2014-03-09tutorial: hack a code snippet to make it compile.Huon Wilson-3/+4
This is meant to be compiling a crate, but the crate_id attribute seems to be upsetting it if the attribute is actually on the crate. I.e. this makes this test compile by putting the crate_id attribute on a function and so it's ignored. Such a hack. :(
2014-03-09mk: rewrite the documentation handling.Huon Wilson-19/+12
This converts it to be very similar to crates.mk, with a single list of the documentation items creating all the necessary bits and pieces. Changes include: - rustdoc is used to render HTML & test standalone docs - documentation building now obeys NO_REBUILD=1 - testing standalone docs now obeys NO_REBUILD=1 - L10N is slightly less broken (in particular, it shares dependencies and code with the rest of the code) - PDFs can be built for all documentation items, not just tutorial and manual - removes the obsolete & unused extract-tests.py script - adjust the CSS for standalone docs to use the rustdoc syntax highlighting