]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoauto merge of #16444 : steveklabnik/rust/fix_boxes_in_manual, r=brson
bors [Thu, 14 Aug 2014 11:16:19 +0000 (11:16 +0000)]
auto merge of #16444 : steveklabnik/rust/fix_boxes_in_manual, r=brson

Fixes #16439

9 years agoauto merge of #16440 : bheesham/rust/master, r=brson
bors [Thu, 14 Aug 2014 09:31:19 +0000 (09:31 +0000)]
auto merge of #16440 : bheesham/rust/master, r=brson

  * `rust.md`: changes for consistency

  * `guide-ffi.md`: wrapped inline code

NOTE: This is a duplicate of #16375. I completely messed up that fork, so I made a new fork.

9 years agoauto merge of #16428 : mdinger/rust/sort_attributes, r=cmr
bors [Thu, 14 Aug 2014 07:41:20 +0000 (07:41 +0000)]
auto merge of #16428 : mdinger/rust/sort_attributes, r=cmr

Targetting at fixing most of #16414.

Sorts these alphabetically:
* [Crate-only attributes](http://doc.rust-lang.org/rust.html#crate-only-attributes)
* [Function-only attributes](http://doc.rust-lang.org/rust.html#function-only-attributes)
* [Miscellaneous attributes](http://doc.rust-lang.org/rust.html#miscellaneous-attributes)
* [Lint check attributes](http://doc.rust-lang.org/rust.html#lint-check-attributes)
* [Built-in Traits](http://doc.rust-lang.org/rust.html#built-in-traits)
* [Types](http://doc.rust-lang.org/rust.html#types)
* [Deriving](http://doc.rust-lang.org/rust.html#deriving)
* [Compiler Features](http://doc.rust-lang.org/rust.html#compiler-features)

Doesn't modify these:
* [Operators](http://doc.rust-lang.org/rust.html#operators): An alternative sorting is unclear.
* [Marker types](http://doc.rust-lang.org/rust.html#marker-types): Could be sorted but uncertain how. See below.
* [Stability](http://doc.rust-lang.org/rust.html#stability): Already sorted by stability

---

[Marker types](http://doc.rust-lang.org/rust.html#marker-types) has an extra newline above `fail_` which may throw off formatting (see #16412) or it may be for some other reason. If the newline is just a typo, I can just remove it and format this alphabetically like so:
```rust
// Sorted alphabetically
a_bread
b_bread
c_bread
fail_
fail_bounds_check
a_type
b_type
c_type
```

Marker types is listed as likely to become out of date so I don't know if this is worth doing anyway.

[EDIT] modified `Marker types` now and tried to update the language items list.

9 years agoauto merge of #16332 : brson/rust/slicestab, r=aturon
bors [Thu, 14 Aug 2014 05:36:25 +0000 (05:36 +0000)]
auto merge of #16332 : brson/rust/slicestab, r=aturon

This implements some of the recommendations from https://github.com/rust-lang/meeting-minutes/blob/master/Meeting-API-review-2014-08-06.md.

Explanation in commits.

9 years agoauto merge of #15929 : pcwalton/rust/by-ref-closures, r=alexcrichton
bors [Thu, 14 Aug 2014 03:46:22 +0000 (03:46 +0000)]
auto merge of #15929 : pcwalton/rust/by-ref-closures, r=alexcrichton

by-reference upvars.

This partially implements RFC 38. A snapshot will be needed to turn this
on, because stage0 cannot yet parse the keyword.

Part of #12831.

r? @alexcrichton

9 years agoauto merge of #16477 : pnkfelix/rust/fsk-quotstx, r=brson
bors [Thu, 14 Aug 2014 01:56:26 +0000 (01:56 +0000)]
auto merge of #16477 : pnkfelix/rust/fsk-quotstx, r=brson

quote_expr macro: embed Ident using special encoding that retains hygiene state.

Fix #15750, #15962

9 years agolibrustc: Parse, but do not fully turn on, the `ref` keyword for
Patrick Walton [Wed, 23 Jul 2014 19:43:29 +0000 (12:43 -0700)]
librustc: Parse, but do not fully turn on, the `ref` keyword for
by-reference upvars.

This partially implements RFC 38. A snapshot will be needed to turn this
on, because stage0 cannot yet parse the keyword.

Part of #12381.

9 years agoFix test fallout
Brian Anderson [Wed, 13 Aug 2014 23:33:14 +0000 (16:33 -0700)]
Fix test fallout

9 years agoauto merge of #15934 : brson/rust/dur, r=aturon
bors [Wed, 13 Aug 2014 23:11:28 +0000 (23:11 +0000)]
auto merge of #15934 : brson/rust/dur, r=aturon

Currently, the Timer methods take an integer number of ms. This is considered a bug because a) types, b) some timers have ns precision.

This plucks the `Duration` type from [rust-chrono](https://github.com/lifthrasiir/rust-chrono), plops it into `std::time`,  and replaces the arguments to `sleep`, `oneshot`, and `periodic` timers with it. It leaves the old methods intact as `sleep_ms`, `oneshot_ms`, and `periodic_ms`, for convenience.

Closes https://github.com/rust-lang/rust/issues/11189.

cc @lifthrasiir @aturon @kballard @alexcrichton

9 years agoAddress some review feedback
Brian Anderson [Fri, 8 Aug 2014 01:30:03 +0000 (18:30 -0700)]
Address some review feedback

9 years agocore: Change the argument order on splitn and rsplitn for strs.
Brian Anderson [Thu, 7 Aug 2014 19:56:26 +0000 (12:56 -0700)]
core: Change the argument order on splitn and rsplitn for strs.

This makes it consistent with the same functions for slices,
and allows the search closure to be specified last.

[breaking-change]

9 years agocore: Put stability attributes all over the slice module
Brian Anderson [Thu, 7 Aug 2014 06:59:12 +0000 (23:59 -0700)]
core: Put stability attributes all over the slice module

Much of this is as discussed[1]. Many things are marked

[1]: https://github.com/rust-lang/meeting-minutes/blob/master/Meeting-API-review-2014-08-06.md

9 years agoFix test fallout
Brian Anderson [Wed, 13 Aug 2014 22:26:48 +0000 (15:26 -0700)]
Fix test fallout

9 years agoSort `Marker types` and add missing language items
mdinger [Wed, 13 Aug 2014 22:11:10 +0000 (18:11 -0400)]
Sort `Marker types` and add missing language items

9 years agoauto merge of #16438 : phi-gamma/rust/doc-fixes, r=brson
bors [Wed, 13 Aug 2014 21:26:28 +0000 (21:26 +0000)]
auto merge of #16438 : phi-gamma/rust/doc-fixes, r=brson

Fixes wording in the *runtime*, *testing* and *unsafe* guides.

9 years agoauto merge of #16476 : andreastt/rust/ato/consistency_if_expr_example, r=steveklabnik
bors [Wed, 13 Aug 2014 18:36:27 +0000 (18:36 +0000)]
auto merge of #16476 : andreastt/rust/ato/consistency_if_expr_example, r=steveklabnik

9 years agoAdd a fixme about Duration representation
Brian Anderson [Tue, 12 Aug 2014 23:25:21 +0000 (16:25 -0700)]
Add a fixme about Duration representation

9 years agoUpdate docs
Brian Anderson [Fri, 8 Aug 2014 01:22:31 +0000 (18:22 -0700)]
Update docs

9 years agostd: Fix build errors
Brian Anderson [Thu, 7 Aug 2014 23:00:22 +0000 (16:00 -0700)]
std: Fix build errors

9 years agostd: Remove Duration::new/new_opt/to_tuple
Brian Anderson [Thu, 7 Aug 2014 22:48:52 +0000 (15:48 -0700)]
std: Remove Duration::new/new_opt/to_tuple

These all expose the underlying data representation and are
not the most convenient way of instantiation anyway.

9 years agostd: Improve Duration comments
Brian Anderson [Thu, 7 Aug 2014 22:45:48 +0000 (15:45 -0700)]
std: Improve Duration comments

9 years agostd: Make connect_timeout return Err on zero duration
Brian Anderson [Mon, 4 Aug 2014 23:21:47 +0000 (16:21 -0700)]
std: Make connect_timeout return Err on zero duration

[breaking-change]

9 years agoFix various fallout from timer changes
Brian Anderson [Sat, 2 Aug 2014 01:05:26 +0000 (18:05 -0700)]
Fix various fallout from timer changes

9 years agoFix compiletest to use Duration
Brian Anderson [Fri, 1 Aug 2014 01:03:20 +0000 (18:03 -0700)]
Fix compiletest to use Duration

9 years agostd: Refactor time module a bit
Brian Anderson [Fri, 1 Aug 2014 00:24:54 +0000 (17:24 -0700)]
std: Refactor time module a bit

Put `Duration` in `time::duration`, where the two constants can
be called just `MAX` and `MIN`. Reexport from `time`.
This provides more room for the time module to expand.

9 years agostd: connect_timeout requires a positive Duration
Brian Anderson [Fri, 1 Aug 2014 00:03:27 +0000 (17:03 -0700)]
std: connect_timeout requires a positive Duration

This is only breaking if you were previously specifying a duration
of zero for some mysterious reason.

[breaking-change]

9 years agostd: Make the TCP/UDP connect_timeout methods take Duration
Brian Anderson [Thu, 31 Jul 2014 22:58:39 +0000 (15:58 -0700)]
std: Make the TCP/UDP connect_timeout methods take Duration

[breaking-change]

9 years agostd: Clarify what timers do with zero and negative durations
Brian Anderson [Thu, 31 Jul 2014 03:07:41 +0000 (20:07 -0700)]
std: Clarify what timers do with zero and negative durations

Add tests. Also fix a bunch of broken time tests.

9 years agostd: Restore missing timer examples
Brian Anderson [Wed, 30 Jul 2014 20:14:33 +0000 (13:14 -0700)]
std: Restore missing timer examples

9 years agostd: Remove the `zero` constructor from `Duration`
Brian Anderson [Mon, 28 Jul 2014 23:25:58 +0000 (16:25 -0700)]
std: Remove the `zero` constructor from `Duration`

This is a workaround for having to write `Zero::zero` and will
be solved at the language level someday.

9 years agostd: Remove ms-taking methods from timers
Brian Anderson [Mon, 28 Jul 2014 23:04:57 +0000 (16:04 -0700)]
std: Remove ms-taking methods from timers

9 years agostd: Change time::MAX to time::MAX_DURATION, etc.
Brian Anderson [Mon, 28 Jul 2014 22:58:22 +0000 (15:58 -0700)]
std: Change time::MAX to time::MAX_DURATION, etc.

9 years agostd: Update Duration from upstream
Brian Anderson [Mon, 28 Jul 2014 22:54:05 +0000 (15:54 -0700)]
std: Update Duration from upstream

From rust-chrono 4f34003e03e259bd5cbda0cb4d35325861307cc6

9 years agostd: Add comments to the time module
Brian Anderson [Thu, 24 Jul 2014 01:13:29 +0000 (18:13 -0700)]
std: Add comments to the time module

9 years agostd: Add sleep, oneshot and periodic timers, taking Duration
Brian Anderson [Tue, 15 Jul 2014 03:03:17 +0000 (20:03 -0700)]
std: Add sleep, oneshot and periodic timers, taking Duration

9 years agostd: Rename sleep, periodic, and oneshot timers to sleep_ms, etc.
Brian Anderson [Tue, 15 Jul 2014 02:30:05 +0000 (19:30 -0700)]
std: Rename sleep, periodic, and oneshot timers to sleep_ms, etc.

Rename io::timer::sleep, Timer::sleep, Timer::oneshot,
Timer::periodic, to sleep_ms, oneshot_ms, periodic_ms. These functions
all take an integer and interpret it as milliseconds.

Replacement functions will be added that take Duration.

[breaking-change]

9 years agostd: Add a Duration type
Brian Anderson [Tue, 15 Jul 2014 02:18:07 +0000 (19:18 -0700)]
std: Add a Duration type

Taken from rust-chrono[1]. Needed for timers per #11189.
Experimental.

[1]: https://github.com/lifthrasiir/rust-chrono

9 years agocore: Add binary_search and binary_search_elem methods to slices.
Brian Anderson [Thu, 7 Aug 2014 03:48:25 +0000 (20:48 -0700)]
core: Add binary_search and binary_search_elem methods to slices.

These are like the existing bsearch methods but if the search fails,
it returns the next insertion point.

The new `binary_search` returns a `BinarySearchResult` that is either
`Found` or `NotFound`. For convenience, the `found` and `not_found`
methods convert to `Option`, ala `Result`.

Deprecate bsearch and bsearch_elem.

9 years agocore: Rename ImmutableEqSlice to ImmutablePartialEqSlice
Brian Anderson [Thu, 7 Aug 2014 03:49:52 +0000 (20:49 -0700)]
core: Rename ImmutableEqSlice to ImmutablePartialEqSlice

This is in the prelude and won't break much code.

[breaking-change]

9 years agocollections: Deprecate Vec::tailn. Same as slice_from
Brian Anderson [Thu, 7 Aug 2014 03:20:57 +0000 (20:20 -0700)]
collections: Deprecate Vec::tailn. Same as slice_from

9 years agocore: Rename MutableCloneableSlice::copy_from to clone_from_slice
Brian Anderson [Thu, 7 Aug 2014 03:17:03 +0000 (20:17 -0700)]
core: Rename MutableCloneableSlice::copy_from to clone_from_slice

Deprecate the previous.

9 years agocore: Deprecate ImmutableSlice::tailn and initn
Brian Anderson [Thu, 7 Aug 2014 03:12:48 +0000 (20:12 -0700)]
core: Deprecate ImmutableSlice::tailn and initn

These are equivalent to slice_from and slice_to.

9 years agocore: Rename ImmutableSlice::unsafe_ref to unsafe_get
Brian Anderson [Thu, 7 Aug 2014 03:08:16 +0000 (20:08 -0700)]
core: Rename ImmutableSlice::unsafe_ref to unsafe_get

Deprecate the previous.

9 years agostd: Rename slice::Vector to Slice
Brian Anderson [Thu, 7 Aug 2014 03:03:55 +0000 (20:03 -0700)]
std: Rename slice::Vector to Slice

This required some contortions because importing both raw::Slice
and slice::Slice makes rustc crash.

Since `Slice` is in the prelude, this renaming is unlikely to
casue breakage.

[breaking-change]

9 years agostd: Rename various slice traits for consistency
Brian Anderson [Thu, 7 Aug 2014 01:58:43 +0000 (18:58 -0700)]
std: Rename various slice traits for consistency

ImmutableVector -> ImmutableSlice
ImmutableEqVector -> ImmutableEqSlice
ImmutableOrdVector -> ImmutableOrdSlice
MutableVector -> MutableSlice
MutableVectorAllocating -> MutableSliceAllocating
MutableCloneableVector -> MutableCloneableSlice
MutableOrdVector -> MutableOrdSlice

These are all in the prelude so most code will not break.

[breaking-change]

9 years agorustc lexer: regression tests for embedded Idents.
Felix S. Klock II [Wed, 13 Aug 2014 11:15:31 +0000 (13:15 +0200)]
rustc lexer: regression tests for embedded Idents.

I chose to make two of them because I wanted something close to an
"end-to-end" test (*), but at the same time I wanted a test that
would run on Windows (**).

(*) The run-make test serves as the end-to-end: It constructs an input
that is trying to subvert the hack and we are going to check that it
fails in the attempt).

(**) The compile-fail-fulldeps test serves as a more narrow test that
will be tested on all platforms.  It also attempts to subvert the
hack, testing that when you use `new_parser_from_tts`, the resulting
parser does not support reading embedded Idents.

9 years agoquote_expr macro: embed Ident using special encoding that preserves hygiene.
Felix S. Klock II [Fri, 1 Aug 2014 15:11:53 +0000 (17:11 +0200)]
quote_expr macro: embed Ident using special encoding that preserves hygiene.

This adds support to `quote_expr!` and friends for round-trip hygienic
preservation of Ident.

Here are the pieces of the puzzle:

* adding a method for encoding Ident for re-reading into token tree.

* Support for reading such encoded Idents in the lexer.  Note that one
  must peek ahead for MOD_SEP after scan_embedded_hygienic_ident.

* To ensure that encoded Idents are only read when we are in the midst
  of expanding a `quote_expr` or similar, added a
  `read_embedded_ident` flag on `StringReader`.

* pprust support for encoding Ident's as (uint,uint) pairs (for hygiene).

9 years agoGuide: Add missing integer type to section on if expressions
Andreas Tolfsen [Wed, 13 Aug 2014 14:58:12 +0000 (15:58 +0100)]
Guide: Add missing integer type to section on if expressions

9 years agoauto merge of #16381 : pnkfelix/rust/fsk-rust.md-fixes, r=alexcrichton
bors [Wed, 13 Aug 2014 14:16:27 +0000 (14:16 +0000)]
auto merge of #16381 : pnkfelix/rust/fsk-rust.md-fixes, r=alexcrichton

rust.md: Explicitly point out how special `'static` is.

Drive-by: fix description of `&content` to point out that `&'f type` is (as of today) only for type expressions.
9 years agoauto merge of #16421 : ipetkov/rust/cmd-fd-fix-retry, r=alexcrichton
bors [Wed, 13 Aug 2014 05:56:20 +0000 (05:56 +0000)]
auto merge of #16421 : ipetkov/rust/cmd-fd-fix-retry, r=alexcrichton

Retry pull requesting of https://github.com/rust-lang/rust/pull/16407 after accidentally messing up rebasing of branches and making bors think the PR was merged

9 years agoauto merge of #16460 : pcwalton/rust/borrowck-closure-issue, r=nikomatsakis
bors [Wed, 13 Aug 2014 04:11:22 +0000 (04:11 +0000)]
auto merge of #16460 : pcwalton/rust/borrowck-closure-issue, r=nikomatsakis

This fixes borrow checking for closures. Code like this will break:

    struct Foo {
        x: int,
    }

    pub fn main() {
        let mut this = &mut Foo {
            x: 1,
        };
        let r = || {
            let p = &this.x;
            &mut this.x;
        };
        r()
    }

Change this code to not take multiple mutable references to the same value. For
example:

    struct Foo {
        x: int,
    }

    pub fn main() {
        let mut this = &mut Foo {
            x: 1,
        };
        let r = || {
            &mut this.x;
        };
        r()
    }

Closes #16361.

[breaking-change]

r? @nikomatsakis

9 years agoauto merge of #16458 : pcwalton/rust/borrowck-for-moves, r=nikomatsakis
bors [Wed, 13 Aug 2014 02:26:23 +0000 (02:26 +0000)]
auto merge of #16458 : pcwalton/rust/borrowck-for-moves, r=nikomatsakis

`for` loop heads.

This breaks code like:

    let x = Some(box 1i);
    for &a in x.iter() {
    }

Change this code to obey the borrow checking rules. For example:

    let x = Some(box 1i);
    for &ref a in x.iter() {
    }

Closes #16205.

[breaking-change]

r? @nikomatsakis

9 years agolibnative: process spawning should not close inherited file descriptors
Ivan Petkov [Sun, 10 Aug 2014 21:10:34 +0000 (14:10 -0700)]
libnative: process spawning should not close inherited file descriptors

* The caller should be responsible for cleaning up file descriptors
* If a caller safely creates a file descriptor (via
  native::io::file::open) the returned structure (FileDesc) will try to
  clean up the file, failing in the process and writing error messages
  to the screen.
* This should not happen as the caller has no public interface for
  telling the FileDesc structure to NOT free the underlying fd.
* Alternatively, if another file is opened under the same fd held by
  the FileDesc structure returned by native::io::file::open, it will
  close the wrong file upon destruction.

9 years agoauto merge of #16452 : epdtry/rust/unreachable-item-ice, r=pcwalton
bors [Wed, 13 Aug 2014 00:41:22 +0000 (00:41 +0000)]
auto merge of #16452 : epdtry/rust/unreachable-item-ice, r=pcwalton

This code produces an ICE:

```rust
#![crate_type = "rlib"]
fn main() {
    if true { return }
    // remaining code is unreachable
    match () {
        () => { static MAGIC: uint = 0; }
    }
}
```
([playpen](http://is.gd/iwOISB))

The error is "encode_symbol: id not found 18", where 18 is the `NodeId` of the declaration of `MAGIC`.  The problem is that `rustc` tries to emit metadata for `MAGIC`, but some of the information is missing because `MAGIC` never gets translated by `trans_item` - the entire body of the `match` gets skipped because the `match` itself is unreachable.

This branch simplifies the handling of inner items by always processing them using the `trans_item` visitor, instead of sometimes using the visitor and sometimes waiting until `trans_stmt` encounters the item.  This fixes the ICE by making the translation of the item no longer depend on the declaration being reachable code.  This branch also reverts #16059 and #16359, since the new change to item translation fixes the same problems as those but is simpler.

9 years agomore consistent handling of inner items
Stuart Pernsteiner [Tue, 12 Aug 2014 16:19:47 +0000 (09:19 -0700)]
more consistent handling of inner items

9 years agoRevert "avoid redundant translation of items during monomorphization"
Stuart Pernsteiner [Mon, 11 Aug 2014 23:55:13 +0000 (16:55 -0700)]
Revert "avoid redundant translation of items during monomorphization"

This reverts commit f97f65f7b70e455c1c3e72e620120c9f1a96d89a.

Conflicts:
src/librustc/middle/trans/base.rs
src/librustc/middle/trans/foreign.rs
src/librustc/middle/trans/monomorphize.rs

9 years agoRevert "don't translate items when monomorphizing foreign-ABI functions"
Stuart Pernsteiner [Mon, 11 Aug 2014 23:54:16 +0000 (16:54 -0700)]
Revert "don't translate items when monomorphizing foreign-ABI functions"

This reverts commit 0c158b4fbfcec7d6f18859661047dff2109fdfe4.

9 years agolibrustc: Use the correct categorized mutable type for the pattern in
Patrick Walton [Tue, 12 Aug 2014 19:51:23 +0000 (12:51 -0700)]
librustc: Use the correct categorized mutable type for the pattern in
`for` loop heads.

This breaks code like:

    let x = Some(box 1i);
        for &a in x.iter() {
    }

Change this code to obey the borrow checking rules. For example:

    let x = Some(box 1i);
        for &ref a in x.iter() {
    }

Closes #16205.

[breaking-change]

9 years agoauto merge of #16433 : aturon/rust/deprecated-in-crate, r=alexcrichton
bors [Tue, 12 Aug 2014 22:01:25 +0000 (22:01 +0000)]
auto merge of #16433 : aturon/rust/deprecated-in-crate, r=alexcrichton

Previously the stability lint considered cross-crate items only. That's appropriate for unstable and experimental levels, but not for deprecation.

In addition to changing the lint, this PR takes care of the fallout: a number of deprecated items that were being used throughout libstd.

Closes #16409

Due to deny(deprecated), this is a:

[breaking-change]

9 years agolibrustc: Record unique immutable borrows in the restrictions table.
Patrick Walton [Tue, 12 Aug 2014 21:25:41 +0000 (14:25 -0700)]
librustc: Record unique immutable borrows in the restrictions table.

This fixes borrow checking for closures. Code like this will break:

    struct Foo {
        x: int,
    }

    pub fn main() {
        let mut this = &mut Foo {
            x: 1,
        };
        let r = || {
            let p = &this.x;
            &mut this.x;
        };
        r()
    }

Change this code to not take multiple mutable references to the same value. For
example:

    struct Foo {
        x: int,
    }

    pub fn main() {
        let mut this = &mut Foo {
            x: 1,
        };
        let r = || {
            &mut this.x;
        };
        r()
    }

Closes #16361.

[breaking-change]

9 years agoAllow deprecation in deprecated libraries
Aaron Turon [Tue, 12 Aug 2014 00:33:43 +0000 (17:33 -0700)]
Allow deprecation in deprecated libraries

9 years agoDeprecation fallout in libsync
Aaron Turon [Tue, 12 Aug 2014 00:18:19 +0000 (17:18 -0700)]
Deprecation fallout in libsync

9 years agoDeprecation fallout in libcollections
Aaron Turon [Mon, 11 Aug 2014 23:47:46 +0000 (16:47 -0700)]
Deprecation fallout in libcollections

9 years agoEnable deprecation lint on crate-local items
Aaron Turon [Mon, 11 Aug 2014 23:39:34 +0000 (16:39 -0700)]
Enable deprecation lint on crate-local items

Previously the lint considered cross-crate items only. That's
appropriate for unstable and experimental levels, but not for
deprecation.

Closes #16409

Due to deny(deprecation), this is a:

[breaking-change]

9 years agoauto merge of #16454 : pcwalton/rust/types-in-path-patterns, r=brson
bors [Tue, 12 Aug 2014 20:06:30 +0000 (20:06 +0000)]
auto merge of #16454 : pcwalton/rust/types-in-path-patterns, r=brson

patterns.

This breaks code like:

    fn main() {
        match Some("foo") {
            None::<int> => {}
            Some(_) => {}
        }
    }

Change this code to not contain a type error. For example:

    fn main() {
        match Some("foo") {
            None::<&str> => {}
            Some(_) => {}
        }
    }

Closes #16353.

[breaking-change]

r? @huonw

9 years agoguide-unsafe.md: fix wording
Philipp Gesang [Tue, 12 Aug 2014 19:30:02 +0000 (21:30 +0200)]
guide-unsafe.md: fix wording

Following a suggestion by Huon Wilson.

9 years agoauto merge of #16081 : luqmana/rust/nr, r=pcwalton
bors [Tue, 12 Aug 2014 18:16:33 +0000 (18:16 +0000)]
auto merge of #16081 : luqmana/rust/nr, r=pcwalton

Fixes #15763

9 years agolibsyntax: Don't strip types and lifetimes from single-segment paths in
Patrick Walton [Tue, 12 Aug 2014 17:33:16 +0000 (10:33 -0700)]
libsyntax: Don't strip types and lifetimes from single-segment paths in
patterns.

This breaks code like:

    fn main() {
        match Some("foo") {
            None::<int> => {}
            Some(_) => {}
        }
    }

Change this code to not contain a type error. For example:

    fn main() {
        match Some("foo") {
            None::<&str> => {}
            Some(_) => {}
        }
    }

Closes #16353.

[breaking-change]

9 years ago~ -> Box in the manual
Steve Klabnik [Tue, 12 Aug 2014 11:00:25 +0000 (07:00 -0400)]
~ -> Box in the manual

Fixes #16439

9 years agoauto merge of #16434 : vadimcn/rust/many-crates-but-no-match, r=alexcrichton
bors [Tue, 12 Aug 2014 09:31:17 +0000 (09:31 +0000)]
auto merge of #16434 : vadimcn/rust/many-crates-but-no-match, r=alexcrichton

9 years agoauto merge of #16425 : nham/rust/fix_nan_format, r=alexcrichton
bors [Tue, 12 Aug 2014 07:31:17 +0000 (07:31 +0000)]
auto merge of #16425 : nham/rust/fix_nan_format, r=alexcrichton

Currently, this:

    println!("{}", std::f64::NAN);

prints "-NaN". This commit is an attempt to change that to "NaN" instead.

9 years agoMinor changes to `rust.md`, and `guide-ffi.md`.
Bheesham Persaud [Tue, 12 Aug 2014 07:13:50 +0000 (03:13 -0400)]
Minor changes to `rust.md`, and `guide-ffi.md`.

  * `rust.md`: whanges for consistency

  * `guide-ffi.md`: wrapped inline code

9 years agoguide-unsafe.md: fix noun
Philipp Gesang [Wed, 6 Aug 2014 19:21:12 +0000 (21:21 +0200)]
guide-unsafe.md: fix noun

9 years agoguide-testing.md: add auxiliary verb
Philipp Gesang [Mon, 21 Jul 2014 21:45:52 +0000 (23:45 +0200)]
guide-testing.md: add auxiliary verb

9 years agoguide-runtime.md: remove redundant verb
Philipp Gesang [Sun, 20 Jul 2014 15:59:41 +0000 (17:59 +0200)]
guide-runtime.md: remove redundant verb

9 years agoauto merge of #16195 : P1start/rust/more-index, r=aturon
bors [Tue, 12 Aug 2014 05:11:18 +0000 (05:11 +0000)]
auto merge of #16195 : P1start/rust/more-index, r=aturon

Implement `Index` for `RingBuf`, `HashMap`, `TreeMap`, `SmallIntMap`, and `TrieMap`.

If there’s anything that I missed or should be removed, let me know.

9 years agolibrustc: Don't use an alloca per return if the function doesn't have nested returns.
Luqman Aden [Tue, 12 Aug 2014 02:16:00 +0000 (19:16 -0700)]
librustc: Don't use an alloca per return if the function doesn't have nested returns.

9 years agoImplement Index for TrieMap
P1start [Sat, 2 Aug 2014 07:08:08 +0000 (19:08 +1200)]
Implement Index for TrieMap

9 years agoImplement Index for SmallIntMap
P1start [Sat, 2 Aug 2014 07:01:33 +0000 (19:01 +1200)]
Implement Index for SmallIntMap

This also deprecates SmallIntMap::get. Use indexing instead.

9 years agoImplement Index for TreeMap
P1start [Sat, 2 Aug 2014 06:54:38 +0000 (18:54 +1200)]
Implement Index for TreeMap

9 years agoImplement Index for HashMap
P1start [Sat, 2 Aug 2014 06:48:44 +0000 (18:48 +1200)]
Implement Index for HashMap

This also deprecates HashMap::get. Use indexing instead.

9 years agoImplement Index for RingBuf
P1start [Sat, 2 Aug 2014 06:39:39 +0000 (18:39 +1200)]
Implement Index for RingBuf

This also deprecates RingBuf::get. Use indexing instead.

9 years agoauto merge of #16284 : alexcrichton/rust/issue-16272, r=aturon
bors [Tue, 12 Aug 2014 03:31:20 +0000 (03:31 +0000)]
auto merge of #16284 : alexcrichton/rust/issue-16272, r=aturon

There was a bug in both libnative and libuv which prevented child processes from
being spawned correctly on windows when one of the arguments was an empty
string. The libuv bug has since been fixed upstream, and the libnative bug was
fixed as part of this commit.

When updating libuv, this also includes a fix for #15149.

Closes #15149
Closes #16272

9 years agoChange std::fmt::{Float,LowerExp,UpperExp} to not print '-NaN' for f32::NAN and f64...
nham [Mon, 11 Aug 2014 19:00:07 +0000 (15:00 -0400)]
Change std::fmt::{Float,LowerExp,UpperExp} to not print '-NaN' for f32::NAN and f64::NAN

9 years agolibrustc: Don't use Load/Store for structural values.
Luqman Aden [Mon, 11 Aug 2014 22:58:46 +0000 (15:58 -0700)]
librustc: Don't use Load/Store for structural values.

9 years agolibrustc: Don't allow return_address intrinsic in functions that don't use an out...
Luqman Aden [Tue, 5 Aug 2014 21:38:14 +0000 (14:38 -0700)]
librustc: Don't allow return_address intrinsic in functions that don't use an out pointer.

9 years agolibrustc: Add an intrinsic to retrieve the return pointer of a function.
Patrick Walton [Mon, 4 Aug 2014 18:48:26 +0000 (11:48 -0700)]
librustc: Add an intrinsic to retrieve the return pointer of a function.

This is needed for some GC stuff in Servo.

9 years agoReenable ignored test and add run-pass test.
Luqman Aden [Tue, 29 Jul 2014 19:35:38 +0000 (12:35 -0700)]
Reenable ignored test and add run-pass test.

9 years agolibrustc: Use separate stack slot for each return.
Luqman Aden [Tue, 29 Jul 2014 19:25:06 +0000 (12:25 -0700)]
librustc: Use separate stack slot for each return.

9 years agoFix many-crates-but-no-match test. (Issue #16348)
Vadim Chugunov [Fri, 8 Aug 2014 18:03:48 +0000 (11:03 -0700)]
Fix many-crates-but-no-match test. (Issue #16348)

9 years agoauto merge of #16417 : jasonthompson/rust/docs/slice3, r=alexcrichton
bors [Tue, 12 Aug 2014 00:26:13 +0000 (00:26 +0000)]
auto merge of #16417 : jasonthompson/rust/docs/slice3, r=alexcrichton

- Moved examples for permutations and next into trait definition as
   comments on pull request #16244.
- Fixed (hopefully) issue with erronious commit of changes to src/llvm.

9 years agoauto merge of #16427 : brson/rust/https, r=thestinger
bors [Mon, 11 Aug 2014 22:46:16 +0000 (22:46 +0000)]
auto merge of #16427 : brson/rust/https, r=thestinger

9 years agoauto merge of #16429 : steveklabnik/rust/guide_vectors, r=cmr
bors [Mon, 11 Aug 2014 20:31:20 +0000 (20:31 +0000)]
auto merge of #16429 : steveklabnik/rust/guide_vectors, r=cmr

Since https://github.com/rust-lang/rust/pull/16380 didn't get pulled in yet, I added it in here too.

This covers the very, very, very basics of vectors. I wanted to have a section that mentioned them, but I'm
unsure what else I should cover. So I just did the absolute simplest things. Feedback very welcome.

9 years agoGuide: vectors
Steve Klabnik [Mon, 11 Aug 2014 20:21:41 +0000 (16:21 -0400)]
Guide: vectors

9 years agoDownload snapshots using HTTPS
Brian Anderson [Mon, 11 Aug 2014 19:31:02 +0000 (12:31 -0700)]
Download snapshots using HTTPS

cc #16123

9 years agoUpdate docs to use HTTPS for static.rust-lang.org addresses
Brian Anderson [Mon, 11 Aug 2014 19:30:37 +0000 (12:30 -0700)]
Update docs to use HTTPS for static.rust-lang.org addresses

cc #16123

9 years agoSort most attributes alphabetically
mdinger [Mon, 11 Aug 2014 19:29:44 +0000 (15:29 -0400)]
Sort most attributes alphabetically

9 years agoauto merge of #16416 : nick29581/rust/log, r=pnkfelix
bors [Mon, 11 Aug 2014 11:06:08 +0000 (11:06 +0000)]
auto merge of #16416 : nick29581/rust/log, r=pnkfelix

Previously we would accept an empty log level without an equals sign, but not with one. This addresses that minor nit. E.g., `RUST_LOG=rustc::middle::trans=` will work the same as `RUST_LOG=rustc::middle::trans`.

9 years agoAPI docs/examples for std::slice
Jason Thompson [Thu, 31 Jul 2014 10:13:44 +0000 (06:13 -0400)]
API docs/examples for std::slice

 - API doc/example for next() in Permutations
 - API doc/example for permutations() in ImmutableCloneableVector
 - Moved examples for permutations and next into trait definition as
   comments on pull request #16244.
 - Fix erroneus inclusion of src/llvm in older commit.

9 years agoAccept empty log level
Nick Cameron [Mon, 11 Aug 2014 09:53:04 +0000 (10:53 +0100)]
Accept empty log level