]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agorollup merge of #16849 : nhowell/patch-1
Alex Crichton [Sun, 31 Aug 2014 06:48:05 +0000 (23:48 -0700)]
rollup merge of #16849 : nhowell/patch-1

9 years agorollup merge of #16846 : treeman/debug-doc
Alex Crichton [Sun, 31 Aug 2014 06:47:53 +0000 (23:47 -0700)]
rollup merge of #16846 : treeman/debug-doc

9 years agorollup merge of #16842 : zsiciarz/master
Alex Crichton [Sun, 31 Aug 2014 06:47:38 +0000 (23:47 -0700)]
rollup merge of #16842 : zsiciarz/master

9 years agorollup merge of #16840 : huonw/feature-has-added
Alex Crichton [Sun, 31 Aug 2014 06:47:33 +0000 (23:47 -0700)]
rollup merge of #16840 : huonw/feature-has-added

9 years agorollup merge of #16839 : treeman/issue-15358
Alex Crichton [Sun, 31 Aug 2014 06:47:23 +0000 (23:47 -0700)]
rollup merge of #16839 : treeman/issue-15358

9 years agorollup merge of #16835 : michaelsproul/doc-slice-failure
Alex Crichton [Sun, 31 Aug 2014 06:47:17 +0000 (23:47 -0700)]
rollup merge of #16835 : michaelsproul/doc-slice-failure

9 years agorollup merge of #16833 : SebastianZaha/fix-guide-typo
Alex Crichton [Sun, 31 Aug 2014 06:47:12 +0000 (23:47 -0700)]
rollup merge of #16833 : SebastianZaha/fix-guide-typo

9 years agorollup merge of #16832 : SebastianZaha/fix-inconsistent-version-numbering
Alex Crichton [Sun, 31 Aug 2014 06:47:07 +0000 (23:47 -0700)]
rollup merge of #16832 : SebastianZaha/fix-inconsistent-version-numbering

9 years agorollup merge of #16830 : cgaebel/docfix
Alex Crichton [Sun, 31 Aug 2014 06:47:03 +0000 (23:47 -0700)]
rollup merge of #16830 : cgaebel/docfix

9 years agorollup merge of #16828 : steveklabnik/more_pointer_guide
Alex Crichton [Sun, 31 Aug 2014 06:46:46 +0000 (23:46 -0700)]
rollup merge of #16828 : steveklabnik/more_pointer_guide

9 years agorollup merge of #16807 : nham/guide_added_ownership_rule
Alex Crichton [Sun, 31 Aug 2014 06:46:38 +0000 (23:46 -0700)]
rollup merge of #16807 : nham/guide_added_ownership_rule

9 years agorollup merge of #16780 : mdinger/marker_types
Alex Crichton [Sun, 31 Aug 2014 06:46:19 +0000 (23:46 -0700)]
rollup merge of #16780 : mdinger/marker_types

9 years agorollup merge of #16778 : jbcrail/fix-issue-15826
Alex Crichton [Sun, 31 Aug 2014 06:46:06 +0000 (23:46 -0700)]
rollup merge of #16778 : jbcrail/fix-issue-15826

9 years agorollup merge of #16769 : rgawdzik/abs_doc_addition
Alex Crichton [Sun, 31 Aug 2014 06:45:52 +0000 (23:45 -0700)]
rollup merge of #16769 : rgawdzik/abs_doc_addition

9 years agorollup merge of #16726 : tshepang/consistency
Alex Crichton [Sun, 31 Aug 2014 06:45:44 +0000 (23:45 -0700)]
rollup merge of #16726 : tshepang/consistency

9 years agorollup merge of #16721 : tshepang/convenience
Alex Crichton [Sun, 31 Aug 2014 06:45:41 +0000 (23:45 -0700)]
rollup merge of #16721 : tshepang/convenience

9 years agorollup merge of #16716 : tshepang/temp
Alex Crichton [Sun, 31 Aug 2014 06:45:37 +0000 (23:45 -0700)]
rollup merge of #16716 : tshepang/temp

9 years agoauto merge of #16393 : SimonSapin/rust/patch-9, r=steveklabnik
bors [Sat, 30 Aug 2014 23:51:25 +0000 (23:51 +0000)]
auto merge of #16393 : SimonSapin/rust/patch-9, r=steveklabnik

9 years agoauto merge of #16873 : alexcrichton/rust/ignore-deadlocks, r=sfackler
bors [Sat, 30 Aug 2014 21:51:25 +0000 (21:51 +0000)]
auto merge of #16873 : alexcrichton/rust/ignore-deadlocks, r=sfackler

This test apparently keeps making no progress and timing out builds on the OSX
builder, so this commit is switching the test to be ignored.

cc #16872

9 years agodoc: Add another restriction to the list of ownership rules.
nham [Thu, 28 Aug 2014 00:02:59 +0000 (20:02 -0400)]
doc: Add another restriction to the list of ownership rules.

9 years agonote about ref patterns in pointer guide
Steve Klabnik [Thu, 28 Aug 2014 19:12:18 +0000 (15:12 -0400)]
note about ref patterns in pointer guide

Fixes #13602

9 years agoauto merge of #16859 : alexcrichton/rust/snapshots, r=huonw
bors [Sat, 30 Aug 2014 19:51:25 +0000 (19:51 +0000)]
auto merge of #16859 : alexcrichton/rust/snapshots, r=huonw

9 years agoFix grammar of the accepted feature warning.
Huon Wilson [Fri, 29 Aug 2014 08:03:13 +0000 (18:03 +1000)]
Fix grammar of the accepted feature warning.

9 years agoauto merge of #16598 : bkoropoff/rust/import-shadow-name, r=alexcrichton
bors [Sat, 30 Aug 2014 12:41:22 +0000 (12:41 +0000)]
auto merge of #16598 : bkoropoff/rust/import-shadow-name, r=alexcrichton

This partially alleviates the confusing behavior in issue #16597

9 years agoauto merge of #16419 : huonw/rust/pretty-expanded-hygiene, r=pnkfelix
bors [Sat, 30 Aug 2014 10:51:26 +0000 (10:51 +0000)]
auto merge of #16419 : huonw/rust/pretty-expanded-hygiene, r=pnkfelix

Different Identifiers and Names can have identical textual representations, but different internal representations, due to the macro hygiene machinery (syntax contexts and gensyms). This provides a way to see these internals by compiling with `--pretty expanded,hygiene`.

This is useful for debugging & hacking on macros (e.g. diagnosing https://github.com/rust-lang/rust/issues/15750/https://github.com/rust-lang/rust/issues/15962 likely would've been faster with this functionality).

E.g.

```rust
#![feature(macro_rules)]
// minimal junk
#![no_std]

macro_rules! foo {
    ($x: ident) => { y + $x }
}

fn bar() {
    foo!(x)
}
```
```rust
#![feature(macro_rules)]
// minimal junk
#![no_std]

fn bar /* 61#0 */() { y /* 60#2 */ + x /* 58#3 */ }
```

9 years agoauto merge of #16190 : Pythoner6/rust/labeled-while-loop, r=alexcrichton
bors [Sat, 30 Aug 2014 09:01:20 +0000 (09:01 +0000)]
auto merge of #16190 : Pythoner6/rust/labeled-while-loop, r=alexcrichton

Fixes #12643

> Say!
> I like labelled breaks/continues!

I will use them with a `for` loop.
And I will use with a `loop` loop.
Say! I will use them ANYWHERE!
… _even_ in a `while` loop.

Because they're now supported there.

9 years agorustc: implement a pretty mode to print ident/name's ctxt & gensyms.
Huon Wilson [Mon, 11 Aug 2014 12:01:37 +0000 (22:01 +1000)]
rustc: implement a pretty mode to print ident/name's ctxt & gensyms.

`--pretty expanded,hygiene` is helpful with debugging macro issues,
since two identifiers/names can be textually the same, but different
internally (resulting in weird "undefined variable" errors).

9 years agotest: Ignore a deadlocking test on OSX
Alex Crichton [Sat, 30 Aug 2014 06:25:35 +0000 (23:25 -0700)]
test: Ignore a deadlocking test on OSX

This test apparently keeps making no progress and timing out builds on the OSX
builder, so this commit is switching the test to be ignored.

cc #16872

9 years agodoc: make docs build
Tshepang Lekhonkhobe [Sat, 30 Aug 2014 06:02:40 +0000 (08:02 +0200)]
doc: make docs build

Addresses this comment:
https://github.com/rust-lang/rust/pull/16721#issuecomment-53946624

9 years agoauto merge of #16322 : michaelwoerister/rust/gdb-pretty, r=alexcrichton
bors [Sat, 30 Aug 2014 04:01:24 +0000 (04:01 +0000)]
auto merge of #16322 : michaelwoerister/rust/gdb-pretty, r=alexcrichton

Also extends the autotest framework to let a test case choose if pretty printing should be enabled.

9 years agoFixed missing use statement
Joseph Martin [Mon, 25 Aug 2014 10:35:03 +0000 (06:35 -0400)]
Fixed missing use statement

9 years agoFix formatting, update copyright dates
Pythoner6 [Sun, 27 Jul 2014 11:50:46 +0000 (07:50 -0400)]
Fix formatting, update copyright dates

9 years agoAdd support for labeled while loops.
Pythoner6 [Sat, 26 Jul 2014 00:12:51 +0000 (20:12 -0400)]
Add support for labeled while loops.

9 years agoauto merge of #15773 : P1start/rust/style-lints, r=alexcrichton
bors [Fri, 29 Aug 2014 22:16:20 +0000 (22:16 +0000)]
auto merge of #15773 : P1start/rust/style-lints, r=alexcrichton

This unifies the `non_snake_case_functions` and `uppercase_variables` lints into one lint, `non_snake_case`. It also now checks for non-snake-case modules. This also extends the non-camel-case types lint to check type parameters, and merges the `non_uppercase_pattern_statics` lint into the `non_uppercase_statics` lint.

Because the `uppercase_variables` lint is now part of the `non_snake_case` lint, all non-snake-case variables that start with lowercase characters (such as `fooBar`) will now trigger the `non_snake_case` lint.

New code should be updated to use the new `non_snake_case` lint instead of the previous `non_snake_case_functions` and `uppercase_variables` lints. All use of the `non_uppercase_pattern_statics` should be replaced with the `non_uppercase_statics` lint. Any code that previously contained non-snake-case module or variable names should be updated to use snake case names or disable the `non_snake_case` lint. Any code with non-camel-case type parameters should be changed to use camel case or disable the `non_camel_case_types` lint.

This also adds support for lint groups to the compiler. Lint groups are a way of grouping a number of lints together under one name. For example, this also defines a default lint for naming conventions, named `bad_style`. Writing `#[allow(bad_style)]` is equivalent to writing `#[allow(non_camel_case_types, non_snake_case, non_uppercase_statics)]`. These lint groups can also be defined as a compiler plugin using the new `Registry::register_lint_group` method.

This also adds two built-in lint groups, `bad_style` and `unused`. The contents of these groups can be seen by running `rustc -W help`.

[breaking-change]

9 years agoRegister new snapshots
Alex Crichton [Fri, 29 Aug 2014 21:33:08 +0000 (14:33 -0700)]
Register new snapshots

9 years agoAdd lint groups; define built-in lint groups `bad_style` and `unused`
P1start [Mon, 21 Jul 2014 03:27:59 +0000 (15:27 +1200)]
Add lint groups; define built-in lint groups `bad_style` and `unused`

This adds support for lint groups to the compiler. Lint groups are a way of
grouping a number of lints together under one name. For example, this also
defines a default lint for naming conventions, named `bad_style`. Writing
`#[allow(bad_style)]` is equivalent to writing
`#[allow(non_camel_case_types, non_snake_case, non_uppercase_statics)]`. These
lint groups can also be defined as a compiler plugin using the new
`Registry::register_lint_group` method.

This also adds two built-in lint groups, `bad_style` and `unused`. The contents
of these groups can be seen by running `rustc -W help`.

9 years agoUnify non-snake-case lints and non-uppercase statics lints
P1start [Fri, 18 Jul 2014 12:45:17 +0000 (00:45 +1200)]
Unify non-snake-case lints and non-uppercase statics lints

This unifies the `non_snake_case_functions` and `uppercase_variables` lints
into one lint, `non_snake_case`. It also now checks for non-snake-case modules.
This also extends the non-camel-case types lint to check type parameters, and
merges the `non_uppercase_pattern_statics` lint into the
`non_uppercase_statics` lint.

Because the `uppercase_variables` lint is now part of the `non_snake_case`
lint, all non-snake-case variables that start with lowercase characters (such
as `fooBar`) will now trigger the `non_snake_case` lint.

New code should be updated to use the new `non_snake_case` lint instead of the
previous `non_snake_case_functions` and `uppercase_variables` lints. All use of
the `non_uppercase_pattern_statics` should be replaced with the
`non_uppercase_statics` lint. Any code that previously contained non-snake-case
module or variable names should be updated to use snake case names or disable
the `non_snake_case` lint. Any code with non-camel-case type parameters should
be changed to use camel case or disable the `non_camel_case_types` lint.

[breaking-change]

9 years agoauto merge of #15955 : nikomatsakis/rust/issue-5527-new-inference-scheme, r=pcwalton
bors [Fri, 29 Aug 2014 19:21:12 +0000 (19:21 +0000)]
auto merge of #15955 : nikomatsakis/rust/issue-5527-new-inference-scheme, r=pcwalton

The inference scheme proposed in <http://smallcultfollowing.com/babysteps/blog/2014/07/09/an-experimental-new-type-inference-scheme-for-rust/>.

This is theoretically a [breaking-change]. It is possible that you may encounter type checking errors, particularly related to closures or functions with higher-ranked lifetimes or object types. Adding more explicit type annotations should help the problem. However, I have not been able to make an example that *actually* successfully compiles with the older scheme and fails with the newer scheme.

f? @pcwalton, @pnkfelix

9 years agoauto merge of #16767 : SiegeLord/rust/reexported_methods, r=cmr
bors [Fri, 29 Aug 2014 15:41:20 +0000 (15:41 +0000)]
auto merge of #16767 : SiegeLord/rust/reexported_methods, r=cmr

Previously, this caused methods of re-exported types to not be inserted into
the search index. This fix may introduce some false positives, but in my
testing they appear as orphaned methods and end up not being inserted into the
final search index at a later stage.

Fixes issue #11943

9 years agoFix spelling mistakes in the guide
Nick Howell [Fri, 29 Aug 2014 15:23:21 +0000 (11:23 -0400)]
Fix spelling mistakes in the guide

Also made some opinionated changes such as to prefer license over licence and judgment over judgement.

9 years agoLabel FIXMEs with a bug number
Niko Matsakis [Fri, 29 Aug 2014 11:46:43 +0000 (07:46 -0400)]
Label FIXMEs with a bug number

9 years agoIntroduce new inference scheme: variables are now instantiated with at most one type...
Niko Matsakis [Tue, 22 Jul 2014 11:46:36 +0000 (07:46 -0400)]
Introduce new inference scheme: variables are now instantiated with at most one type, and region variables are introduced as needed

9 years agoauto merge of #16838 : nick29581/rust/dst-bug-4, r=pnkfelix,nikomatsakis
bors [Fri, 29 Aug 2014 13:56:29 +0000 (13:56 +0000)]
auto merge of #16838 : nick29581/rust/dst-bug-4, r=pnkfelix,nikomatsakis

Don't double free embedded, unsized slices.

Merge/rebase error from DST. Thanks to @eddyb for finding.

Closes #16826 (I hope)

r?

9 years agodoc: Runnable examples logging.
Jonas Hietala [Fri, 29 Aug 2014 10:00:39 +0000 (12:00 +0200)]
doc: Runnable examples logging.

Also use //! Instead of /*! in liblog.

9 years agoUpdated mut_chunks doc comment to match argument name.
Zbigniew Siciarz [Fri, 29 Aug 2014 08:53:18 +0000 (10:53 +0200)]
Updated mut_chunks doc comment to match argument name.

9 years agoTweak error message for use of a keyword in ident position.
Jonas Hietala [Fri, 29 Aug 2014 07:18:05 +0000 (09:18 +0200)]
Tweak error message for use of a keyword in ident position.

Closes #15358

9 years agoauto merge of #16762 : huonw/rust/for-error-nice, r=alexcrichton
bors [Fri, 29 Aug 2014 08:21:26 +0000 (08:21 +0000)]
auto merge of #16762 : huonw/rust/for-error-nice, r=alexcrichton

- print the type of `x` in `for ... in x` in the "does not implement Iterator" message
- avoid printing that message if `x` has a type error

9 years agorustc: remove a trait that is unnecessary after pretty move.
Huon Wilson [Mon, 11 Aug 2014 11:12:23 +0000 (21:12 +1000)]
rustc: remove a trait that is unnecessary after pretty move.

The type in the `impl` is now in the module with the trait.

9 years agorustc: move pretty printing into its own module.
Huon Wilson [Mon, 11 Aug 2014 10:59:35 +0000 (20:59 +1000)]
rustc: move pretty printing into its own module.

There's a lot of it, and it's a fairly well-defined/separate chunk of
code, so it might as well be separate.

9 years agoDon't double free embedded, unsized slices
Nick Cameron [Fri, 29 Aug 2014 06:37:45 +0000 (18:37 +1200)]
Don't double free embedded, unsized slices

Thanks to @eddyb for finding the bug.

Closes #16826 (I hope)

9 years agoAvoid flow-on Iterator error for `for ... in [ty err] {}`.
Huon Wilson [Tue, 26 Aug 2014 12:45:00 +0000 (22:45 +1000)]
Avoid flow-on Iterator error for `for ... in [ty err] {}`.

This squashes the

> `for` loop expression has type `[type error]` which does not implement
> the `Iterator` trait

message that one received when writing `for ... in x` where was
previously found to have a type error.

Fixes #16042.

9 years agoMention type of `for` exprs that don't implement Iterator.
Huon Wilson [Tue, 26 Aug 2014 12:09:38 +0000 (22:09 +1000)]
Mention type of `for` exprs that don't implement Iterator.

This improves the error message by telling the user the exact type of
`x` if it doesn't implement `Iterator` in `for ... in x {}`.

Closes #16043.

9 years agoauto merge of #16770 : cburgdorf/rust/patch_overloaded_calls_hint, r=alexcrichton
bors [Fri, 29 Aug 2014 04:56:18 +0000 (04:56 +0000)]
auto merge of #16770 : cburgdorf/rust/patch_overloaded_calls_hint, r=alexcrichton

9 years agoauto merge of #16768 : nham/rust/libcollections_test_cleanup, r=alexcrichton
bors [Fri, 29 Aug 2014 02:26:28 +0000 (02:26 +0000)]
auto merge of #16768 : nham/rust/libcollections_test_cleanup, r=alexcrichton

unused imports.

This is mostly converting uses of `push_back`, `pop_back`, `shift` and `unshift` to `push`, `pop`, `remove` and `insert`.

9 years agoIntroduce snapshot_vec abstraction
Niko Matsakis [Tue, 22 Jul 2014 11:40:51 +0000 (07:40 -0400)]
Introduce snapshot_vec abstraction

9 years agodoc: Clarify slice failure conditions.
Michael Sproul [Fri, 29 Aug 2014 00:03:30 +0000 (10:03 +1000)]
doc: Clarify slice failure conditions.

9 years agoauto merge of #16664 : aturon/rust/stabilize-option-result, r=alexcrichton
bors [Thu, 28 Aug 2014 23:56:20 +0000 (23:56 +0000)]
auto merge of #16664 : aturon/rust/stabilize-option-result, r=alexcrichton

Per API meeting

  https://github.com/rust-lang/meeting-minutes/blob/master/Meeting-API-review-2014-08-13.md

# Changes to `core::option`

Most of the module is marked as stable or unstable; most of the unstable items are awaiting resolution of conventions issues.

However, a few methods have been deprecated, either due to lack of use or redundancy:

* `take_unwrap`, `get_ref` and `get_mut_ref` (redundant, and we prefer for this functionality to go through an explicit .unwrap)
* `filtered` and `while`
* `mutate` and `mutate_or_set`
* `collect`: this functionality is being moved to a new `FromIterator` impl.

# Changes to `core::result`

Most of the module is marked as stable or unstable; most of the unstable items are awaiting resolution of conventions issues.

* `collect`: this functionality is being moved to a new `FromIterator` impl.
* `fold_` is deprecated due to lack of use
* Several methods found in `core::option` are added here, including `iter`, `as_slice`, and variants.

Due to deprecations, this is a:

[breaking-change]

9 years agoauto merge of #16626 : ruud-v-a/rust/duration-reform, r=brson
bors [Thu, 28 Aug 2014 22:11:18 +0000 (22:11 +0000)]
auto merge of #16626 : ruud-v-a/rust/duration-reform, r=brson

This changes the internal representation of `Duration` from

    days: i32,
    secs: i32,
    nanos: u32

to

    secs: i64,
    nanos: i32

This resolves #16466. Note that `nanos` is an `i32` and not `u32` as suggested, because `i32` is easier to deal with, and it is not exposed anyway. Some methods now take `i64` instead of `i32` due to the increased range. Some methods, like `num_milliseconds`, now return an `Option<i64>` instead of `i64`, because the range of `Duration` is now larger than e.g. 2^63 milliseconds.

A few remarks:
- Negating `MIN` is impossible. I chose to return `MAX` as `-MIN`, but it is one nanosecond less than the actual negation. Is this the desired behaviour?
- In `std::io::timer`, some functions accept a `Duration`, which is internally converted into a number of milliseconds. However, the range of `Duration` is now larger than 2^64 milliseconds. There is already a FIXME in the file that this should be addressed (without a ticket number though). I chose to silently use 0 ms if the duration is too long. Is that right, as long as the backend still uses milliseconds?
- Negative durations are not formatted correctly, but they were not formatted correctly before either.

9 years agoFixed misleading docs in liballoc
Clark Gaebel [Thu, 28 Aug 2014 21:57:16 +0000 (14:57 -0700)]
Fixed misleading docs in liballoc

9 years agoFix guide typo.
Sebastian Zaha [Thu, 28 Aug 2014 21:14:09 +0000 (23:14 +0200)]
Fix guide typo.

9 years agoCargo begins version number at 0.0.1 instead of 0.1.0.
Sebastian Zaha [Thu, 28 Aug 2014 20:47:45 +0000 (22:47 +0200)]
Cargo begins version number at 0.0.1 instead of 0.1.0.

9 years agolibstd: Wrap duration.rs at 100 characters.
Ruud van Asseldonk [Thu, 28 Aug 2014 19:56:27 +0000 (21:56 +0200)]
libstd: Wrap duration.rs at 100 characters.

9 years agoRefactor and cleanup inference code: s/get_ref()/fields/, use try! macro rather than...
Niko Matsakis [Tue, 22 Jul 2014 11:15:43 +0000 (07:15 -0400)]
Refactor and cleanup inference code: s/get_ref()/fields/, use try! macro rather than if_ok!

9 years agoauto merge of #16553 : nick29581/rust/log, r=huon
bors [Thu, 28 Aug 2014 18:36:29 +0000 (18:36 +0000)]
auto merge of #16553 : nick29581/rust/log, r=huon

When specifying RUST_LOG, the programmer may append `/regex` to the end of the spec. All results will then be filtered using that regex.

r?

9 years agoFix issue #15826.
Joseph Crail [Tue, 26 Aug 2014 23:46:20 +0000 (19:46 -0400)]
Fix issue #15826.

The implemented fix rounds half-way cases away from zero as described in
the original comments.

This rounding algorithm is sometimes called arithmetic rounding. It is
described further here:
http://en.wikipedia.org/wiki/Rounding#Round_half_away_from_zero

I also added several new tests to prevent regressions.

9 years agoFix kindck to consider inherited bounds
Niko Matsakis [Tue, 22 Jul 2014 09:56:25 +0000 (05:56 -0400)]
Fix kindck to consider inherited bounds

9 years agoFix regionck to account for the uniqueness requirements on ref mut reborrows
Niko Matsakis [Tue, 22 Jul 2014 09:43:19 +0000 (05:43 -0400)]
Fix regionck to account for the uniqueness requirements on ref mut reborrows

9 years agoFix regionck to consider bounds on a proc when capturing variables
Niko Matsakis [Tue, 22 Jul 2014 09:27:46 +0000 (05:27 -0400)]
Fix regionck to consider bounds on a proc when capturing variables

9 years agostabilize core::result
Aaron Turon [Tue, 19 Aug 2014 20:45:28 +0000 (13:45 -0700)]
stabilize core::result

Per API meeting

  https://github.com/rust-lang/meeting-minutes/blob/master/Meeting-API-review-2014-08-13.md

Most of the module is marked as stable or unstable; most of the unstable
items are awaiting resolution of conventions issues.

* `collect`: this functionality is being moved to a new `FromIterator`
  impl.
* `fold_` is deprecated due to lack of use
* Several methods found in `core::option` are added here, including
  `iter`, `as_slice`, and variants.

Due to deprecations, this is a:

[breaking-change]

9 years agoFallout from stabilizing core::option
Aaron Turon [Tue, 19 Aug 2014 00:52:38 +0000 (17:52 -0700)]
Fallout from stabilizing core::option

9 years agostabilize core::option
Aaron Turon [Tue, 19 Aug 2014 00:42:11 +0000 (17:42 -0700)]
stabilize core::option

Per API meeting

  https://github.com/rust-lang/meeting-minutes/blob/master/Meeting-API-review-2014-08-13.md

Most of the module is marked as stable or unstable; most of the unstable
items are awaiting resolution of conventions issues.

However, a few methods have been deprecated, either due to lack of use
or redundancy:

* `take_unwrap`, `get_ref` and `get_mut_ref` (redundant, and we prefer
  for this functionality to go through an explicit .unwrap)
* `filtered` and `while`
* `mutate` and `mutate_or_set`
* `collect`: this functionality is being moved to a new `FromIterator`
  impl.

Due to deprecations, this is a:

[breaking-change]

9 years agoauto merge of #16453 : nikomatsakis/rust/type-bounds-3, r=pcwalton
bors [Thu, 28 Aug 2014 15:01:39 +0000 (15:01 +0000)]
auto merge of #16453 : nikomatsakis/rust/type-bounds-3, r=pcwalton

Implements https://github.com/rust-lang/rfcs/pull/192.

In particular:

1. type parameters can have lifetime bounds and objects can close over borrowed values, presuming that they have suitable bounds.
2. objects must have a bound, though it may be derived from the trait itself or from a `Send` bound.
3. all types must be well-formed.
4. type parameters and lifetime parameters may themselves have lifetimes as bounds. Something like `T:'a` means "the type T outlives 'a`" and something like `'a:'b`" means "'a outlives 'b". Outlives here means "all borrowed data has a lifetime at least as long".

This is a [breaking-change]. The most common things you have to fix after this change are:

1. Introduce lifetime bounds onto type parameters if your type (directly or indirectly) contains a reference. Thus a struct like `struct Ref<'a, T> { x: &'a T }` would be changed to `struct Ref<'a, T:'a> { x: &'a T }`.
2. Introduce lifetime bounds onto lifetime parameters if your type contains a double reference. Thus a type like `struct RefWrapper<'a, 'b> { r: &'a Ref<'b, int> }` (where `Ref` is defined as before) would need to be changed to `struct RefWrapper<'a, 'b:'a> { ... }`.
2. Explicitly give object lifetimes in structure definitions. Most commonly, this means changing something like `Box<Reader>` to `Box<Reader+'static>`, so as to indicate that this is a reader without any borrowed data. (Note: you may wish to just change to `Box<Reader+Send>` while you're at it; it's a more restrictive type, technically, but means you can send the reader between threads.)

The intuition for points 1 and 2 is that a reference must never outlive its referent (the thing it points at). Therefore, if you have a type `&'a T`, we must know that `T` (whatever it is) outlives `'a`. And so on.

Closes #5723.

9 years agoImplement generalized object and type parameter bounds (Fixes #16462)
Niko Matsakis [Thu, 28 Aug 2014 01:46:52 +0000 (21:46 -0400)]
Implement generalized object and type parameter bounds (Fixes #16462)

9 years agoAllow a regex filter for RUST_LOG
Nick Cameron [Wed, 13 Aug 2014 09:38:52 +0000 (10:38 +0100)]
Allow a regex filter for RUST_LOG

When specifying RUST_LOG, the programmer may append `/regex` to the end of the spec. All results will then be filtered using that regex.

9 years agoauto merge of #16757 : steveklabnik/rust/lets_not_lie_in_the_concurrency_guide, r...
bors [Wed, 27 Aug 2014 21:31:13 +0000 (21:31 +0000)]
auto merge of #16757 : steveklabnik/rust/lets_not_lie_in_the_concurrency_guide, r=alexcrichton

This cleans up blatant lies in the concurrency guide, and modernizes it
a bit. There's a lot more to do, but until I get to it, let's make it a
little bit better.

9 years agoFix lies in the concurrency guide.
Steve Klabnik [Tue, 26 Aug 2014 01:15:20 +0000 (21:15 -0400)]
Fix lies in the concurrency guide.

This cleans up blatant lies in the concurrency guide, and modernizes it
a bit. There's a lot more to do, but until I get to it, let's make it a
little bit better.

9 years agoauto merge of #16797 : nikomatsakis/rust/remove-invalid-spsc_queue-test, r=alexcrichton
bors [Wed, 27 Aug 2014 19:46:14 +0000 (19:46 +0000)]
auto merge of #16797 : nikomatsakis/rust/remove-invalid-spsc_queue-test, r=alexcrichton

This test seems to read freed memory -- the peeked variable points into the queue, but then the pop operation removes the node from the queue and moves the enclosing `T` elsewhere, invalidating the `peeked` pointer.

r? @alexcrichton

9 years agoRemove invalid test -- this test reads freed memory, from what I can tell
Niko Matsakis [Wed, 27 Aug 2014 18:53:23 +0000 (14:53 -0400)]
Remove invalid test -- this test reads freed memory, from what I can tell

9 years agoauto merge of #16766 : kevinmehall/rust/issue-15976, r=alexcrichton
bors [Wed, 27 Aug 2014 17:11:11 +0000 (17:11 +0000)]
auto merge of #16766 : kevinmehall/rust/issue-15976, r=alexcrichton

As of 8876ce44, `is_sugared_doc` is encoded in metadata, so there is no
need to assume that all `doc` attributes came from sugared comments.

Fixes #15976

9 years agoauto merge of #16761 : mrmonday/rust/patch-1, r=alexcrichton
bors [Wed, 27 Aug 2014 14:01:18 +0000 (14:01 +0000)]
auto merge of #16761 : mrmonday/rust/patch-1, r=alexcrichton

This question comes up relatively frequently on IRC - "what do tx and rx mean?". This change adds a short explanation.

9 years agodebuginfo: Improve GDB version handling in compiletest tool
Michael Woerister [Wed, 27 Aug 2014 13:18:16 +0000 (15:18 +0200)]
debuginfo: Improve GDB version handling in compiletest tool

9 years agodebuginfo: Emit different autotest debugger scripts depending on GDB version.
Michael Woerister [Wed, 20 Aug 2014 10:53:50 +0000 (12:53 +0200)]
debuginfo: Emit different autotest debugger scripts depending on GDB version.

9 years agodebuginfo: Add GDB pretty printers for structs and enums.
Michael Woerister [Wed, 30 Jul 2014 13:56:42 +0000 (15:56 +0200)]
debuginfo: Add GDB pretty printers for structs and enums.

9 years agodebuginfo: Allow to activate GDB pretty printers in autotests.
Michael Woerister [Thu, 24 Jul 2014 09:09:41 +0000 (11:09 +0200)]
debuginfo: Allow to activate GDB pretty printers in autotests.

9 years agoauto merge of #16752 : MatejLach/rust/more_cargorun, r=steveklabnik
bors [Wed, 27 Aug 2014 11:16:12 +0000 (11:16 +0000)]
auto merge of #16752 : MatejLach/rust/more_cargorun, r=steveklabnik

Use cargo run as much as possible...

9 years agoauto merge of #16751 : luqmana/rust/tr, r=alexcrichton
bors [Wed, 27 Aug 2014 09:31:14 +0000 (09:31 +0000)]
auto merge of #16751 : luqmana/rust/tr, r=alexcrichton

Fixes #15562.

9 years agoauto merge of #16724 : tshepang/rust/misleading, r=brson
bors [Wed, 27 Aug 2014 07:46:17 +0000 (07:46 +0000)]
auto merge of #16724 : tshepang/rust/misleading, r=brson

We have to specify the module and the function name in the example where
the module shares a crate with the executable as well, so remove the
redundant (and potentially confusing) mention.

9 years agoauto merge of #16689 : wickerwaka/rust/crate-as, r=pcwalton
bors [Wed, 27 Aug 2014 06:01:18 +0000 (06:01 +0000)]
auto merge of #16689 : wickerwaka/rust/crate-as, r=pcwalton

For review. Not sure about the link_attrs stuff. Will work on converting all the tests.

extern crate "foobar" as foo;
extern crate foobar as foo;

Implements remaining part of RFC #47.
Addresses issue #16461.

Removed link_attrs from rust.md, they don't appear to be supported by
the parser.

9 years agoFix sorting order. Change `sync` to `share`
mdinger [Wed, 27 Aug 2014 04:26:50 +0000 (00:26 -0400)]
Fix sorting order. Change `sync` to `share`

9 years agoauto merge of #16685 : alexcrichton/rust/remove-glob, r=brson
bors [Wed, 27 Aug 2014 02:31:20 +0000 (02:31 +0000)]
auto merge of #16685 : alexcrichton/rust/remove-glob, r=brson

This library has been moved out to a cargo package in rust-lang.

9 years agoAdd a simple test for rustdoc search index contents
SiegeLord [Wed, 27 Aug 2014 02:03:39 +0000 (22:03 -0400)]
Add a simple test for rustdoc search index contents

9 years agoglob: Deprecate the library in favor of cargo
Alex Crichton [Fri, 22 Aug 2014 22:26:23 +0000 (15:26 -0700)]
glob: Deprecate the library in favor of cargo

This library has been moved out to a cargo package in rust-lang.

9 years agoAdded a note for usage of abs with ::MIN.
Robert Gawdzik ☢ [Tue, 26 Aug 2014 06:56:22 +0000 (02:56 -0400)]
Added a note for usage of abs with ::MIN.

9 years agoauto merge of #16704 : flugsio/rust/fix-rustc-ice-lint-underscores-only, r=brson
bors [Wed, 27 Aug 2014 00:31:25 +0000 (00:31 +0000)]
auto merge of #16704 : flugsio/rust/fix-rustc-ice-lint-underscores-only, r=brson

Fix for type identifiers with only underscores (two or more), I assume they doesn't count as camel case.

```rust
type __ = int;

fn main() {
}
```

```
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'index out of bounds: the len is 0 but the index is 0', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/librustc/lib.rs:1

stack backtrace:
   1: 0xb603f5d0 - rt::backtrace::imp::write::ha55f265f6626471dmxr
   2: 0xb6042620 - failure::on_fail::h4d2c6d42b67e94803Sr
   3: 0xb640a180 - unwind::begin_unwind_inner::h484879fa7cc3611fZhe
   4: 0xb6409e50 - unwind::begin_unwind_fmt::hd14e5c64bc9006capfe
   5: 0xb6409df0 - rust_begin_unwind
   6: 0xb6454580 - failure::begin_unwind::h9ab1fc5753bd08f3YDk
   7: 0xb6458cb0 - failure::fail_bounds_check::h88167bad36865909aCk
   8: 0xb6f685d0 - lint::builtin::NonCamelCaseTypes.LintPass::check_item::check_case::he854eeffd105cb0f40E
   9: 0xb6f68050 - lint::builtin::NonCamelCaseTypes.LintPass::check_item::hc35b45d248e41cd43XE
  10: 0xb6f7b760 - lint::context::Context<'a>.Visitor<(*>::visit_item::closure.139262
  11: 0xb6f79510 - lint::context::Context<'a>::with_lint_attrs::hb9efe321fa321ce6spG
  12: 0xb6f81d30 - lint::context::Context<'a>.Visitor<(*>::visit_mod::he4593c831936b308ZMG
  13: 0xb6f8f2f0 - lint::context::check_crate::closure.139319
  14: 0xb6f79510 - lint::context::Context<'a>::with_lint_attrs::hb9efe321fa321ce6spG
  15: 0xb6efda70 - lint::context::check_crate::ha9e64328726b9579q1G
  16: 0xb6efda20 - driver::driver::phase_3_run_analysis_passes::closure.136263
  17: 0xb659d640 - util::common::time::h2837683151147173214
  18: 0xb6e7d130 - driver::driver::phase_3_run_analysis_passes::h7079eff53afc4de3Jfz
  19: 0xb6e783f0 - driver::driver::compile_input::h0ec84a550e24779cP1y
  20: 0xb6f26250 - driver::run_compiler::h7e7c01ecbfd0ad87JzC
  21: 0xb6f26150 - driver::main_args::closure.137215
  22: 0xb6f380d0 - task::TaskBuilder<S>::try_future::closure.138376
  23: 0xb6f37ec0 - task::TaskBuilder<S>::spawn_internal::closure.138353
  24: 0xb774bdd0 - task::spawn_opts::closure.8325
  25: 0xb6409c10 - unwind::try::try_fn::h91f00772748cf73eD8d
  26: 0xb6468ae0 - rust_try_inner
  27: 0xb6468aa0 - rust_try
  28: 0xb6407880 - unwind::try::h78a4fc0e85c326aef6d
  29: 0xb6407640 - task::Task::run::hb6f2d9484116e3d8xcd
  30: 0xb774bba0 - task::spawn_opts::closure.8271
  31: 0xb6409350 - thread::thread_start::h8c02fef9f651da5cjBd
  32: 0xb5ed3fc0 - start_thread
  33: 0xb62e8a32 - __clone
  34:        0x0 - <unknown>
```

9 years agoadd missing ! char to feature gate hint
Christoph Burgdorf [Tue, 26 Aug 2014 20:44:53 +0000 (22:44 +0200)]
add missing ! char to feature gate hint

9 years agolibcollections: In tests, remove some uses of deprecated methods and
nham [Tue, 26 Aug 2014 19:45:55 +0000 (15:45 -0400)]
libcollections: In tests, remove some uses of deprecated methods and
unused imports.

9 years agoAlways insert methods into the search index, even if we're currently in a private...
SiegeLord [Tue, 26 Aug 2014 18:41:25 +0000 (14:41 -0400)]
Always insert methods into the search index, even if we're currently in a private module.

Previously, this caused methods of re-exported types to not be inserted into
the search index. This fix may introduce some false positives, but in my
testing they appear as orphaned methods and end up not being inserted into the
final search index at a later stage.

Fixes issue #11943

9 years agoUse cargo run in more places
Matej Lach [Tue, 26 Aug 2014 18:40:11 +0000 (19:40 +0100)]
Use cargo run in more places

9 years agorustdoc: Don't assume that a doc attribute was sugared: Fixes #15976
Kevin Mehall [Tue, 26 Aug 2014 16:39:26 +0000 (09:39 -0700)]
rustdoc: Don't assume that a doc attribute was sugared: Fixes #15976

As of 8876ce44, `is_sugared_doc` is encoded in metadata, so there is no
need to assume that doc attributes came from sugared comments.

9 years agoauto merge of #16742 : vhbit/rust/ios-ffi-fix, r=alexcrichton
bors [Tue, 26 Aug 2014 15:56:08 +0000 (15:56 +0000)]
auto merge of #16742 : vhbit/rust/ios-ffi-fix, r=alexcrichton