about summary refs log tree commit diff
path: root/src/doc/rust.md
AgeCommit message (Collapse)AuthorLines
2014-07-07manual: Fix typo.Ruud van Asseldonk-3/+2
Also removes redundant newline in code block.
2014-07-04auto merge of #15378 : mdinger/rust/Issue_15333, r=alexcrichtonbors-10/+10
Here's the issue: https://github.com/rust-lang/rust/issues/15333 Tested it. It works. FYI, in case anyone doesn't know: keyboard shortcut `'` restricts text search to only links on Firefox allowing this to be checked easily.
2014-07-03Improve code reuse between trans/_match.rs and check_match.rsJakub Wieczorek-2/+0
The specialization logic for patterns is really the same in both exhaustiveness/reachability checking and codegen.
2014-07-02Fix broken link by adding commamdinger-10/+10
2014-06-29librustc: Remove the fallback to `int` for integers and `f64` forPatrick Walton-18/+17
floating point numbers for real. This will break code that looks like: let mut x = 0; while ... { x += 1; } println!("{}", x); Change that code to: let mut x = 0i; while ... { x += 1; } println!("{}", x); Closes #15201. [breaking-change]
2014-06-28auto merge of #15208 : alexcrichton/rust/snapshots, r=pcwaltonbors-1/+1
This change registers new snapshots, allowing `*T` to be removed from the language. This is a large breaking change, and it is recommended that if compiler errors are seen that any FFI calls are audited to determine whether they should be actually taking `*mut T`.
2014-06-28Rename all raw pointers as necessaryAlex Crichton-1/+1
2014-06-26auto merge of #15197 : omasanori/rust/doc-fix, r=alexcrichtonbors-1/+1
2014-06-26Fix a typo and a small syntactic error.OGINO Masanori-1/+1
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-06-24librustc: Remove the fallback to `int` from typechecking.Niko Matsakis-7/+8
This breaks a fair amount of code. The typical patterns are: * `for _ in range(0, 10)`: change to `for _ in range(0u, 10)`; * `println!("{}", 3)`: change to `println!("{}", 3i)`; * `[1, 2, 3].len()`: change to `[1i, 2, 3].len()`. RFC #30. Closes #6023. [breaking-change]
2014-06-24auto merge of #14952 : alexcrichton/rust/const-unsafe-pointers, r=brsonbors-5/+6
This does not yet change the compiler and libraries from `*T` to `*const T` as it will require a snapshot to do so. cc #7362 --- Note that the corresponding RFC, https://github.com/rust-lang/rfcs/pull/68, has not yet been accepted. It was [discussed at the last meeting](https://github.com/rust-lang/rust/wiki/Meeting-weekly-2014-06-10#rfc-pr-68-unsafe-pointers-rename-t-to-const-t) and decided to be accepted, however. I figured I'd get started on the preliminary work for the RFC that will be required regardless.
2014-06-23libsyntax: Disallow struct literals after `if`, `while`, `match`, andPatrick Walton-4/+4
`for...in`. Closes #14803. If you used a structure literal after one of these keywords, surround it in parentheses. [breaking-change]
2014-06-22Update few files after comparison traits renamingPiotr Jawniak-1/+1
There were still Total{Ord,Eq} in docs and src/etc
2014-06-21auto merge of #15029 : aturon/rust/stability-index, r=brsonbors-9/+24
This commit makes several changes to the stability index infrastructure: * Stability levels are now inherited lexically, i.e., each item's stability level becomes the default for any nested items. * The computed stability level for an item is stored as part of the metadata. When using an item from an external crate, this data is looked up and cached. * The stability lint works from the computed stability level, rather than manual stability attribute annotations. However, the lint still checks only a limited set of item uses (e.g., it does not check every component of a path on import). This will be addressed in a later PR, as part of issue #8962. * The stability lint only applies to items originating from external crates, since the stability index is intended as a promise to downstream crates. * The "experimental" lint is now _allow_ by default. This is because almost all existing crates have been marked "experimental", pending library stabilization. With inheritance in place, this would generate a massive explosion of warnings for every Rust program. The lint should be changed back to deny-by-default after library stabilization is complete. * The "deprecated" lint still warns by default. The net result: we can begin tracking stability index for the standard libraries as we stabilize, without impacting most clients. Closes #13540.
2014-06-20librustc: Put `#[unsafe_destructor]` behind a feature gate.Patrick Walton-2/+3
Closes #8142. This is not the semantics we want long-term. You can continue to use `#[unsafe_destructor]`, but you'll need to add `#![feature(unsafe_destructor)]` to the crate attributes. [breaking-change]
2014-06-18Add stability inheritanceAaron Turon-9/+24
This commit makes several changes to the stability index infrastructure: * Stability levels are now inherited lexically, i.e., each item's stability level becomes the default for any nested items. * The computed stability level for an item is stored as part of the metadata. When using an item from an external crate, this data is looked up and cached. * The stability lint works from the computed stability level, rather than manual stability attribute annotations. However, the lint still checks only a limited set of item uses (e.g., it does not check every component of a path on import). This will be addressed in a later PR, as part of issue #8962. * The stability lint only applies to items originating from external crates, since the stability index is intended as a promise to downstream crates. * The "experimental" lint is now _allow_ by default. This is because almost all existing crates have been marked "experimental", pending library stabilization. With inheritance in place, this would generate a massive explosion of warnings for every Rust program. The lint should be changed back to deny-by-default after library stabilization is complete. * The "deprecated" lint still warns by default. The net result: we can begin tracking stability index for the standard libraries as we stabilize, without impacting most clients. Closes #13540.
2014-06-18Deprecate the bytes!() macro.Simon Sapin-0/+13
Replace its usage with byte string literals, except in `bytes!()` tests. Also add a new snapshot, to be able to use the new b"foo" syntax. The src/etc/2014-06-rewrite-bytes-macros.py script automatically rewrites `bytes!()` invocations into byte string literals. Pass it filenames as arguments to generate a diff that you can inspect, or `--apply` followed by filenames to apply the changes in place. Diffs can be piped into `tip` or `pygmentize -l diff` for coloring.
2014-06-18auto merge of #14880 : SimonSapin/rust/byte-literals, r=alexcrichtonbors-6/+65
See #14646 (tracking issue) and rust-lang/rfcs#69. This does not close the tracking issue, as the `bytes!()` macro still needs to be removed. It will be later, after a snapshot is made with the changes in this PR, so that the new syntax can be used when bootstrapping the compiler.
2014-06-17Document the byte, byte string, and raw byte string literals.Simon Sapin-6/+65
2014-06-17librustc: Make addresses of immutable statics insignificant unlessPatrick Walton-4/+11
`#[inline(never)]` is used. Closes #8958. This can break some code that relied on the addresses of statics being distinct; add `#[inline(never)]` to the affected statics. [breaking-change]
2014-06-16rustc: Start accepting `*const T`Alex Crichton-5/+6
This does not yet change the compiler and libraries from `*T` to `*const T` as it will require a snapshot to do so. cc #7362
2014-06-10Remove outdated info about nested block comments. Fixes #14767Jonathan Reem-2/+2
2014-06-09Convert libraries to use #[plugin_registrar]Keegan McAllister-3/+2
2014-06-09Use phase(plugin) in other cratesKeegan McAllister-1/+1
2014-06-06doc: Turn off special features for rustdoc testsAlex Crichton-0/+3
These were only used for the markdown tests, and there's no reason they should be distinct from the other tests.
2014-06-06auto merge of #14680 : Kimundi/rust/master, r=brsonbors-18/+18
Also updated/corrected a few other details in the tuple and struct sections.
2014-06-06Change to_str().to_string() to just to_str()Adolfo Ochagavía-1/+1
2014-06-05Purged "record" from the manual.Marvin Löbel-18/+18
Also updated/corrected a few other details in the tuple and struct sections.
2014-06-02auto merge of #14601 : skade/rust/remove-notrust-tags, r=alexcrichtonbors-41/+41
Now that rustdoc understands proper language tags as the code not being Rust, we can tag everything properly. `norust` as a negative statement is a bad tag. This change tags examples in other languages by their language. Plain notations are marked as `text`. Console examples are marked as `console`. Also fix markdown.rs to not highlight non-rust code. Amends the documentation to reflect the new behaviour.
2014-06-02doc: Remove use of `pub use` globsklutzy-3/+3
2014-06-02docs: Stop using `notrust`Florian Gilcher-41/+41
Now that rustdoc understands proper language tags as the code not being Rust, we can tag everything properly. This change tags examples in other languages by their language. Plain notations are marked as `text`. Console examples are marked as `console`. Also fix markdown.rs to not highlight non-rust code.
2014-05-31auto merge of #14553 : reem/rust/nuke-owned-vectors, r=alexcrichtonbors-10/+10
I removed all remaining deprecated owned vectors from the docs. All example tests pass.
2014-05-30Remove deprecated owned vector from rust.mdJonathan Reem-10/+10
2014-05-30std: Rename {Eq,Ord} to Partial{Eq,Ord}Alex Crichton-13/+13
This is part of the ongoing renaming of the equality traits. See #12517 for more details. All code using Eq/Ord will temporarily need to move to Partial{Eq,Ord} or the Total{Eq,Ord} traits. The Total traits will soon be renamed to {Eq,Ord}. cc #12517 [breaking-change]
2014-05-29auto merge of #14488 : SimonSapin/rust/patch-11, r=alexcrichtonbors-0/+1
According to the corresponding section, accessing a mutable static variable requires `unsafe` too, and I believe it counts as as language level feature. Add it to the relevant list in the Unsafety section.
2014-05-28auto merge of #14465 : Ryman/rust/patch-1, r=alexcrichtonbors-1/+1
2014-05-28Doc: `static mut` is unsafe tooSimon Sapin-0/+1
According to the corresponding section, accessing a mutable static variable requires `unsafe` too, and I believe it counts as as language level feature. Add it to the relevant list in the Unsafety section.
2014-05-27rust manual: supertraits seperator is wrongRyman-1/+1
2014-05-27std: Rename strbuf operations to stringRicho Healey-3/+3
[breaking-change]
2014-05-27std: Remove String's to_ownedRicho Healey-1/+1
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-11/+11
[breaking-change]
2014-05-24Get "make check" to work with unused-attributeSteven Fackler-0/+1
There's a fair number of attributes that have to be whitelisted since they're either looked for by rustdoc, in trans, or as needed. These can be cleaned up in the future.
2014-05-20auto merge of #14277 : pczarn/rust/manual-grammar, r=alexcrichtonbors-9/+9
The grammar for use declarations was outdated. Corrected some other mistakes.
2014-05-20Correct EBNF grammar in the manualPiotr Czarnecki-9/+9
The grammar for use declarations was outdated.
2014-05-19Minor doc fixes in various placesPiotr Jawniak-5/+5
2014-05-16doc: Remove all uses of `~str` from the documentation.Patrick Walton-13/+13
2014-05-15Add a crate for missing stubs from libcoreAlex Crichton-0/+2
The core library in theory has 0 dependencies, but in practice it has some in order for it to be efficient. These dependencies are in the form of the basic memory operations provided by libc traditionally, such as memset, memcmp, etc. These functions are trivial to implement and themselves have 0 dependencies. This commit adds a new crate, librlibc, which will serve the purpose of providing these dependencies. The crate is never linked to by default, but is available to be linked to by downstream consumers. Normally these functions are provided by the system libc, but in other freestanding contexts a libc may not be available. In these cases, librlibc will suffice for enabling execution with libcore. cc #10116
2014-05-13Replaced ~T by Box<T> in manualAdolfo Ochagavía-9/+9
2014-05-12doc: Update the linkage documentationAlex Crichton-26/+26
After allowing mixing rlibs and dylibs in #13892, the documentation was not updated accordingly to reflect this new capability.
2014-05-12doc: updates rust manual (loop to continue)Piotr Jawniak-11/+9
Keyword for continue expressions was changed from loop to continue, but the manual was not updated.