Commit Graph

830 Commits

Author SHA1 Message Date
Benjamin Herr
382143abd8 doc/rust.md: Demonstrate the f::<T>() syntax more often
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-02 01:07:01 +01:00
Patrick Walton
2859c1ac6d librustc: Enforce cross-crate method privacy 2013-02-28 11:32:26 -08:00
bors
292e946163 auto merge of #5106 : pnkfelix/rust/fix-docs, r=graydon
...s.  I freely admit I have not run a "make check" on this (trivial) change.
2013-02-27 19:03:41 -08:00
Patrick Walton
8d7e6ef772 libsyntax: Forbid ~mut and ~const. rs=demuting 2013-02-27 09:40:15 -08:00
Alex Crichton
df481473da Fix unused imports in the tutorials 2013-02-26 17:52:16 -05:00
bors
0e6d895ed8 auto merge of #5119 : Kimundi/rust/incoming, r=catamorphism
Removed deprecated `str()` functions in int-template.rs and uint-template.rs
2013-02-26 10:54:39 -08:00
Patrick Walton
c9dd917fad doc: Remove references to mut fields. rs=demuting 2013-02-26 10:02:36 -08:00
Marvin Löbel
42b0bacd76 Removed deprecated str() functions in int-template.rs and uint-template.rs 2013-02-26 16:38:30 +01:00
Felix S. Klock II
b8dd2d8c67 Fix typo in grammar: underscore, not minus, can appear amongst hex digits. 2013-02-25 17:30:02 +01:00
Brian Anderson
dab6a85230 core: Extract comm from pipes. #4742 2013-02-21 17:36:54 -08:00
Patrick Walton
c0defda499 librustc: Separate the rest of the trait bounds with + and stop parsing space-separated ones. rs=plussing 2013-02-21 08:29:48 -08:00
Marvin Löbel
34c39bb1c4 Rewrited section about rust tool 2013-02-19 22:19:19 +01:00
Marvin Löbel
8ee2d58683 Give the rust tool an own section in the tutorial. 2013-02-19 20:57:23 +01:00
Marvin Löbel
f684a8a56b Mention rust tool in the tutorial 2013-02-19 18:10:31 +01:00
bors
67ee95e943 auto merge of #5029 : mcpherrinm/rust/master, r=catamorphism
Added a newline to make header be a header.

(re-did pull request because I screwed up the last one)
2013-02-19 00:08:31 -08:00
Matthew McPherrin
b29476374b Missing newline causing title to not be a title 2013-02-18 23:22:36 -05:00
Armin Ronacher
99c4de7300 Fixed a typo in the documentation that points to the wrong macro (ident_to_str -> stringify) 2013-02-18 22:40:01 +00:00
Luqman Aden
178882c98f tests/tutorials: Get rid of move. 2013-02-15 02:49:55 -08:00
Nick Desaulniers
13fe167dbb remove die definition and use in doc tests 2013-02-14 17:33:16 -08:00
Chris Peterson
5a4695d407 update tutorial and manual to use new impl Trait for Type syntax 2013-02-13 23:19:27 -08:00
John Clements
6d09fc2cd8 removed reference to crate file keywords 2013-02-13 15:08:26 -08:00
Olivier Saut
4dec0d5192 Typo s/recusive/recursive/ 2013-02-08 11:45:47 +01:00
Brian Anderson
e08a805b30 Merge remote-tracking branch 'bstrie/rimov' into incoming
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-04 11:58:30 -08:00
Brian Anderson
3b396d17d6 Merge remote-tracking branch 'thestinger/old_map' into incoming
Conflicts:
	src/test/bench/core-map.rs
2013-02-03 17:56:49 -08:00
Marvin Löbel
af4972f3ce Fixed fmt!, tests, doc-tests. 2013-02-03 15:37:25 -08:00
Daniel Micay
319eeb1c79 rename map -> oldmap and mark it as deprecated
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-03 15:55:10 -05:00
Brian Anderson
9dc6938292 Merge remote-tracking branch 'nickdesaulniers/issue4524' into nocomm1 2013-02-01 11:18:58 -08:00
Nick Desaulniers
7868b6bf55 Remove fail keyword from lexer & parser and clean up remaining calls to
fail

Fix merge conflicts - Issue 4524
2013-02-01 00:15:42 -08:00
John Clements
53688addaa test cases, cleanup 2013-01-31 23:05:12 -08:00
Brian Anderson
f0c9927c26 Merge pull request #4708 from dforsyth/add_if
add if to borrowed ptr tutorial
2013-01-31 17:01:32 -08:00
Niko Matsakis
0682ad0eb9 Finalize moves-based-on-type implementation.
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-31 12:09:00 -08:00
David Forsythe
72454f401e add if to borrowed ptr tutorial 2013-01-31 09:10:15 -08:00
Ben Striegel
aa9c28ef47 Repair RIMOV damage to doc tests 2013-01-31 00:21:36 -05:00
Ben Striegel
743c1c37e8 RIMOV, round 11
Last bit of mut removal, manually cleaning up outliers
2013-01-30 23:19:40 -05:00
Patrick Walton
366812a5c3 librustc: Change self as a type to Self everywhere. r=brson 2013-01-30 19:52:45 -08:00
Felix S. Klock II
20af4d7361 Add expected failure annotation on "fixed" example to placate 'make check'. 2013-01-29 13:18:40 +01:00
Felix S. Klock II
2dda6d6f5d Formatting cleanup.
I had put a line break in to try to stress the binding of mycircle,
but generated document looks cleaner without newline.
2013-01-29 11:28:52 +01:00
Felix S. Klock II
6cabe2b902 Fixed two examples of erroneous code so their errors match expectation.
1. In the first case, the previous code was failing during type inference
   due to mismatched structure.  Fix is to use the X structure at both
   points in the code.

2. In the second case, a naive transcription that subsitutes *nothing*
   in for the omitted statements signified by "..." will actually
   compile without an error.  Furthermore, any pure code could also be
   substituted for the ellipsis and the code would compile (as the
   text already states).  So to make the example more illustrative, it
   would be better to include an impure callback, which makes the
   potential for aliasing immediately obvious to the reader.
2013-01-29 11:28:52 +01:00
Felix S. Klock II
88bec09e63 Fix two code examples in main rust tutorial.
1. The section on trait definitions of static methods should include
   a trait with a static method in the generated document.

2. The section on trait inheritance had a expression that appears
   nonsensical ("let mycircle = @mycircle") in the generated document.
   The text would be clearer (IMO) if we continued with the running
   example of CircleStruct.
2013-01-29 11:28:52 +01:00
John Clements
18f1dba510 doc typo 2013-01-25 11:58:33 -08:00
Tim Chevalier
f3ec278e46 Merge pull request #4609 from sonwow/keyword-super
Make `super` a keyword
2013-01-24 11:17:52 -08:00
Graydon Hoare
e8f4da78e7 doc: fix tutorial unsafe blocks, r=burningtree. 2013-01-23 23:21:47 -08:00
Youngsoo Son
4b2aa286d8 Make super a keyword 2013-01-24 16:07:04 +09:00
Tim Chevalier
1d1b81143b Merge pull request #4589 from sanxiyn/doc-vec-match
doc: Document pattern matching on vectors
2013-01-23 14:38:34 -08:00
Seo Sanghyeon
92e52bc95e doc: Document pattern matching on vectors 2013-01-23 22:26:47 +09:00
Seo Sanghyeon
c379d96c67 doc: Document mutable function arguments 2013-01-23 17:20:36 +09:00
Tim Chevalier
e856606c0d Merge pull request #4562 from lbonn/loglevel
doc: fix log level ids
2013-01-21 19:53:24 -08:00
Tim Chevalier
3fac6f8b54 Revert "doc: Fix tutorial-ffi xfail-tests and update SHA1() to use size_t"
This reverts commit 50c8cbb25a.
2013-01-21 19:39:45 -08:00
Chris Peterson
50c8cbb25a doc: Fix tutorial-ffi xfail-tests and update SHA1() to use size_t 2013-01-20 22:56:45 -08:00
Chris Peterson
0b6487cf2c doc: Fix tutorial typo and remove unnecessary xfail-test 2013-01-20 22:56:45 -08:00