Commit Graph

2948 Commits

Author SHA1 Message Date
Felix S. Klock II 701ade6d08 Added all active features to the list in reference.md.
Added a second note about keeping the reference.md list up-to-date to
the bottom of the list, since not everyone (including me) reads the
big comment at the top of it.  :)

Ensured that the feature gate list in reference.md is kept in
alphabetical order.
2017-03-02 14:57:05 -08:00
Steve Klabnik 730bbc7fc0 Remove outdated information about copy/move from the reference
Fixes #22136
2017-03-02 14:57:04 -08:00
Nick Sarten b0400b72ab Updated usage of StrExt.parse() as per a recommendation by edwardw. 2017-03-02 14:57:04 -08:00
Nick Sarten aed992e53b Updated documentation to use range notation syntax.
Replaced outdated use of the `range(start, end)` function where
approriate with `start..end`, and tweaked the examples to compile and run with the latest rust. I also fixed two periphery compile issues in reference.md which were occluding whether there were any new errors created by these changes, so I fixed them.
2017-03-02 14:57:04 -08:00
Felix S. Klock II 6d71012d28 opt into box_patterns in the reference doc that uses them. 2017-03-02 14:57:04 -08:00
Steve Klabnik 2c0dad8f05 Remove bottom from the reference
Fixes #20172
2017-03-02 14:57:04 -08:00
Alexander Korolkov ea80c2e7fa Rename Show to Debug, String to Display
Update reference.md:
 - derive() no longer supports Zero trait
 - derive() now supports Copy trait
2017-03-02 14:57:04 -08:00
Geoffrey Thomas c74b9d2352 reference.md: Byte string literals start with a 'b'
This was correct in the EBNF, but not in the prose (which seems to have
been copied-and-pasted from regular string literals).
2017-03-02 14:57:04 -08:00
Andrea Canciani 2c2a302925 Replace `be` with `become`
As per rust-lang/rfcs#601, replace `be` with `become` as reserved
keyword for tail call optimization.
2017-03-02 14:57:04 -08:00
Keegan McAllister a96bffae4f Use a crate attribute to load plugins
#[plugin] #[no_link] extern crate bleh;

becomes a crate attribute

    #![plugin(bleh)]

The feature gate is still required.

It's almost never correct to link a plugin into the resulting library /
executable, because it will bring all of libsyntax and librustc with it.
However if you really want this behavior, you can get it with a separate
`extern crate` item in addition to the `plugin` attribute.

Fixes #21043.
Fixes #20769.

[breaking-change]
2017-03-02 14:57:04 -08:00
Keegan McAllister 5ced43062a Feature-gate #![no_std]
Fixes #21833.

[breaking-change]
2017-03-02 14:57:04 -08:00
Simonas Kazlauskas f59a3c9d4a Remove `is` postfix in Reference → Numbers 2017-03-02 14:57:03 -08:00
Steven Fackler 0e17ad9e4f Switch missing_copy_implementations to default-allow
This was particularly helpful in the time just after OIBIT's
implementation to make sure things that were supposed to be Copy
continued to be, but it's now creates a lot of noise for types that
intentionally don't want to be Copy.
2017-03-02 14:57:03 -08:00
Manish Goregaokar 501791f4ea Add staged_api and unmarked_api features to reference.md 2017-03-02 14:57:03 -08:00
Nick Sarten ccea05abe2 Updated unicode escape documentation to match current implementation.
Unicode escapes were changed in [this
RFC](28aeb3c391/text/0446-es6-unicode-escapes.md)
to use the ES6 \u{00FFFF} syntax with a variable number of digits from
1-6, eliminating the need for two different syntaxes for unicode
literals.
2017-03-02 14:57:03 -08:00
Dan Yang be490baf5f fix use decl code example in reference 2017-03-02 14:57:03 -08:00
Sébastien Marie e7c581b9ad openbsd support 2017-03-02 14:57:03 -08:00
Tobias Bucher 6268b4de13 Reference: Purge `isize` from non-memory-related examples
Also explain integer fallback to `i32`.
2017-03-02 14:57:03 -08:00
Steve Klabnik d7ffa86bde Don't use as_slice() in docs
Use deref coercions instead.
2017-03-02 14:57:03 -08:00
Alex Crichton ccdfb09cb0 std: Stabilize FromStr and parse
This commits adds an associated type to the `FromStr` trait representing an
error payload for parses which do not succeed. The previous return value,
`Option<Self>` did not allow for this form of payload. After the associated type
was added, the following attributes were applied:

* `FromStr` is now stable
* `FromStr::Err` is now stable
* `FromStr::from_str` is now stable
* `StrExt::parse` is now stable
* `FromStr for bool` is now stable
* `FromStr for $float` is now stable
* `FromStr for $integral` is now stable
* Errors returned from stable `FromStr` implementations are stable
* Errors implement `Display` and `Error` (both impl blocks being `#[stable]`)

Closes #15138
2017-03-02 14:57:03 -08:00
Brian Anderson 25212e8290 Remove section on stability levels from reference
Obsolete, no replacement. The mechanics here are mostly implementation details at this point.
2017-03-02 14:57:03 -08:00
York Xiang a4482e260c fix wrong link 2017-03-02 14:57:02 -08:00
Jorge Aparicio d18b6cd284 cleanup: s/impl Copy/#[derive(Copy)]/g 2017-03-02 14:57:02 -08:00
Eduard Burtescu 05f6ebfe7a Remove every mention of "onceness". 2017-03-02 14:57:02 -08:00
Steve Klabnik e8661ebfc2 Remove lang items from the reference.
Fixes #19759
2017-03-02 14:57:02 -08:00
Steve Klabnik 6667ef32b3 remove weird sentence
Fixes #21531
2017-03-02 14:57:02 -08:00
Daniel Grunwald aea1700c2d Fix some grammar inconsistencies for the '..' range notation.
Grammar changes:
* allow 'for _ in 1..i {}' (fixes #20241)
* allow 'for _ in 1.. {}' as infinite loop
* prevent use of range notation in contexts where only operators of high
  precedence are expected (fixes #20811)

Parser code cleanup:
* remove RESTRICTION_NO_DOTS
* make AS_PREC const and follow naming convention
* make min_prec inclusive
2017-03-02 14:57:02 -08:00
Steve Klabnik 32094fb6cc Document remaining attributes and macros
Fixes #6444
2017-03-02 14:57:02 -08:00
Eduard Burtescu dc01e292b1 docs: fix fallout of merging ast::ViewItem into ast::Item. 2017-03-02 14:57:02 -08:00
Jorge Aparicio a16e42d0a0 remove `NoSendItem` and `NoSyncItem` 2017-03-02 14:57:02 -08:00
Alex Crichton 897a45f5a0 Test fixes and rebase conflicts 2017-03-02 14:57:02 -08:00
NODA, Kai 4dee7b62fc reference.md: change "mod" to "self" in "use" declaration.
This should have been done together with 56dcbd17fdad5d39b7b02e22a7490d2468718d08
for rust-lang/rust#20361

Signed-off-by: NODA, Kai <nodakai@gmail.com>
2017-03-02 14:57:01 -08:00
Alfie John 42d8a813aa docs: typo 2017-03-02 14:57:01 -08:00
Alfie John f87a283682 docs: replacing more deprecated integer suffixes 2017-03-02 14:57:01 -08:00
Alfie John e8fd024e57 docs: replace deprecated integer suffixes from examples 2017-03-02 14:57:01 -08:00
Earl St Sauver 1a3523a643 s/deriving/derives in Comments/Docs
There are a large number of places that incorrectly refer
to deriving in comments, instead of derives.

Fixes #20984
2017-03-02 14:57:01 -08:00
Steve Klabnik 992172947e Add enum discriminats to the reference.
Fixes #15755
2017-03-02 14:57:01 -08:00
Chase Southwood 46e7fcdaf2 Remove unneeded box import in examples 2017-03-02 14:57:01 -08:00
Steve Klabnik 560fc67bb0 Clean up unary operators in the reference
Fixes #20876
2017-03-02 14:57:01 -08:00
Greg Chapple d3829bbcd9 Replace usage of deriving with derive in docs 2017-03-02 14:57:01 -08:00
Richo Healey ba69f413f7 powerpc: Document the existance of powerpc 2017-03-02 14:57:01 -08:00
Manish Goregaokar 37ea06dd15 docs 2017-03-02 14:57:00 -08:00
Steven Crockett b9c42e8fcf reference: Made a number of small gramatical fixes changes for correctness/consistency. Small updates to text and code where the language has since changed. 2017-03-02 14:57:00 -08:00
Armin Preiml 25abb2ad4d Update 7.2.9 Array expressions 2017-03-02 14:57:00 -08:00
Steve Klabnik f754715298 "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.
2017-03-02 14:57:00 -08:00
Alex Crichton 1ff386c803 Test fixes and rebase conflicts 2017-03-02 14:57:00 -08:00
Joseph Crail b0694cd029 Fix misspelled comments.
I cleaned up comments prior to the 1.0 alpha release.
2017-03-02 14:57:00 -08:00
Piotr Czarnecki 52df822096 Cleanup and followup to PR #17830: parsing changes
Prevents breaking down `$name` tokens into separate `$` and `name`.
Reports unknown macro variables.

Fixes #18775
Fixes #18839
Fixes #15640
2017-03-02 14:57:00 -08:00
Keegan McAllister 576b2e776a Update docs 2017-03-02 14:57:00 -08:00
Keegan McAllister f3a25520c3 Reserve the keyword 'macro' 2017-03-02 14:57:00 -08:00