Commit Graph

415 Commits

Author SHA1 Message Date
nwin 2f28e83e53 Byte string literals are now fixed-size arrays
Changed in #22838.

audited (raw) byte string literals @ #16676
2017-03-02 14:57:12 -08:00
mdinger 94676f0ac8 Remove keywords from reference because they're already in grammar 2017-03-02 14:57:12 -08:00
mdinger 272cc7a339 Remove ebnf from reference 2017-03-02 14:57:12 -08:00
Ulrik Sverdrup e8acbdbca2 reference: Audit & Edit chapter 8.1 Types.
- Remove mention of unit type
- Update closure types and reference types sections
- Fix minor typos
2017-03-02 14:57:12 -08:00
Robin Kruppe 5f6aedd176 Reference audit: section 5 (Crates and source files) 2017-03-02 14:57:12 -08:00
Andrzej Janik 881a40e616 Stop mentioning obsolete integer suffixes
`us` and `is` were replaced with `usize` and `isize` some time ago.
2017-03-02 14:57:12 -08:00
Manish Goregaokar 438affd543 fixup #24754 2017-03-02 14:57:12 -08:00
Mike Boutin 475ab5d493 Fix spelling errors. 2017-03-02 14:57:12 -08:00
tynopex 97d9ce4546 Update reference.md
Add section for range expressions.
2017-03-02 14:57:11 -08:00
Michael Rosenberg fe3d8aa671 Update "Generic Functions" section
Updated sample code to updated syntax (now compiles). Also tweaked the text to reflect the change.
2017-03-02 14:57:11 -08:00
Lee Aronson 60dc8907aa Fixed typo 2017-03-02 14:57:11 -08:00
Lee Aronson 8fbde72c92 Improve information about loops
1) Moved 'while' section below 'loop', 'break', and 'continue'; 2) Added information to 'while' and 'for' loops that they interact with 'break' and 'continue' and may have a lifetime label. 3) Clarified labeling syntax on the infinite loops.
2017-03-02 14:57:11 -08:00
Matt Brubeck 2e669fcafd Update and organize the Keywords table
* Add two missing keywords, `Self` and `proc`
* Fix some mis-alphabetized keywords
2017-03-02 14:57:11 -08:00
Matt Brubeck 1dc339f0e0 Also mention `/*!` doc comments. 2017-03-02 14:57:11 -08:00
Matt Brubeck dc6735628e Clarify that //! comments are also doc comments. 2017-03-02 14:57:11 -08:00
Vadim Chugunov bcae34866e Update supported values of target_os
'win32' -> 'windows', added 'ios'
2017-03-02 14:57:11 -08:00
nwin 0f1aa23ff8 typo 2 2017-03-02 14:57:11 -08:00
nwin 4739d944cb typo 2017-03-02 14:57:10 -08:00
nwin e4467ddda6 object type -> trait object
Consistency. The book also refers to it as trait objects.
2017-03-02 14:57:10 -08:00
Steve Klabnik 9cad04e09b Remove feature gated examples from the reference.
The slice patterns example was nice, so let's put it with the other
slice pattern feature gate documentation.

Fixes #24573
2017-03-02 14:57:10 -08:00
Graydon Hoare df676cf91d Remove obsolete discusison of runtime, promote `Linkage` to chapter. 2017-03-02 14:57:10 -08:00
Graydon Hoare 3b01aae2f6 Improve memory-model section very slightly. 2017-03-02 14:57:10 -08:00
Graydon Hoare a6c65b976b Improve special-traits section very slightly. 2017-03-02 14:57:10 -08:00
Graydon Hoare 0eb7effb58 Eliminate the obsolete term 'slot'. 2017-03-02 14:57:10 -08:00
Graydon Hoare 03e8965474 Clean up section on Type aliases. 2017-03-02 14:57:10 -08:00
Graydon Hoare 72deac1868 Trim florid language. 2017-03-02 14:57:10 -08:00
Steve Klabnik 9a3a9e4461 document missing attributes in the reference
Fixes #24406
2017-03-02 14:57:10 -08:00
Luke Gallagher 5c78aaf3c6 Fix some documentation typos 2017-03-02 14:57:09 -08:00
Tamir Duberstein 22fd28c47a Positive case of `len()` -> `is_empty()`
`s/(?<!\{ self)(?<=\.)len\(\) == 0/is_empty()/g`
2017-03-02 14:57:09 -08:00
Niko Matsakis d693b3548b Fallout in public-facing and semi-public-facing libs 2017-03-02 14:57:09 -08:00
Alex Crichton 65c94657e2 std: Clean out #[deprecated] APIs
This commit cleans out a large amount of deprecated APIs from the standard
library and some of the facade crates as well, updating all users in the
compiler and in tests as it goes along.
2017-03-02 14:57:09 -08:00
Steve Klabnik dfd8fa80e1 Make note of noalias in unsafe reference section
Fixes #19733
2017-03-02 14:57:09 -08:00
Richo Healey 4e08b359a2 Unquote all crate names without underscores 2017-03-02 14:57:09 -08:00
Brian Anderson e2a433a822 Feature gate *all* slice patterns. #23121
Until some backwards-compatibility hazards are fixed in #23121,
these need to be unstable.

[breaking-change]
2017-03-02 14:57:09 -08:00
Steve Klabnik 2361606066 Remove stdlib stuff from the Reference
Fixes #11794
2017-03-02 14:57:09 -08:00
Alex Crichton a1cfe19e67 Mass rename uint/int to usize/isize
Now that support has been removed, all lingering use cases are renamed.
2017-03-02 14:57:08 -08:00
Steve Klabnik 35b4f0eae6 correct reference wrt shifts
Fixes #23421
2017-03-02 14:57:08 -08:00
Brian Anderson c0b30386d4 Add #![feature] attributes to doctests 2017-03-02 14:57:08 -08:00
FuGangqiang 7d5996c919 add lifetime for `while` and `for` expression 2017-03-02 14:57:08 -08:00
FuGangqiang 4807d89491 fix the attributes sytax 2017-03-02 14:57:08 -08:00
Johannes Oertel ea4828a928 Rename should_fail to should_panic in docs 2017-03-02 14:57:08 -08:00
Nick Cameron 132829bb30 Fallout in testing. 2017-03-02 14:57:08 -08:00
mdinger edfba17d36 Add monospace font back to literals table 2017-03-02 14:57:08 -08:00
Steve Klabnik 00e599bbaa Shrink table in the reference
Fixes #20051
2017-03-02 14:57:07 -08:00
Steve Klabnik 861b1df87c remove confusing language about casting types
Fixes #17481
2017-03-02 14:57:07 -08:00
Alan Cutter ae5543f110 Fix missed doc grammar rule rename from vec_elems to array_elems 2017-03-02 14:57:07 -08:00
Keegan McAllister b14194697a Make #[derive(Anything)] into sugar for #[derive_Anything]
This is a hack, but I don't think we can do much better as long as `derive` is
running at the syntax expansion phase.

If the custom_derive feature gate is enabled, this works with user-defined
traits and syntax extensions. Without the gate, you can't use e.g. #[derive_Clone]
directly, so this does not change the stable language.

This commit also cleans up the deriving code somewhat, and forbids some
previously-meaningless attribute syntax. For this reason it's technically a

    [breaking-change]
2017-03-02 14:57:07 -08:00
Huon Wilson e5260d7629 Add #[allow_internal_unstable] to track stability for macros better.
Unstable items used in a macro expansion will now always trigger
stability warnings, *unless* the unstable items are directly inside a
macro marked with `#[allow_internal_unstable]`. IOW, the compiler warns
unless the span of the unstable item is a subspan of the definition of a
macro marked with that attribute.

E.g.

    #[allow_internal_unstable]
    macro_rules! foo {
        ($e: expr) => {{
            $e;
            unstable(); // no warning
            only_called_by_foo!();
        }}
    }

    macro_rules! only_called_by_foo {
        () => { unstable() } // warning
    }

    foo!(unstable()) // warning

The unstable inside `foo` is fine, due to the attribute. But the
`unstable` inside `only_called_by_foo` is not, since that macro doesn't
have the attribute, and the `unstable` passed into `foo` is also not
fine since it isn't contained in the macro itself (that is, even though
it is only used directly in the macro).

In the process this makes the stability tracking much more precise,
e.g. previously `println!("{}", unstable())` got no warning, but now it
does. As such, this is a bug fix that may cause [breaking-change]s.

The attribute is definitely feature gated, since it explicitly allows
side-stepping the feature gating system.
2017-03-02 14:57:07 -08:00
Piotr Czarnecki f1410cab5c Add quasiquote for matchers and attributes 2017-03-02 14:57:07 -08:00
Huon Wilson 582ee72bf0 Feature gate `#[static_assert]`.
The API this exposes is a little strange (being attached to `static`s),
so it makes sense to conservatively feature gate it. If it is highly
popular, it is possible to reverse this gating.
2017-03-02 14:57:07 -08:00
Jorge Aparicio 3edc9347f6 remove leftover annotations 2017-03-02 14:57:07 -08:00
Alexander Bliskovsky f033a6a028 Changed prose to assert_eq! macro. 2017-03-02 14:57:06 -08:00
Alexander Bliskovsky 8476749544 Added documentation of backslash ending string literals.
Closes #22698
2017-03-02 14:57:06 -08:00
Keegan McAllister ca717450ba Enhance and move information about macro debugging
Fixes #22424.
2017-03-02 14:57:06 -08:00
lummax f984da07f8 doc: Fix `target_{word_size,pointer_width}` renaming
Update the reference page to the change in #20680.
2017-03-02 14:57:06 -08:00
Alexander Chernyakhovsky 4d8f28d53c Include tuple indexing in the Reference.
The Rust Reference should include the tuple indexing (using a number
as a field) notation; currently it is only available on
http://doc.rust-lang.org/std/primitive.tuple.html and not easily
searchable.
2017-03-02 14:57:06 -08:00
Steve Klabnik 47a22ff543 Link from literals to their representation
Fixes #22152
2017-03-02 14:57:06 -08:00
Dave Huseby a1db8b9513 bitrig integration 2017-03-02 14:57:06 -08:00
Niko Matsakis 54cb972499 Fallout: docs, elided examples often elided too much. 2017-03-02 14:57:06 -08:00
Niko Matsakis 3da961dfe5 Replace all uses of `&foo[]` with `&foo[..]` en masse. 2017-03-02 14:57:05 -08:00
Niko Matsakis d319150abe Update docs by dropping suffixes except where they served to instruct. 2017-03-02 14:57:05 -08:00
Manish Goregaokar c204f75dd0 Add custom_attribute and rustc_attrs to reference.md 2017-03-02 14:57:05 -08:00
Steve Klabnik 7d8318cfbd remove 'crate files' sentence
Fixes #22386
2017-03-02 14:57:05 -08:00
Lai Jiangshan 1b2067bf07 reference: fix outdated link for Compiler plugins
book/syntax-extensions.html was renamed to book/plugins.html,
the link should be also updated.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
2017-03-02 14:57:05 -08:00
Steve Klabnik cd967b395f Generate grammar.html and link to it from the reference.
Fixes #19278
2017-03-02 14:57:05 -08:00
Steve Klabnik 7242ffead9 clarfiy reference with regards to the value of block expressions
Fixes #14849
2017-03-02 14:57:05 -08:00
Steve Klabnik 8e881a92b2 Don't specify tuple layout.
This isn't something we want to guarantee.
2017-03-02 14:57:05 -08:00
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
Huon Wilson 56596edc29 Change `&` pat to only work with &T, and `&mut` with &mut T.
This implements RFC 179 by making the pattern `&<pat>` require matching
against a variable of type `&T`, and introducing the pattern `&mut
<pat>` which only works with variables of type `&mut T`.

The pattern `&mut x` currently parses as `&(mut x)` i.e. a pattern match
through a `&T` or a `&mut T` that binds the variable `x` to have type
`T` and to be mutable. This should be rewritten as follows, for example,

    for &mut x in slice.iter() {

becomes

    for &x in slice.iter() {
        let mut x = x;

Due to this, this is a

[breaking-change]

Closes #20496.
2017-03-02 14:56:59 -08:00
th0114nd a6ca77f5b6 Changed LaTex $\bot$s to ⊥
In the HTML version of the documentation, it isn't rendered so might as well use the unicode representation.
Part of the problem was that putting a math unicode character wasn't
rendering properly in the pdf, so extra steps were needed to define
the unicode charecter ⊥ in reference.tex

closes #15285
2017-03-02 14:56:59 -08:00
Brendan Zabarauskas 5dc4884613 Update influence list 2017-03-02 14:56:59 -08:00
Jorge Aparicio e4adb5f8af unignore and fix doctests in guide and reference 2017-03-02 14:56:59 -08:00
Jorge Aparicio 568ff2ef67 ignore boxed closure doctests in the guide/reference 2017-03-02 14:56:59 -08:00
Alex Crichton 77ed0c0b3f Remove deprecated functionality
This removes a large array of deprecated functionality, regardless of how
recently it was deprecated. The purpose of this commit is to clean out the
standard libraries and compiler for the upcoming alpha release.

Some notable compiler changes were to enable warnings for all now-deprecated
command line arguments (previously the deprecated versions were silently
accepted) as well as removing deriving(Zero) entirely (the trait was removed).

The distribution no longer contains the libtime or libregex_macros crates. Both
of these have been deprecated for some time and are available externally.
2017-03-02 14:56:59 -08:00
Akos Kiss efef15bb7e Initial version of AArch64 support.
Adds AArch64 knowledge to:
* configure,
* make files,
* sources,
* tests, and
* documentation.
2017-03-02 14:56:59 -08:00
Alex Crichton ef131718e4 Rollup test fixes and rebase conflicts 2017-03-02 14:56:59 -08:00
Simonas Kazlauskas f38da55d0e Feature gate FFI imports of LLVM intrinsics
Fixes #20313
2017-03-02 14:56:59 -08:00
Alex Crichton d62e6940f2 std: Second pass stabilization of sync
This pass performs a second pass of stabilization through the `std::sync`
module, avoiding modules/types that are being handled in other PRs (e.g.
mutexes, rwlocks, condvars, and channels).

The following items are now stable

* `sync::atomic`
* `sync::atomic::ATOMIC_BOOL_INIT` (was `INIT_ATOMIC_BOOL`)
* `sync::atomic::ATOMIC_INT_INIT` (was `INIT_ATOMIC_INT`)
* `sync::atomic::ATOMIC_UINT_INIT` (was `INIT_ATOMIC_UINT`)
* `sync::Once`
* `sync::ONCE_INIT`
* `sync::Once::call_once` (was `doit`)
  * C == `pthread_once(..)`
  * Boost == `call_once(..)`
  * Windows == `InitOnceExecuteOnce`
* `sync::Barrier`
* `sync::Barrier::new`
* `sync::Barrier::wait` (now returns a `bool`)
* `sync::Semaphore::new`
* `sync::Semaphore::acquire`
* `sync::Semaphore::release`

The following items remain unstable

* `sync::SemaphoreGuard`
* `sync::Semaphore::access` - it's unclear how this relates to the poisoning
                              story of mutexes.
* `sync::TaskPool` - the semantics of a failing task and whether a thread is
                     re-attached to a thread pool are somewhat unclear, and the
                     utility of this type in `sync` is question with respect to
                     the jobs of other primitives. This type will likely become
                     stable or move out of the standard library over time.
* `sync::Future` - futures as-is have yet to be deeply re-evaluated with the
                   recent core changes to Rust's synchronization story, and will
                   likely become stable in the future but are unstable until
                   that time comes.

[breaking-change]
2017-03-02 14:56:59 -08:00
Alex Crichton 07da3e4d75 std: Stabilize the prelude module
This commit is an implementation of [RFC 503][rfc] which is a stabilization
story for the prelude. Most of the RFC was directly applied, removing reexports.
Some reexports are kept around, however:

* `range` remains until range syntax has landed to reduce churn.
* `Path` and `GenericPath` remain until path reform lands. This is done to
  prevent many imports of `GenericPath` which will soon be removed.
* All `io` traits remain until I/O reform lands so imports can be rewritten all
  at once to `std::io::prelude::*`.

This is a breaking change because many prelude reexports have been removed, and
the RFC can be consulted for the exact list of removed reexports, as well as to
find the locations of where to import them.

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0503-prelude-stabilization.md
[breaking-change]

Closes #20068
2017-03-02 14:56:58 -08:00
Alex Crichton 49e09eea48 std: Stabilize the prelude module
This commit is an implementation of [RFC 503][rfc] which is a stabilization
story for the prelude. Most of the RFC was directly applied, removing reexports.
Some reexports are kept around, however:

* `range` remains until range syntax has landed to reduce churn.
* `Path` and `GenericPath` remain until path reform lands. This is done to
  prevent many imports of `GenericPath` which will soon be removed.
* All `io` traits remain until I/O reform lands so imports can be rewritten all
  at once to `std::io::prelude::*`.

This is a breaking change because many prelude reexports have been removed, and
the RFC can be consulted for the exact list of removed reexports, as well as to
find the locations of where to import them.

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0503-prelude-stabilization.md
[breaking-change]

Closes #20068
2017-03-02 14:56:58 -08:00
Nick Cameron b81216ee45 Fallout - change array syntax to use `;` 2017-03-02 14:56:58 -08:00
bombless d881a7132a `once` is not keyword now 2017-03-02 14:56:58 -08:00
Steve Klabnik 8fafd5d07e s/task/thread/g
A part of #20038
2017-03-02 14:56:58 -08:00
Chris Wong db2d99e7a2 Rename include_bin! to include_bytes!
According to [RFC 344][], methods that return `&[u8]` should have names
ending in `bytes`. Though `include_bin!` is a macro not a method, it
seems reasonable to follow the convention anyway.

We keep the old name around for now, but trigger a deprecation warning
when it is used.

[RFC 344]: https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md

[breaking-change]
2017-03-02 14:56:58 -08:00
Alex Crichton 04eb31cd5e Fallout of std::str stabilization 2017-03-02 14:56:58 -08:00
th0114nd d73b3eddee Boolean literals are not Number literals
The current indentation level would indicate that Boolean literals are on the same level as Integer and Float literals under Number literals, unindenting moves it to the same scope as Character and string literals, Byte and byte string literals, and Number literals under Literals.
2017-03-02 14:56:58 -08:00
th0114nd cd5155539e Put quotes around "as", because it's a keyword. 2017-03-02 14:56:57 -08:00
Chase Southwood e636924aca Remove feature gate directives for `if_let`, `while_let`, and `tuple_indexing`. 2017-03-02 14:56:57 -08:00
Steve Klabnik 7aec7ed7c3 reference: type definition -> type alias
Fixes #9266
2017-03-02 14:56:57 -08:00
Niko Matsakis 7c26317479 Update guide/intro to take into account the removal of `proc`.
cc @steveklabnick
2017-03-02 14:56:57 -08:00
Alfie John 48d5014676 doc: grammar fix 2017-03-02 14:56:57 -08:00
Steve Klabnik e4e1496add Correct the reference with regards to floats
Fixes #19595.
2017-03-02 14:56:57 -08:00
Niko Matsakis c70a0e1447 librustc: Make `Copy` opt-in.
This change makes the compiler no longer infer whether types (structures
and enumerations) implement the `Copy` trait (and thus are implicitly
copyable). Rather, you must implement `Copy` yourself via `impl Copy for
MyType {}`.

A new warning has been added, `missing_copy_implementations`, to warn
you if a non-generic public type has been added that could have
implemented `Copy` but didn't.

For convenience, you may *temporarily* opt out of this behavior by using
`#![feature(opt_out_copy)]`. Note though that this feature gate will never be
accepted and will be removed by the time that 1.0 is released, so you should
transition your code away from using it.

This breaks code like:

    #[deriving(Show)]
    struct Point2D {
        x: int,
        y: int,
    }

    fn main() {
        let mypoint = Point2D {
            x: 1,
            y: 1,
        };
        let otherpoint = mypoint;
        println!("{}{}", mypoint, otherpoint);
    }

Change this code to:

    #[deriving(Show)]
    struct Point2D {
        x: int,
        y: int,
    }

    impl Copy for Point2D {}

    fn main() {
        let mypoint = Point2D {
            x: 1,
            y: 1,
        };
        let otherpoint = mypoint;
        println!("{}{}", mypoint, otherpoint);
    }

This is the backwards-incompatible part of #13231.

Part of RFC #3.

[breaking-change]
2017-03-02 14:56:57 -08:00
Corey Farwell 5e04645f84 Utilize fewer reexports
In regards to:

https://github.com/rust-lang/rust/issues/19253#issuecomment-64836729

This commit:

* Changes the #deriving code so that it generates code that utilizes fewer
  reexports (in particur Option::* and Result::*), which is necessary to
  remove those reexports in the future
* Changes other areas of the codebase so that fewer reexports are utilized
2017-03-02 14:56:57 -08:00
kulakowski 69494b54e0 Fix typo in reference.md 2017-03-02 14:56:57 -08:00
Steven Fackler f087202ac6 Remove special casing for some meta attributes
Descriptions and licenses are handled by Cargo now, so there's no reason
to keep these attributes around.
2017-03-02 14:56:57 -08:00
Alfie John b2ea254698 doc: adding example for implementations without traits 2017-03-02 14:56:56 -08:00
Alfie John 9ad98bef21 doc: adding example for type definitions 2017-03-02 14:56:56 -08:00
Aaron Turon 67aae0c01d Fallout from libgreen and libnative removal 2017-03-02 14:56:56 -08:00
mdinger 8aff5aa939 Add examples for all literal types in reference grouped together 2017-03-02 14:56:56 -08:00
Alfie John 45201c4da2 doc: clarifying unsafe code vs undefined behavior 2017-03-02 14:56:56 -08:00
Daniel Hofstetter 9a272052d7 Reference: Change "an box" to "a box" 2017-03-02 14:56:56 -08:00
Huon Wilson 9d80a44c3a Update documentation for literal suffixes.
This changes the stated grammar of literals to move all suffixes into
the generic literal production.
2017-03-02 14:56:56 -08:00
Daniel Hofstetter c390d3314d Reference: Add missing third dot of range 2017-03-02 14:56:56 -08:00
Daniel Micay 3ac34fcacd clearly define `int` and `uint` to fix unsoundness
This fixes the gap in the language definition causing #18726 by defining
a clear bound on the maximum size for libraries to enforce.

Closes #18069
2017-03-02 14:56:55 -08:00
Niko Matsakis 3f45250020 Update test for equivalency to include region binders in object types, add new tests relating to HRTB, consolidate the `unboxed_closures` and `overloaded_calls` feature gates. 2017-03-02 14:56:55 -08:00
Niko Matsakis fa822e5702 Place parenthetical notation under the `unboxed_closure` feature-gate.
Consolidate the `unboxed_closure_sugar` and `unboxed_closure` feature gates.
2017-03-02 14:56:55 -08:00
Alfie John bc2d87ba8b doc: extend a893397 to make whole document consistent 2017-03-02 14:56:55 -08:00
Steven Fackler 39eeb6d99c 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]
2017-03-02 14:56:55 -08:00
Alfie John 4590e8b065 doc: make end comment consistent with start comment 2017-03-02 14:56:55 -08:00
Jakub Bukaj c995ddb6f2 Update the reference 2017-03-02 14:56:55 -08:00
Alex Gaynor d80aa9e40c Fixed several typos 2017-03-02 14:56:55 -08:00
Brendan Zabarauskas f59cdefc90 Move FromStr to core::str 2017-03-02 14:56:55 -08:00
Daniel Hofstetter 0cee72a53e Reference: Fix list in Expressions section 2017-03-02 14:56:55 -08:00
Steve Klabnik 60c0e36ae1 expand description of the link attribute
Fixes #18288
2017-03-02 14:56:54 -08:00
Daniel Hofstetter d9b6bc6b97 Small doc fixes 2017-03-02 14:56:54 -08:00
Joseph Crail efefa7f033 Replace deprecated missing_doc attribute. 2017-03-02 14:56:54 -08:00
Alexis Beingessner b9c4a5744a refactor libcollections as part of collection reform
* Moves multi-collection files into their own directory, and splits them into seperate files
* Changes exports so that each collection has its own module
* Adds underscores to public modules and filenames to match standard naming conventions

(that is, treemap::{TreeMap, TreeSet} => tree_map::TreeMap, tree_set::TreeSet)

* Renames PriorityQueue to BinaryHeap
* Renames SmallIntMap to VecMap
* Miscellanious fallout fixes

[breaking-change]
2017-03-02 14:56:54 -08:00
Daniel Hofstetter fadad890bf Reference: Add missing of's 2017-03-02 14:56:54 -08:00
Daniel Micay 4c04351112 reference: document unwinding unsafety issues 2017-03-02 14:56:54 -08:00
Daniel Micay 5469a96c47 reference: slices are now regular types 2017-03-02 14:56:54 -08:00
Daniel Micay d5f15b57b8 reference: note the existence of UnsafeCell 2017-03-02 14:56:54 -08:00
Steve Klabnik 741926da8e Describe doc attribute in the reference
FIxes #7963.
2017-03-02 14:56:54 -08:00
Steve Klabnik 79ac8f5110 Rename fail! to panic!
https://github.com/rust-lang/rfcs/pull/221

The current terminology of "task failure" often causes problems when
writing or speaking about code. You often want to talk about the
possibility of an operation that returns a Result "failing", but cannot
because of the ambiguity with task failure. Instead, you have to speak
of "the failing case" or "when the operation does not succeed" or other
circumlocutions.

Likewise, we use a "Failure" header in rustdoc to describe when
operations may fail the task, but it would often be helpful to separate
out a section describing the "Err-producing" case.

We have been steadily moving away from task failure and toward Result as
an error-handling mechanism, so we should optimize our terminology
accordingly: Result-producing functions should be easy to describe.

To update your code, rename any call to `fail!` to `panic!` instead.
Assuming you have not created your own macro named `panic!`, this
will work on UNIX based systems:

    grep -lZR 'fail!' . | xargs -0 -l sed -i -e 's/fail!/panic!/g'

You can of course also do this by hand.

[breaking-change]
2017-03-02 14:56:53 -08:00
Steve Klabnik 9e9a8b5237 update keyword list
Fixes #17969
2017-03-02 14:56:53 -08:00
Ivan Ukhov 50476bb14f Fix the description of raw byte string literals 2017-03-02 14:56:53 -08:00
Luqman Aden 9cb350c4e8 librustc: Remove trans::reflect and the opaque and ty_visitor lang items. 2017-03-02 14:56:53 -08:00
Luqman Aden df35475d92 Remove libdebug and update tests. 2017-03-02 14:56:53 -08:00
NODA, Kai ba50ee1563 Fix HTML version of the keyword table.
This should really fix rust-lang/rust#17528.
2017-03-02 14:56:53 -08:00
John Gallagher 29d41459ef Add `while let` to the reference
Closes #17687
2017-03-02 14:56:53 -08:00
John Gallagher fa558588a7 Move `while let` behind `while_let` feature gate 2017-03-02 14:56:53 -08:00
Steven Fackler e77a8553d0 Continue cfg syntax transition
All deprecation warnings have been converted to errors. This includes
the warning for multiple cfgs on one item. We'll leave that as an error
for some period of time to ensure that all uses are updated before the
behavior changes from "or" to "and".
2017-03-02 14:56:53 -08:00
Jakub Wieczorek 179bd9327c Remove `virtual` structs from the reference 2017-03-02 14:56:52 -08:00
Alex Crichton d53cec1ebb doc: Document constants in the reference 2017-03-02 14:56:52 -08:00
Steve Klabnik 149d3ab9e2 add mention of test attribute
Fixes #16413
2017-03-02 14:56:52 -08:00
Steve Klabnik d0a374161e remove crate_id attribute, add crate_name one
this is true as of https://github.com/rust-lang/rust/pull/15319
2017-03-02 14:56:52 -08:00
Steve Klabnik 7d3b9b0f92 Fix keyword table
Markdown tables require a header, and we don't want one.

Fixes #17528
2017-03-02 14:56:52 -08:00
Nick Cameron 714408be0f Put slicing syntax behind a feature gate.
[breaking-change]

If you are using slicing syntax you will need to add #![feature(slicing_syntax)] to your crate.
2017-03-02 14:56:52 -08:00
Alex Crichton 274d527c45 Test fixes from the rollup 2017-03-02 14:56:52 -08:00
Keegan McAllister 5bf3c2b88b Link plugins guide from elsewhere 2017-03-02 14:56:52 -08:00
Eduard Burtescu f82f98c93e docs: remove mentions of Gc. 2017-03-02 14:56:52 -08:00
Aaron Turon 566a0d6473 Revert "Put slicing syntax behind a feature gate."
This reverts commit 95cfc35607ccf5f02f02de56a35a9ef50fa23a82.
2017-03-02 14:56:52 -08:00
Nick Cameron f12a8baf47 Put slicing syntax behind a feature gate.
[breaking-change]

If you are using slicing syntax you will need to add #![feature(slicing_syntax)] to your crate.
2017-03-02 14:56:51 -08:00
Patrick Walton 5c2a580183 librustc: Forbid `..` in range patterns.
This breaks code that looks like:

    match foo {
        1..3 => { ... }
    }

Instead, write:

    match foo {
        1...3 => { ... }
    }

Closes #17295.

[breaking-change]
2017-03-02 14:56:51 -08:00
Jakub Wieczorek 93be85f7d9 Add `if let` to the reference 2017-03-02 14:56:51 -08:00
Kevin Ballard b44f1f9bea Update based on PR feedback 2017-03-02 14:56:51 -08:00
Kevin Ballard 7d2417054e Move `if let` behind a feature gate 2017-03-02 14:56:51 -08:00
Steve Klabnik b90733a9d0 clean up some references to 'owned' 2017-03-02 14:56:51 -08:00
Steve Klabnik 895b2a9489 vectors are not in the language 2017-03-02 14:56:51 -08:00
Steve Klabnik 7bab3aa486 die 'managed' 2017-03-02 14:56:51 -08:00
Steve Klabnik 15dfd6da1f logging is an external crate 2017-03-02 14:56:51 -08:00
Steve Klabnik ce2822109a no it won't 2017-03-02 14:56:50 -08:00
Steve Klabnik 277d74b114 runtime has no C++ 2017-03-02 14:56:50 -08:00
Steve Klabnik 2357a3f21e Remove lies about task scheduling
it's 1:1 by default now, and N:M is on its way out
2017-03-02 14:56:50 -08:00
Steve Klabnik 64b7114645 Fix terminology around boxes
it's just 'box' not 'owned box'
2017-03-02 14:56:50 -08:00
Steve Klabnik cd4b934993 fix example 2017-03-02 14:56:50 -08:00
Steve Klabnik 85f29fcd29 glob imports are an external crate 2017-03-02 14:56:50 -08:00
Steve Klabnik d446b6684a rust -> Rust 2017-03-02 14:56:50 -08:00
Steve Klabnik 52ca55a213 uhhh weird triple backticks 2017-03-02 14:56:50 -08:00
Steve Klabnik e8a1627557 'merican English 2017-03-02 14:56:50 -08:00
Steve Klabnik f708314faa move keywords to table 2017-03-02 14:56:50 -08:00
Steve Klabnik b1e97209fc '. ' -> '. ' 2017-03-02 14:56:49 -08:00
Steve Klabnik 34c2cbcb55 Remove disclaimer
This is just true of all of Rust, and doesn't make a lot of sense now.
Especially as we move towards finalizing things, I think it's time for
this to go.
2017-03-02 14:56:49 -08:00
Steve Klabnik 1d2cbad750 make note of language vs libraries 2017-03-02 14:56:49 -08:00
Steve Klabnik 721c7421ee modernize code blocks 2017-03-02 14:56:49 -08:00
Steve Klabnik fa5fd6c344 manual -> reference & formatting
'reference' sounds better than 'manual' to me here, and rust.html is
certainly wrong.

I also wrapped everything to 80 cols.
2017-03-02 14:56:49 -08:00