Commit Graph

2948 Commits

Author SHA1 Message Date
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