about summary refs log tree commit diff
path: root/doc
AgeCommit message (Collapse)AuthorLines
2013-03-18librustc: Make the compiler ignore purity.Patrick Walton-58/+21
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: Remove implicit self from the language, except for old-style drop ↵Patrick Walton-2/+2
blocks.
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-65/+12
2013-03-11librustc: Lint the old `drop` destructor notation offPatrick Walton-15/+15
2013-03-11doc: Remove documentation on newtype enums.Patrick Walton-44/+36
2013-03-07librustc: Convert all uses of `assert` over to `fail_unless!`Patrick Walton-31/+20
2013-03-06Add manual &self/ and &static/ and /&self declarations thatNiko Matsakis-12/+13
are currently inferred. New rules are coming that will require them to be explicit. All add some explicit self declarations.
2013-03-02test: Remove `fn@`, `fn~`, and `fn&` from the test suite. rs=defunPatrick Walton-3/+2
2013-03-02librustc: Forbid chained imports and fix the logic for one-level renaming ↵Patrick Walton-44/+43
imports
2013-03-02auto merge of #5137 : yjh0502/rust/empty_struct, r=nikomatsakisbors-100/+20
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-100/+20
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-28librustc: Enforce cross-crate method privacyPatrick Walton-2/+1
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-27libsyntax: Forbid `~mut` and `~const`. rs=demutingPatrick Walton-1/+1
2013-02-26Fix unused imports in the tutorialsAlex Crichton-3/+2
2013-02-26auto merge of #5119 : Kimundi/rust/incoming, r=catamorphismbors-1/+1
Removed deprecated `str()` functions in int-template.rs and uint-template.rs
2013-02-26doc: Remove references to mut fields. rs=demutingPatrick Walton-181/+25
2013-02-26Removed deprecated `str()` functions in int-template.rs and uint-template.rsMarvin Löbel-1/+1
2013-02-25Fix typo in grammar: underscore, not minus, can appear amongst hex digits.Felix S. Klock II-1/+1
2013-02-21core: Extract comm from pipes. #4742Brian Anderson-10/+10
2013-02-21librustc: Separate the rest of the trait bounds with `+` and stop parsing ↵Patrick Walton-2/+2
space-separated ones. rs=plussing
2013-02-19Rewrited section about rust toolMarvin Löbel-11/+8
2013-02-19Give the rust tool an own section in the tutorial.Marvin Löbel-2/+21
2013-02-19Mention rust tool in the tutorialMarvin Löbel-3/+4
2013-02-19auto merge of #5029 : mcpherrinm/rust/master, r=catamorphismbors-0/+1
Added a newline to make header be a header. (re-did pull request because I screwed up the last one)
2013-02-18Missing newline causing title to not be a titleMatthew McPherrin-0/+1
2013-02-18Fixed a typo in the documentation that points to the wrong macro ↵Armin Ronacher-1/+1
(ident_to_str -> stringify)
2013-02-15tests/tutorials: Get rid of `move`.Luqman Aden-13/+13
2013-02-14remove die definition and use in doc testsNick Desaulniers-20/+20
2013-02-13update tutorial and manual to use new `impl Trait for Type` syntaxChris Peterson-29/+28
2013-02-13removed reference to crate file keywordsJohn Clements-7/+1
2013-02-08Typo s/recusive/recursive/Olivier Saut-1/+1
2013-02-04Merge remote-tracking branch 'bstrie/rimov' into incomingBrian Anderson-10/+6
Conflicts: src/libsyntax/parse/parser.rs src/test/bench/graph500-bfs.rs src/test/bench/sudoku.rs src/test/run-pass/borrowck-mut-vec-as-imm-slice.rs src/test/run-pass/empty-mutable-vec.rs src/test/run-pass/foreach-nested.rs src/test/run-pass/swap-2.rs
2013-02-03Merge remote-tracking branch 'thestinger/old_map' into incomingBrian Anderson-3/+3
Conflicts: src/test/bench/core-map.rs
2013-02-03Fixed `fmt!`, tests, doc-tests.Marvin Löbel-6/+6
2013-02-03rename map -> oldmap and mark it as deprecatedDaniel Micay-3/+3
LinearMap is quite a bit faster, and is fully owned/sendable without requiring copies. The older std::map also doesn't use explicit self and relies on mutable fields.
2013-02-01Merge remote-tracking branch 'nickdesaulniers/issue4524' into nocomm1Brian Anderson-40/+27
2013-02-01Remove fail keyword from lexer & parser and clean up remaining calls toNick Desaulniers-40/+27
fail Fix merge conflicts - Issue 4524
2013-01-31test cases, cleanupJohn Clements-0/+3
2013-01-31Merge pull request #4708 from dforsyth/add_ifBrian Anderson-1/+1
add if to borrowed ptr tutorial
2013-01-31Finalize moves-based-on-type implementation.Niko Matsakis-3/+3
Changes: - Refactor move mode computation - Removes move mode arguments, unary move, capture clauses (though they still parse for backwards compatibility) - Simplify how moves are handled in trans - Fix a number of illegal copies that cropped up - Workaround for bug involving def-ids in params (see details below) Future work (I'll open bugs for these...): - Improve error messages for moves that are due to bindings - Add support for moving owned content like a.b.c to borrow check, test in trans (but I think it'll "just work") - Proper fix for def-ids in params Def ids in params: Move captures into a map instead of recomputing. This is a workaround for a larger bug having to do with the def-ids associated with ty_params, which are not always properly preserved when inlining. I am not sure of my preferred fix for the larger bug yet. This current fix removes the only code in trans that I know of which relies on ty_param def-ids, but feels fragile.
2013-01-31add if to borrowed ptr tutorialDavid Forsythe-1/+1
2013-01-31Repair RIMOV damage to doc testsBen Striegel-7/+6
2013-01-30RIMOV, round 11Ben Striegel-10/+7
Last bit of mut removal, manually cleaning up outliers
2013-01-30librustc: Change `self` as a type to `Self` everywhere. r=brsonPatrick Walton-4/+4