about summary refs log tree commit diff
path: root/doc/rust.md
AgeCommit message (Collapse)AuthorLines
2013-05-14Use static string with fail!() and remove fail!(fmt!())Björn Steinbrink-2/+2
fail!() used to require owned strings but can handle static strings now. Also, it can pass its arguments to fmt!() on its own, no need for the caller to call fmt!() itself.
2013-05-13auto merge of #6417 : pcwalton/rust/exprs-in-patterns, r=pcwaltonbors-41/+40
r? @graydon
2013-05-13doc: document the #[deriving] attribute.Huon Wilson-0/+43
Closes #4916.
2013-05-12libsyntax: Remove `extern mod foo { ... }` from the language.Patrick Walton-41/+40
2013-05-10Remove the '<->' operator from the languageAlex Crichton-30/+1
2013-05-03add gitattributes and fix whitespace issuesDaniel Micay-1/+0
2013-05-01Revert rename of Div to QuotBrendan Zabarauskas-3/+3
2013-04-30Revert "doc: XFAIL mysterious failure on bots"Jed Davis-1/+1
This reverts commit 2c6dae081b72d33a2c51b5f46436e6350bb3682f.
2013-04-29doc: XFAIL mysterious failure on botsPatrick Walton-1/+1
2013-04-29librustc: Change labels to use the lifetime notation `'`.Patrick Walton-3/+3
2013-04-24Fixed typo... And a billion other things.Marvin Löbel-3/+3
2013-04-22Rename Div operator trait to Quot and Modulo operator trait to RemBrendan Zabarauskas-8/+8
2013-04-07Update manual for single-element tuple typeszofrex-1/+1
2013-04-07Update manual for single-element tupleszofrex-1/+2
2013-04-04auto merge of #5703 : steveklabnik/rust/add_log_docs, r=thestingerbors-0/+22
Closes #5699.
2013-04-03One more typo: dubug -> debugSteve Klabnik-1/+1
2013-04-03typo fix: na -> anSteve Klabnik-1/+1
2013-04-03Add information about logging macros to the tutorial.Steve Klabnik-0/+22
Closes #5699.
2013-04-03rename Linear{Map,Set} => Hash{Map,Set}Daniel Micay-2/+2
2013-04-03hashmap: rm linear namespaceDaniel Micay-1/+1
2013-04-01docs: Xfail test, it's just for illustration anywayTim Chevalier-2/+2
2013-04-01docs: Document language items, as per #3342Tim Chevalier-1/+99
2013-03-29librustc: Remove `fail_unless!`Patrick Walton-4/+4
2013-03-29auto merge of #5583 : jbclements/rust/docfix-for-block-comment-grammar, ↵bors-4/+4
r=jbclements ... by adding Kleene '+' in two places, and changing a "non-slash" into "non_slash_or_star". Closes #1588
2013-03-28added defn of non_slash_or_starJohn Clements-2/+2
2013-03-28fix another subtle bug in comment regexJohn Clements-2/+2
2013-03-27fixes stated grammar for block comments, by adding Kleene '+' in two places.John Clements-2/+2
Closes #1588
2013-03-26test: Fix testsPatrick Walton-3/+3
2013-03-26librustc: Modify all code to use new lifetime binder syntaxPatrick Walton-1/+1
2013-03-26doc: Remove mentions of oldmap::HashMapAlex Crichton-3/+3
2013-03-26Updated to reflect alpha-rename of constant/static items section.Felix S. Klock II-4/+2
2013-03-26Miscellaneous documentation additions.Felix S. Klock II-1/+33
Added notes explaining how [expr, ..expr] form is used, targeted at individuals like me who thought it was more general and handled dynamic repeat expressions. (I left a TODO for this section in a comment, but perhaps that is bad form for the manual...) Added example of `do` syntax with a function of arity > 1; yes, one should be able to derive this from the text above it, but it is still a useful detail to compare and contrast against the arity == 1 case. Added example of using for expression over a uint range, since someone who is most used to write `for(int i; i < lim; i++) { ... }` will likely want to know how to translate that form (regardless of whether it happens to be good style or not for their use-case). Added note about the semi-strange meaning of "fixed size" of vectors in the vector type section.
2013-03-25docs: update to avoid mention of const.Graydon Hoare-15/+17
2013-03-22libcore: Fix obsolete syntax in extfmtPatrick Walton-10/+10
2013-03-22docs: Copyedit my randomly assigned sections of the manualTim Chevalier-132/+143
2013-03-18librustc: Make the compiler ignore purity.Patrick Walton-41/+4
For bootstrapping purposes, this commit does not remove all uses of the keyword "pure" -- doing so would cause the compiler to no longer bootstrap due to some syntax extensions ("deriving" in particular). Instead, it makes the compiler ignore "pure". Post-snapshot, we can remove "pure" from the language. There are quite a few (~100) borrow check errors that were essentially all the result of mutable fields or partial borrows of `@mut`. Per discussions with Niko I think we want to allow partial borrows of `@mut` but detect obvious footguns. We should also improve the error message when `@mut` is erroneously reborrowed.
2013-03-13test: Fix tests. rs=testsPatrick Walton-19/+19
2013-03-13librustc: Don't accept `as Trait` anymore; fix all occurrences of it.Patrick Walton-1/+1
2013-03-11Remove uses of logBrian Anderson-63/+10
2013-03-11librustc: Lint the old `drop` destructor notation offPatrick Walton-6/+6
2013-03-07librustc: Convert all uses of `assert` over to `fail_unless!`Patrick Walton-16/+5
2013-03-06Add manual &self/ and &static/ and /&self declarations thatNiko Matsakis-9/+10
are currently inferred. New rules are coming that will require them to be explicit. All add some explicit self declarations.
2013-03-02librustc: Forbid chained imports and fix the logic for one-level renaming ↵Patrick Walton-1/+1
imports
2013-03-02auto merge of #5137 : yjh0502/rust/empty_struct, r=nikomatsakisbors-95/+14
The fix is straight-forward, but there are several changes while fixing the issue. 1) disallow `mut` keyword when making a new struct In code base, there are following code, ```rust struct Foo { mut a: int }; let a = Foo { mut a: 1 }; ``` This is because of structural record, which is deprecated corrently (see issue #3089) In structural record, `mut` keyword should be allowd to control mutability. But without structural record, we don't need to allow `mut` keyword while constructing struct. 2) disallow structural records in parser level This is related to 1). With structural records, there is an ambiguity between empty block and empty struct To solve the problem, I change parser to stop parsing structural records. I think this is not a problem, because structural records are not compiled already. Misc. issues There is an ambiguity between empty struct vs. empty match stmt. with following code, ```rust match x{} {} ``` Two interpretation is possible, which is listed blow ```rust match (x{}) {} // matching with newly-constructed empty struct (match x{}) {} // matching with empty enum(or struct) x // and then empty block ``` It seems that there is no such code in rust code base, but there is one test which uses empty match statement: https://github.com/mozilla/rust/blob/incoming/src/test/run-pass/issue-3037.rs All other cases could be distinguished with look-ahead, but this can't be. One possible solution is wrapping with parentheses when matching with an uninhabited type. ```rust enum what { } fn match_with_empty(x: what) -> ~str { match (x) { //use parentheses to remove the ambiguity } } ```
2013-03-02auto merge of #5188 : ben0x539/rust/doc-call-generic-fn, r=catamorphismbors-1/+8
I have seen a few people confused on how to explicitly instantiate generic functions, since the syntax differs from C++'s and C#'s, which is probably where most people asking questions about generic functions are coming from. The only use of the `::<T>` syntax in the reference right now is in the section on paths, which is possibly not where someone trying to find out about generic functions is going to start looking. The tutorial doesn't mention it at all, but I think it's all right to make the reference a tiny bit more redundant and avoid stuffing the tutorial with syntax details. ---- The "Generic functions" subsection mentions that generic functions are instantiated based on context, so let's also mention right away (with a link to the #paths section) that an explicit form is available. This also adds an example that explicitly instantiates a generic function to the function call expression section.
2013-03-02Remove REC, change related tests/docsJihyun Yu-95/+14
2013-03-02doc/rust.md: Demonstrate the `f::<T>()` syntax more oftenBenjamin Herr-1/+8
The "Generic functions" subsection mentions that generic functions are instantiated based on context, so let's also mention right away (with a link to the #paths section) that an explicit form is available. This also adds an example to the function call expression section that explicitly instantiates a generic function.
2013-03-02docs/rust.md: Mention unit-like structs along with other struct typesBenjamin Herr-3/+21
2013-02-27auto merge of #5106 : pnkfelix/rust/fix-docs, r=graydonbors-1/+1
...s. I freely admit I have not run a "make check" on this (trivial) change.
2013-02-26Fix unused imports in the tutorialsAlex Crichton-1/+0