Commit Graph

486 Commits

Author SHA1 Message Date
zzmp
63afc08262 Allow external html in rustdoc for crates.
Updated documentation to reflect md->html.
Modularized external file loading.
2014-06-30 00:03:34 -07:00
bors
0ddf6f4b7c auto merge of #15233 : jbclements/rust/match-var-hygiene-etc, r=cmr
This PR includes two big things and a bunch of little ones.

1) It enables hygiene for variables bound by 'match' expressions.
2) It fixes a bug discovered indirectly (#15221), wherein fold traversal failed to visit nonterminal nodes.
3) It fixes a small bug in the macro tutorial.

It also adds tests for the first two, and makes a bunch of small comment improvements and cleanup.
2014-06-28 05:21:34 +00:00
John Clements
2f73b7874e looks like a cut-n-paste error in unused code 2014-06-27 22:11:11 -07:00
bors
b66c59ee5a auto merge of #15211 : steveklabnik/rust/guide_skeleton, r=huonw
This diff will look better once bors takes care of https://github.com/rust-lang/rust/pull/15183

@brson and I talked about it, and, if I commit this skeleton, I can submit PRs for each portion, without doing this silly "builds on previous PRs" stuff, and it shouldn't cause conflicts.

This lays out what I think the guide should cover, and in what order.  I haven't picked a cohesive project yet that shows all this off, but I think this progression of concepts is appropriate.
2014-06-27 11:26:25 +00:00
bors
17021944be auto merge of #15166 : zookoatleastauthoritycom/rust/13570-add-see-below-to-a-reference-to-a-new-concept-2, r=huonw
This is the same patch as submitted to https://github.com/rust-lang/rust/issues/13570 and https://github.com/rust-lang/rust/pull/14124, but with @pnkfelix's comment (https://github.com/rust-lang/rust/pull/14124#issuecomment-42797536) addressed, and with reflow as a separate commit. I'm submitting it in case @steveklabnik hasn't yet merged a rewrite of the tutorial (https://github.com/rust-lang/rust/issues/13570#issuecomment-46864789), in which case this patch might as well be merged into the old tutorial.
2014-06-27 09:41:27 +00:00
Steve Klabnik
afdb19b3b5 Skeleton outline of the guide. 2014-06-27 05:28:44 -04:00
Steve Klabnik
6bfbc35491 Add one more ignore.
Thanks @huonw
2014-06-26 21:57:46 -04:00
Steve Klabnik
aee263c6b0 Fix windows run instructions
Thank you, @stormbrew!
2014-06-26 20:49:27 -04:00
Steve Klabnik
e4b87077fb C macros, not C++ templates.
@cmr rightfully points out that C macros are worse, and share the
same name.
2014-06-26 16:58:20 -04:00
Steve Klabnik
15bcb2f9c6 Fix missing word and some grammar
Thanks @chris-morgan and @P1start! ❤️
2014-06-26 15:46:36 -04:00
Steve Klabnik
546b202e0e Note that macros != templates
Good call, @chris-morgan and @cmr!
2014-06-26 15:44:29 -04:00
Steve Klabnik
8cd906811a Clarify which curly is being referred to
Thanks @chris-morgan
2014-06-26 15:41:46 -04:00
Steve Klabnik
efc2d4a476 TIL PATHEXT
Thanks @chris-morgan ❤️
2014-06-26 15:40:52 -04:00
Steve Klabnik
c73f17486a Move note about $ up
Thanks @chris-morgan ❤️
2014-06-26 15:39:30 -04:00
Steve Klabnik
af4a6c30aa Fixing link to subreddit.
Thanks @chris-morgan ❤️
2014-06-26 15:37:57 -04:00
Steve Klabnik
49a9959d8c StackOverflow -> Stack Overflow
Thanks @chris-morgan
2014-06-26 15:36:57 -04:00
Steve Klabnik
08f533481d Fix IRC linkage.
Death to `here`!

Thanks @chris-morgan ❤️
2014-06-26 15:35:56 -04:00
Steve Klabnik
00ae648496 staticly -> statically
What's funny about this one is that spellcheck caught it, but for
some reason didn't give me the right suggestion, so I assumed that it
wasn't in my dictionary. Oh well.

Thanks @P1start! ❤️
2014-06-26 15:34:15 -04:00
Steve Klabnik
8fd69c4009 all/some
How could I forsake `rustdoc`? 😅

Thanks @huonw.
2014-06-26 15:32:35 -04:00
Steve Klabnik
98fd2abe0a tha -> than
Thanks @huonw ❤️
2014-06-26 15:31:41 -04:00
Steve Klabnik
fb594484e6 Fix capitalization of Issue.
@chris-morgan and @huonw pointed out that even though the feature
is a proper noun, we're using it in a more generic sense here.
2014-06-26 15:30:44 -04:00
Steve Klabnik
39549bebf0 Add a note that this requires git. 2014-06-26 15:30:06 -04:00
Steve Klabnik
a548e8185a Guide: Hello, cargo 2014-06-26 15:23:05 -04:00
bors
b20f968ed2 auto merge of #15197 : omasanori/rust/doc-fix, r=alexcrichton 2014-06-26 17:16:26 +00:00
OGINO Masanori
c3c195bd48 Fix a typo and a small syntactic error.
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-06-26 21:43:47 +09:00
bors
389fae2ca8 auto merge of #15181 : steveklabnik/rust/hello_world, r=brson
This is built on top of https://github.com/rust-lang/rust/pull/15162 . cccae83d92 is the only new commit, you may want to look at that rather than the whole diff.

Writing our first Rust program together. This is the most crucial step, so I go to a fairly deep level of detail. Future sections will move more quickly.
2014-06-26 07:11:23 +00:00
bors
99519cc8e6 auto merge of #15162 : steveklabnik/rust/install_instructions, r=brson
This has my voice *very strongly*. I'm not sure if it's too much. I'd find it okay if I had to tone it back, and I don't want it to be _too strong_, but clinical docs are boring.
2014-06-26 04:21:27 +00:00
Steve Klabnik
a8ddab4f25 Add extra ignore directives. 2014-06-25 16:12:40 -04:00
Steve Klabnik
cccae83d92 Guide: Hello, world!
Let's write our first Rust program!
2014-06-25 14:26:14 -04:00
bors
7be7a8fb3a auto merge of #15121 : steveklabnik/rust/matching_docs, r=alexcrichton
Fixes #11113.
2014-06-25 15:21:26 +00:00
Steve Klabnik
1d574c1731 thanks @sfackler 2014-06-25 11:01:17 -04:00
Steve Klabnik
845ee09dfe fix feedback from @huonw 2014-06-25 11:00:34 -04:00
Steve Klabnik
338a84d45f Guide: install instructions 2014-06-25 11:00:33 -04:00
Steve Klabnik
53627dd1f2 Make an example more clear with sample code.
Fixes #11113.
2014-06-25 10:38:03 -04:00
bors
9e103acaba auto merge of #15165 : zookoatleastauthoritycom/rust/14148-Optimize-out-exhortations-about-being-careful-2, r=huonw
Yes, it is important to be careful, but repeated emphasis about it is probably
not helpful — it starts to sound like you came for a tutorial but found a
finger-wagging lecture.

Even after I removed a few of these comments, there are still several left in
the text. That's probably fine! A couple of mentions of how this is dangerous
and you ought to be careful may be a good reminder to the reader.

After making the edits, I reflowed the paragraphs that I had touched, using
emacs's "M-x fill-paragraph", with fill-column equal to 70.
2014-06-25 06:21:20 +00:00
Zooko Wilcox-O'Hearn
668bad6d4c reflow with emacs fill-paragraph (fill-column 71) 2014-06-25 01:35:50 +00:00
Zooko Wilcox-O'Hearn
d6ea8627ba add "(see below)" to a reference to a new concept
This is because I observed someone reading the tutorial who thought they'd
missed something when they got to the mention of variable bindings.

This patch doesn't reflow the paragraphs so that you can see the semantic
change that I made, and a subsequent patch will reflow this paragraph.

Fixes https://github.com/rust-lang/rust/issues/13570.
2014-06-25 01:34:24 +00:00
Zooko Wilcox-O'Hearn
e3050ffa52 Optimize out exhortations about being careful.
Yes, it is important to be careful, but repeated emphasis about it is probably
not helpful — it starts to sound like you came for a tutorial but found a
finger-wagging lecture.

Even after I removed a few of these comments, there are still several left in
the text. That's probably fine! A couple of mentions of how this is dangerous
and you ought to be careful may be a good reminder to the reader.

After making the edits, I reflowed the paragraphs that I had touched, using
emacs's "M-x fill-paragraph", with fill-column equal to 70.
2014-06-25 01:25:10 +00:00
Michael Zhou
58078005cf Fix grammar in tutorial
"as this document" should be "than this document"
2014-06-24 17:23:12 -07:00
Steve Klabnik
3ed78f5b6b Add the Guide, add warning to tutorial.
In line with what @brson, @cmr, @nikomatsakis and I discussed this morning, my
redux of the tutorial will be implemented as the Guide. This way, I can work in
small iterations, rather than dropping a huge PR, which is hard to review.  In
addition, the community can observe my work as I'm doing it.

This adds a note in line with [this comment][reddit] that clarifies the state
of the tutorial, and the community's involvement with it.

[reddit]: http://www.reddit.com/r/rust/comments/28bew8/rusts_documentation_is_about_to_drastically/ci9c98k
2014-06-24 17:22:50 -07:00
Steve Klabnik
85effb9f3e Improve ambiguous pronoun.
Fixes #14806
2014-06-24 17:22:45 -07:00
Steve Klabnik
e16a87513a Remove the cheat sheet.
Rust by Example is far better.

Fixes #14380.
2014-06-24 17:22:39 -07:00
Niko Matsakis
9e3d0b002a librustc: Remove the fallback to int from typechecking.
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-24 17:18:48 -07:00
bors
58bf8b2155 auto merge of #15107 : ipetkov/rust/tutorial-update, r=alexcrichton 2014-06-24 10:16:49 +00:00
Patrick Walton
5466d13d43 librustc: Feature gate lang items and intrinsics.
If you define lang items in your crate, add `#[feature(lang_items)]`.

If you define intrinsics (`extern "rust-intrinsic"`), add
`#[feature(intrinsics)]`.

Closes #12858.

[breaking-change]
2014-06-23 23:28:28 -07:00
bors
7689213713 auto merge of #14952 : alexcrichton/rust/const-unsafe-pointers, r=brson
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-24 04:16:53 +00:00
Patrick Walton
654d6444fe libsyntax: Disallow struct literals after if, while, match, and
`for...in`.

Closes #14803.

If you used a structure literal after one of these keywords, surround it
in parentheses.

[breaking-change]
2014-06-23 15:39:29 -07:00
Ivan Petkov
39efe3c82b Docs: tutorial: Remove a couple references to ~T 2014-06-23 14:51:03 -07:00
Piotr Jawniak
0b9e4fcaff Update few files after comparison traits renaming
There were still Total{Ord,Eq} in docs and src/etc
2014-06-22 09:31:39 +02:00
bors
0ae4b97c09 auto merge of #15029 : aturon/rust/stability-index, r=brson
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-21 04:01:25 +00:00