Commit Graph

40 Commits

Author SHA1 Message Date
Lzu Tao e7f8e63ed4 Convert old doc links to current edition
Use footnote style to bypass the tidy check
2019-02-13 14:39:25 +00:00
Steve Klabnik 8d6b5689fb Change removal notice for pointer guide.
This is a bit outdated.
2015-06-29 15:18:00 -04:00
Tim Parenti fbcc34f483 Grammar tweak to old guide stub documents.
Removes extra "the" from the phrase "the the Rust Programming Language
book", which isn't particularly grammatical.
2015-01-16 22:25:22 -05:00
Huon Wilson 4247a30bdd Add stub deprecation files for each of the old guides.
There are hundreds of stackoverflow answers, reddit posts and blog
articles that link to these documents, so it's a nicer user experience
if they're not plain 404s.

The intention is to let these hang around only for relatively short
while. The alpha is likely to bring in many new users and they will be
reading the documents mentioned above.
2015-01-09 19:47:09 +11:00
Steve Klabnik 16a6ebd1f6 "The Rust Programming Language"
This pulls all of our long-form documentation into a single document,
nicknamed "the book" and formally titled "The Rust Programming
Language."

A few things motivated this change:

* People knew of The Guide, but not the individual Guides. This merges
  them together, helping discoverability.
* You can get all of Rust's longform documentation in one place, which
  is nice.
* We now have rustbook in-tree, which can generate this kind of
  documentation. While its style is basic, the general idea is much
  better: a table of contents on the left-hand side.
* Rather than a almost 10,000-line guide.md, there are now smaller files
  per section.
2015-01-08 12:02:11 -05:00
Alex Crichton 0dc48b47a8 Test fixes and rebase conflicts 2015-01-07 19:27:27 -08:00
Alex Crichton a64000820f More test fixes 2015-01-06 21:26:48 -08:00
Steve Klabnik 3c9d8983be Fix up some {ignore} and {notrust}s
These should be properly annotated instead.

Fixes #16219.
2014-12-10 15:14:18 -05:00
Alex Crichton 1a61fe4280 Test fixes and rebase conflicts from the rollup 2014-12-09 10:26:04 -08:00
Steve Klabnik 8ba5605233 remove usage of notrust from the docs
Fixes #19599
2014-12-07 04:18:56 -05:00
bors 3c89031e1f auto merge of #18613 : steveklabnik/rust/ownership_guide, r=huonw
This is a work in progress, but this should get *extensive* review, so I'm putting it up early and often.

This is the start of a draft of the new 'ownership guide,' which explains ownership, borrowing, etc. I'm feeling better about this framing than last time's, but we'll see.
2014-12-04 04:52:37 +00:00
Alex Crichton 9c27ab6125 rollup merge of #19325: ucarion/pointers-doc-formatting
The "Returning Pointers" section of the pointers guide broke from the convention of putting code between backticks. This PR fixes that. There's also a little trailing whitespace I took care of.
2014-11-26 16:50:12 -08:00
Steve Klabnik e2fe7a083e Lifetime guide -> ownership guide 2014-11-26 15:03:12 -05:00
Ulysse Carion 6cb03baffa Fix formatting of the pointers guide. 2014-11-25 16:32:53 -08:00
Steve Klabnik 71b8b04f48 Make note about cross-borrowing.
Fixes #19302.
2014-11-25 10:57:17 -05:00
Steven Fackler 3dcd215740 Switch to purely namespaced enums
This breaks code that referred to variant names in the same namespace as
their enum. Reexport the variants in the old location or alter code to
refer to the new locations:

```
pub enum Foo {
    A,
    B
}

fn main() {
    let a = A;
}
```
=>
```
pub use self::Foo::{A, B};

pub enum Foo {
    A,
    B
}

fn main() {
    let a = A;
}
```
or
```
pub enum Foo {
    A,
    B
}

fn main() {
    let a = Foo::A;
}
```

[breaking-change]
2014-11-17 07:35:51 -08:00
Ian Connolly 769d49a8b7 Don't use rust keyword for fake code 2014-11-13 19:52:08 +00:00
Daniel Hofstetter 25650e0eeb Guide: Add missing "a" 2014-10-27 15:41:24 +01:00
Eduard Burtescu aa0b350c97 docs: remove mentions of Gc. 2014-10-02 16:59:31 +03:00
NODA, Kai de027a8b1f guide-pointers.md: C sample code should match the Rust version.
Fix rust-lang/rust#17255
2014-09-24 21:53:11 +08:00
Steve Klabnik 7e4a1459e9 note about ref patterns in pointer guide
Fixes #13602
2014-08-30 16:15:46 -04:00
Amy Unger 0493fb2cfc Make variable mutable to allow mutable reference 2014-08-19 15:41:12 -05:00
Jake Scott e7db11c90b Fix typo 2014-08-10 14:12:15 +12:00
Steve Klabnik 20658f7ec5 Fix heading levels in pointer guide 2014-07-31 07:30:52 -07:00
Steve Klabnik ea1b637654 fix formatting in pointer guide table 2014-07-31 07:30:48 -07:00
Steve Klabnik 377b2508f2 Guide Redux: Pointers 2014-07-21 19:34:55 -04:00
Patrick Walton de70d76373 librustc: Remove cross-borrowing of `Box<T>` to `&T` from the language,
except where trait objects are involved.

Part of issue #15349, though I'm leaving it open for trait objects.
Cross borrowing for trait objects remains because it is needed until we
have DST.

This will break code like:

    fn foo(x: &int) { ... }

    let a = box 3i;
    foo(a);

Change this code to:

    fn foo(x: &int) { ... }

    let a = box 3i;
    foo(&*a);

[breaking-change]
2014-07-17 14:05:36 -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
Florian Gilcher 20fb7c62d4 docs: Stop using `notrust`
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-06-02 12:37:54 +02:00
bors 1dea8834cc auto merge of #14364 : alexcrichton/rust/libdebug, r=brson
This commit moves reflection (as well as the {:?} format modifier) to a new
libdebug crate, all of which is marked experimental.

This is a breaking change because it now requires the debug crate to be
explicitly linked if the :? format qualifier is used. This means that any code
using this feature will have to add `extern crate debug;` to the top of the
crate. Any code relying on reflection will also need to do this.

Closes #12019

[breaking-change]
2014-05-27 21:46:46 -07:00
Alex Crichton b53454e2e4 Move std::{reflect,repr,Poly} to a libdebug crate
This commit moves reflection (as well as the {:?} format modifier) to a new
libdebug crate, all of which is marked experimental.

This is a breaking change because it now requires the debug crate to be
explicitly linked if the :? format qualifier is used. This means that any code
using this feature will have to add `extern crate debug;` to the top of the
crate. Any code relying on reflection will also need to do this.

Closes #12019

[breaking-change]
2014-05-27 21:44:51 -07:00
Alan Andrade 99744653d5 get over bold text madness, changes per PR, brought the "returning pointers" section back to pointers guide 2014-05-24 13:15:48 -07:00
Alan Andrade 64dad2cb03 Cleanup lifetime guide
Clean pointers guide
2014-05-23 18:52:06 -07:00
Kevin Butler 6bfe361de2 guide-pointers: minor nits 2014-05-16 15:40:21 +01:00
Patrick Walton 090040bf40 librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, except
for `~str`/`~[]`.

Note that `~self` still remains, since I forgot to add support for
`Box<self>` before the snapshot.

How to update your code:

* Instead of `~EXPR`, you should write `box EXPR`.

* Instead of `~TYPE`, you should write `Box<Type>`.

* Instead of `~PATTERN`, you should write `box PATTERN`.

[breaking-change]
2014-05-06 23:12:54 -07:00
Kevin Butler 74392246ff Remove comment about semicolons for inner attributes from docs and adjust comments. 2014-05-03 21:24:06 +01:00
Brandon Waskiewicz 58ae1e7c62 Remove rule that is confusing
The original text stated that one should only return a unique or managed pointer if you were given one in the first place. This makes it sound as if the function *should* return a unique pointer if it were given a unique pointer. The rest of the section goes on to describe why this is bad, and the example of bad code does exactly what the rule just said to do.

I reworded the original rule into a reference to the more concise rule mentioned at the bottom of the section, which helps add emphasis (a la 'it bears repeating').
2014-04-17 16:59:58 -04:00
Manish Goregaokar d0aed0995b Update tutorials to use new attribute syntax (#13476) 2014-04-12 09:03:39 +05:30
Daniel Micay 8ca5caf4d9 num: rm wrapping of `Float` methods as functions
The `Float` trait methods will be usable as functions via UFCS, and
we came to a consensus to remove duplicate functions like this a long
time ago.

It does still make sense to keep the duplicate functions when the trait
methods are static, unless the decision to leave out the in-scope trait
name resolution for static methods changes.
2014-03-31 17:41:52 -04:00
Alex Crichton 864b434bfa Move doc/ to src/doc/
We generate documentation into the doc/ directory, so we shouldn't be
intermingling source files with generated files
2014-02-02 10:59:14 -08:00