]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoClean up HashMap examples
Pascal Hertleif [Sun, 3 May 2015 15:44:24 +0000 (17:44 +0200)]
Clean up HashMap examples

9 years agoAuto merge of #25064 - tshepang:brevity, r=alexcrichton
bors [Sun, 3 May 2015 07:08:13 +0000 (07:08 +0000)]
Auto merge of #25064 - tshepang:brevity, r=alexcrichton

9 years agodoc: make concat() and connect() examples brief
Tshepang Lekhonkhobe [Sun, 3 May 2015 03:27:36 +0000 (05:27 +0200)]
doc: make concat() and connect() examples brief

9 years agoAuto merge of #25058 - steveklabnik:gh25008, r=huonw
bors [Sat, 2 May 2015 20:47:32 +0000 (20:47 +0000)]
Auto merge of #25058 - steveklabnik:gh25008, r=huonw

Fixes #25008

9 years agoAuto merge of #25038 - bluss:fat-pointer-cast, r=luqmana
bors [Sat, 2 May 2015 17:44:11 +0000 (17:44 +0000)]
Auto merge of #25038 - bluss:fat-pointer-cast, r=luqmana

typeck: Make sure casts from other types to fat pointers are illegal

Fixes ICEs where non-fat pointers and scalars are cast to fat pointers,

Fixes #21397
Fixes #22955
Fixes #23237
Fixes #24100

9 years agoRevise @ in patterns section
Steve Klabnik [Sat, 2 May 2015 14:52:48 +0000 (10:52 -0400)]
Revise @ in patterns section

Fixes #25008

9 years agoAuto merge of #25054 - bguiz:patch-1, r=steveklabnik
bors [Sat, 2 May 2015 14:42:57 +0000 (14:42 +0000)]
Auto merge of #25054 - bguiz:patch-1, r=steveklabnik

- `0..2` iterates over `0,1`
- `0..3` iterates over `0,1,2`, which is what we want instead

9 years agoAuto merge of #25045 - XuefengWu:1398_remove_ndebug, r=huonw
bors [Sat, 2 May 2015 12:56:05 +0000 (12:56 +0000)]
Auto merge of #25045 - XuefengWu:1398_remove_ndebug, r=huonw

According to #1398 and pull https://github.com/rust-lang/cargo/pull/1444 , fix doc overridable using -C debug-assertions

9 years ago=BG= minor: ensure correct range bounds in concurreny examples in the rust book
Brendan Graetz [Sat, 2 May 2015 12:29:53 +0000 (22:29 +1000)]
=BG= minor: ensure correct range bounds in concurreny examples in the rust book

- `0..2` iterates over `0,1`
- `0..3` iterates over `0,1,2`, which is what we want instead

9 years agoAuto merge of #25027 - Manishearth:deriving_attr, r=huonw
bors [Sat, 2 May 2015 09:55:13 +0000 (09:55 +0000)]
Auto merge of #25027 - Manishearth:deriving_attr, r=huonw

Adds an `attrs` field to `FieldInfo` which lets one check the attributes on
a field whilst expanding.

This lets deriving plugins be more robust, for example providing the ability to
"ignore" a field for the purpose of deriving, or perhaps handle the field a
different way.

r? @huonw

9 years agoRename AstBuilder::expr_int -> AstBuilder::expr_isize
Manish Goregaokar [Fri, 1 May 2015 10:22:38 +0000 (15:52 +0530)]
Rename AstBuilder::expr_int -> AstBuilder::expr_isize

9 years agoAuto merge of #25040 - mrsweaters:patch-1, r=alexcrichton
bors [Sat, 2 May 2015 08:09:47 +0000 (08:09 +0000)]
Auto merge of #25040 - mrsweaters:patch-1, r=alexcrichton

Correct 'danging' to 'dangling'.

9 years agoAuto merge of #24980 - jooert:test-22468, r=pnkfelix
bors [Sat, 2 May 2015 06:22:41 +0000 (06:22 +0000)]
Auto merge of #24980 - jooert:test-22468, r=pnkfelix

Closes #22468.

9 years agoAuto merge of #25028 - bluss:drain-string, r=alexcrichton
bors [Sat, 2 May 2015 04:35:33 +0000 (04:35 +0000)]
Auto merge of #25028 - bluss:drain-string, r=alexcrichton

collections: Implement String::drain(range) according to RFC 574

`.drain(range)` is unstable and under feature(collections_drain).

This adds a safe way to remove any range of a String as efficiently as
possible.

As noted in the code, this drain iterator has none of the memory safety
issues of the vector version.

RFC tracking issue is #23055

9 years agoAuto merge of #25015 - alexcrichton:rwlock-check-ret, r=aturon
bors [Sat, 2 May 2015 02:48:53 +0000 (02:48 +0000)]
Auto merge of #25015 - alexcrichton:rwlock-check-ret, r=aturon

Apparently implementations are allowed to return EDEADLK instead of blocking
forever, in which case this can lead to unsafety in the `RwLock` primitive
exposed by the standard library. A debug-build of the standard library would
have caught this error (due to the debug assert), but we don't ship debug
builds right now.

This commit adds explicit checks for the EDEADLK error code and triggers a panic
to ensure the call does not succeed.

Closes #25012

9 years agofix doc:#1398 stop passing --cfg ndebug and uses -C debug-assertions
Xuefeng Wu [Sat, 2 May 2015 02:24:10 +0000 (10:24 +0800)]
fix doc:#1398 stop passing --cfg ndebug and uses -C debug-assertions

9 years agoAuto merge of #24792 - alexcrichton:issue-24748, r=alexcrichton
bors [Sat, 2 May 2015 01:03:43 +0000 (01:03 +0000)]
Auto merge of #24792 - alexcrichton:issue-24748, r=alexcrichton

Ensures that the same error type is propagated throughout. Unnecessary leakage
of the internals is prevented through the usage of stability attributes.

Closes #24748

9 years agoCorrect typo in introduction
Jordan Humphreys [Fri, 1 May 2015 23:54:57 +0000 (16:54 -0700)]
Correct typo in introduction

Correct 'danging' to 'dangling'.

9 years agostd: Don't use a wrapper for the float error type
Alex Crichton [Fri, 24 Apr 2015 22:58:27 +0000 (15:58 -0700)]
std: Don't use a wrapper for the float error type

Ensures that the same error type is propagated throughout. Unnecessary leakage
of the internals is prevented through the usage of stability attributes.

Closes #24748

9 years agotypeck: Make sure casts to or from fat pointers are illegal
Ulrik Sverdrup [Fri, 1 May 2015 19:45:12 +0000 (21:45 +0200)]
typeck: Make sure casts to or from fat pointers are illegal

Fixes ICEs where non-fat pointers and scalars are cast to fat pointers,

Fixes #21397
Fixes #22955
Fixes #23237
Fixes #24100

9 years agoAuto merge of #25006 - alexcrichton:unstable-indexing, r=aturon
bors [Fri, 1 May 2015 22:54:09 +0000 (22:54 +0000)]
Auto merge of #25006 - alexcrichton:unstable-indexing, r=aturon

These implementations were intended to be unstable, but currently the stability
attributes cannot handle a stable trait with an unstable `impl` block. This
commit also audits the rest of the standard library for explicitly-`#[unstable]`
impl blocks. No others were removed but some annotations were changed to
`#[stable]` as they're defacto stable anyway.

One particularly interesting `impl` marked `#[stable]` as part of this commit
is the `Add<&[T]>` impl for `Vec<T>`, which uses `push_all` and implicitly
clones all elements of the vector provided.

Closes #24791

[breaking-change]

9 years agoAuto merge of #24778 - nagisa:managed-removal, r=huonw
bors [Fri, 1 May 2015 19:17:45 +0000 (19:17 +0000)]
Auto merge of #24778 - nagisa:managed-removal, r=huonw

Leftovers from @-pointer times, I guess.

9 years agosyntax: Avoid reallocating or copying in CodeMap::new_filemap
Ulrik Sverdrup [Fri, 1 May 2015 15:08:39 +0000 (17:08 +0200)]
syntax: Avoid reallocating or copying in CodeMap::new_filemap

Avoid creating a new String when there is no BOM to strip, and
otherwises use .drain(..3) to strip the BOM using the same allocation.

9 years agocollections: Implement String::drain(range) according to RFC 574
Ulrik Sverdrup [Fri, 1 May 2015 13:34:25 +0000 (15:34 +0200)]
collections: Implement String::drain(range) according to RFC 574

`.drain(range)` is unstable and under feature(collections_drain).

This adds a safe way to remove any range of a String as efficiently as
possible.

As noted in the code, this drain iterator has none of the memory safety
issues of the vector version.

RFC tracking issue is #23055

9 years agostd: Remove index notation on slice iterators
Alex Crichton [Thu, 30 Apr 2015 22:24:39 +0000 (15:24 -0700)]
std: Remove index notation on slice iterators

These implementations were intended to be unstable, but currently the stability
attributes cannot handle a stable trait with an unstable `impl` block. This
commit also audits the rest of the standard library for explicitly-`#[unstable]`
impl blocks. No others were removed but some annotations were changed to
`#[stable]` as they're defacto stable anyway.

One particularly interesting `impl` marked `#[stable]` as part of this commit
is the `Add<&[T]>` impl for `Vec<T>`, which uses `push_all` and implicitly
clones all elements of the vector provided.

Closes #24791

9 years agoAuto merge of #24720 - critiqjo:stepby-sizehint, r=alexcrichton
bors [Fri, 1 May 2015 16:42:19 +0000 (16:42 +0000)]
Auto merge of #24720 - critiqjo:stepby-sizehint, r=alexcrichton

`Iterator::size_hint` can be easily implemented for `StepBy`.
#23708

9 years agoAuto merge of #25025 - Manishearth:rollup, r=Manishearth
bors [Fri, 1 May 2015 14:50:51 +0000 (14:50 +0000)]
Auto merge of #25025 - Manishearth:rollup, r=Manishearth

- Successful merges: #24979, #24980, #24981, #24982, #24983, #24987, #24988, #24991, #24992, #24994, #24998, #25002, #25010, #25014, #25020, #25021
- Failed merges:

9 years agoRollup merge of #25021 - frewsxcv:an-utf, r=steveklabnik
Manish Goregaokar [Fri, 1 May 2015 05:42:18 +0000 (11:12 +0530)]
Rollup merge of #25021 - frewsxcv:an-utf, r=steveklabnik

Even spelled out, one would say 'a Universal Character Set'

9 years agoRollup merge of #25020 - brson:current_dir, r=luqmana
Manish Goregaokar [Fri, 1 May 2015 05:42:17 +0000 (11:12 +0530)]
Rollup merge of #25020 - brson:current_dir, r=luqmana

9 years agoRollup merge of #25014 - frewsxcv:patch-20, r=alexcrichton
Manish Goregaokar [Fri, 1 May 2015 05:42:17 +0000 (11:12 +0530)]
Rollup merge of #25014 - frewsxcv:patch-20, r=alexcrichton

The variable doesn't need to be mutable.

9 years agoRollup merge of #25010 - huonw:inline-int-extremes, r=alexcrichton
Manish Goregaokar [Fri, 1 May 2015 05:42:17 +0000 (11:12 +0530)]
Rollup merge of #25010 - huonw:inline-int-extremes, r=alexcrichton

These compile down to `mov $CONSTANT, register; ret`, but the lack of
`#[inline]` meant they have a full `call ...` when used from external
crates.

9 years agoRollup merge of #25002 - steveklabnik:gh24767, r=alexcrichton
Manish Goregaokar [Fri, 1 May 2015 05:42:17 +0000 (11:12 +0530)]
Rollup merge of #25002 - steveklabnik:gh24767, r=alexcrichton

Fixes #24767

9 years agoRollup merge of #24998 - steveklabnik:fix_links, r=alexcrichton
Manish Goregaokar [Fri, 1 May 2015 05:42:17 +0000 (11:12 +0530)]
Rollup merge of #24998 - steveklabnik:fix_links, r=alexcrichton

r? @alexcrichton

9 years agoRollup merge of #24994 - steveklabnik:gh24977, r=alexcrichton
Manish Goregaokar [Fri, 1 May 2015 05:42:16 +0000 (11:12 +0530)]
Rollup merge of #24994 - steveklabnik:gh24977, r=alexcrichton

Fixes #24977

9 years agoRollup merge of #24992 - steveklabnik:gh24730, r=alexcrichton
Manish Goregaokar [Fri, 1 May 2015 05:42:16 +0000 (11:12 +0530)]
Rollup merge of #24992 - steveklabnik:gh24730, r=alexcrichton

Fixes #24730

r? @alexcrichton

9 years agoRollup merge of #24991 - steveklabnik:gh24852, r=alexcrichton
Manish Goregaokar [Fri, 1 May 2015 05:42:16 +0000 (11:12 +0530)]
Rollup merge of #24991 - steveklabnik:gh24852, r=alexcrichton

First, a link was broken.

Second, the wording was a bit unclear, so I fixed it up.

Fixes #24852

9 years agoRollup merge of #24988 - semarie:unused-pid_t, r=alexcrichton
Manish Goregaokar [Fri, 1 May 2015 05:42:16 +0000 (11:12 +0530)]
Rollup merge of #24988 - semarie:unused-pid_t, r=alexcrichton

- unbreak the build under openbsd
- while here, apply same modification to dragonfly, freebsd, ios (pid_t
  imported, but not used in raw.rs)

r? @alexcrichton
cc @wg @mneumann @vhbit

9 years agoRollup merge of #24983 - vhbit:ios-raw, r=sanxiyn
Manish Goregaokar [Fri, 1 May 2015 05:42:15 +0000 (11:12 +0530)]
Rollup merge of #24983 - vhbit:ios-raw, r=sanxiyn

9 years agoRollup merge of #24982 - poga:fix-incorrect-doc-formatting, r=steveklabnik
Manish Goregaokar [Fri, 1 May 2015 05:42:15 +0000 (11:12 +0530)]
Rollup merge of #24982 - poga:fix-incorrect-doc-formatting, r=steveklabnik

Fix incorrect link tag formatting in `doc/trpl/nightly-rust.md`. Notice the last word of the paragraph.

Before:
![before](https://cloud.githubusercontent.com/assets/8631/7413645/10754b7e-ef80-11e4-9bb1-15e87ce9308f.png)

After:
![after](https://cloud.githubusercontent.com/assets/8631/7413647/13b96202-ef80-11e4-990b-6ecf72925e7d.png)

9 years agoRollup merge of #24981 - carols10cents:remove-more-priv, r=alexcrichton
Manish Goregaokar [Fri, 1 May 2015 05:42:15 +0000 (11:12 +0530)]
Rollup merge of #24981 - carols10cents:remove-more-priv, r=alexcrichton

Hi! While researching stuff for the reference and the grammar, I came across a few mentions of using the `priv` keyword that was removed in 0.11.0 (#13547, #8122, rust-lang/rfcs#26, [RFC 0026](https://github.com/rust-lang/rfcs/blob/master/text/0026-remove-priv.md)).

One occurrence is a mention in the reference, a few are in comments, and a few are marking test functions. I left the test that makes sure you can't name an ident `priv` since it's still a reserved keyword. I did a little grepping around for `priv `, priv in backticks, `Private` etc and I think the remaining instances are fine, but if anyone knows anywhere in particular I should check for any other lingering mentions of `priv`, please let me know and I would be happy to! :fallen_leaf: :ocean:

9 years agoAdd test for custom deriving plugins which rely on field attributes
Manish Goregaokar [Fri, 1 May 2015 10:19:05 +0000 (15:49 +0530)]
Add test for custom deriving plugins which rely on field attributes

9 years agoiterator: Add `StepBy::size_hint` method
critiqjo [Thu, 30 Apr 2015 19:17:15 +0000 (00:47 +0530)]
iterator: Add `StepBy::size_hint` method

Fixes `Step::steps_between` implementations by integer types
to correctly handle `by != 1`.

9 years agoAuto merge of #24965 - arielb1:instant-reject, r=nikomatsakis
bors [Fri, 1 May 2015 08:33:08 +0000 (08:33 +0000)]
Auto merge of #24965 - arielb1:instant-reject, r=nikomatsakis

This uses a (per-trait) hash-table to separate impls from different TraitDefs, and makes coherence go so much quicker. I will post performance numbers tomorrow.

This is still WIP, as when there's an overlap error, impls can get printed in the wrong order, which causes a few issues. Should I pick the local impl with the smallest NodeId to print?

Could you take a look at this @nikomatsakis?

9 years agoRemove Managed
Simonas Kazlauskas [Fri, 24 Apr 2015 17:07:01 +0000 (20:07 +0300)]
Remove Managed

Leftovers from @-pointer times.

9 years agoAuto merge of #24793 - aturon:io-error-any, r=alexcrichton
bors [Fri, 1 May 2015 04:22:53 +0000 (04:22 +0000)]
Auto merge of #24793 - aturon:io-error-any, r=alexcrichton

This commit brings the `Error` trait in line with the [Error interoperation
RFC](https://github.com/rust-lang/rfcs/pull/201) by adding downcasting,
which has long been intended. This change means that for any `Error`
trait objects that are `'static`, you can downcast to concrete error
types.

To make this work, it is necessary for `Error` to inherit from
`Reflect` (which is currently used to mark concrete types as "permitted
for reflection, aka downcasting"). This is a breaking change: it means
that impls like

```rust
impl<T> Error for MyErrorType<T> { ... }
```

must change to

```rust
impl<T: Reflect> Error for MyErrorType<T> { ... }
```

This commit furthermore marks `Reflect` as stable, since we are already
essentially committed to it via `Any`. Note that in the future, if we
determine that the parametricity aspects of `Reflect` are not needed, we
can deprecate the trait and provide a blanket implementation for it
for *all* types (rather than by using OIBIT), which would allow all
mentions of `Reflect` to be dropped over time. So there is not a strong
commitment here.

[breaking-change]

r? @alexcrichton

9 years agoReplaces instanced of 'an UTF' with 'a UTF'
Corey Farwell [Fri, 1 May 2015 01:38:01 +0000 (21:38 -0400)]
Replaces instanced of 'an UTF' with 'a UTF'

Even spelled out, one would say 'a Universal Character Set'

9 years agoGive access to field attributes in ext::deriving
Manish Goregaokar [Fri, 1 May 2015 01:10:06 +0000 (06:40 +0530)]
Give access to field attributes in ext::deriving

9 years agoAdd downcasting to std::error::Error
Aaron Turon [Fri, 24 Apr 2015 21:34:57 +0000 (14:34 -0700)]
Add downcasting to std::error::Error

This commit brings the `Error` trait in line with the [Error interoperation
RFC](https://github.com/rust-lang/rfcs/pull/201) by adding downcasting,
which has long been intended. This change means that for any `Error`
trait objects that are `'static`, you can downcast to concrete error
types.

To make this work, it is necessary for `Error` to inherit from
`Reflect` (which is currently used to mark concrete types as "permitted
for reflection, aka downcasting"). This is a breaking change: it means
that impls like

```rust
impl<T> Error for MyErrorType<T> { ... }
```

must change to something like

```rust
impl<T: Reflect> Error for MyErrorType<T> { ... }
```

except that `Reflect` is currently unstable (and should remain so for
the time being). For now, code can instead bound by `Any`:

```rust
impl<T: Any> Error for MyErrorType<T> { ... }
```

which *is* stable and has `Reflect` as a super trait. The downside is
that this imposes a `'static` constraint, but that only
constrains *when* `Error` is implemented -- it does not actually
constrain the types that can implement `Error`.

[breaking-change]

9 years agodoc: current_dir returns a PathBuf, not a Path
Brian Anderson [Fri, 1 May 2015 01:14:41 +0000 (18:14 -0700)]
doc: current_dir returns a PathBuf, not a Path

9 years agoAuto merge of #24989 - alexcrichton:rustdoc-associated-constant, r=brson
bors [Thu, 30 Apr 2015 23:40:27 +0000 (23:40 +0000)]
Auto merge of #24989 - alexcrichton:rustdoc-associated-constant, r=brson

Associated constants were now showing up for traits and would panic if they were
found on an inherent impl. This commit unblocks the nighly builders.

9 years agostd: Always check for EDEADLK in rwlocks on unix
Alex Crichton [Thu, 30 Apr 2015 23:37:41 +0000 (16:37 -0700)]
std: Always check for EDEADLK in rwlocks on unix

Apparently implementations are allowed to return EDEADLK instead of blocking
forever, in which case this can lead to unsafety in the `RwLock` primitive
exposed by the standard library. A debug-build of the standard library would
have caught this error (due to the debug assert), but we don't ship debug
builds right now.

This commit adds explicit checks for the EDEADLK error code and triggers a panic
to ensure the call does not succeed.

Closes #25012

9 years agostd: Favor cfg! over #[cfg] in unix rwlocks
Alex Crichton [Thu, 30 Apr 2015 23:37:26 +0000 (16:37 -0700)]
std: Favor cfg! over #[cfg] in unix rwlocks

9 years agoRemove unnecessary 'mut' qualifier on doc-comment var
Corey Farwell [Thu, 30 Apr 2015 23:20:59 +0000 (19:20 -0400)]
Remove unnecessary 'mut' qualifier on doc-comment var

The variable doesn't need to be mutable.

9 years agoMark the {min,max}_value functions on integers #[inline].
Huon Wilson [Thu, 30 Apr 2015 22:56:13 +0000 (08:56 +1000)]
Mark the {min,max}_value functions on integers #[inline].

These compile down to `mov $CONSTANT, register; ret`, but the lack of
`#[inline]` meant they have a full `call ...` when used from external
crates.

9 years agoClarify intention wrt integers
Steve Klabnik [Thu, 30 Apr 2015 21:43:46 +0000 (17:43 -0400)]
Clarify intention wrt integers

Fixes #24767

9 years agoAuto merge of #24978 - jooert:test-24446, r=alexcrichton
bors [Thu, 30 Apr 2015 20:51:03 +0000 (20:51 +0000)]
Auto merge of #24978 - jooert:test-24446, r=alexcrichton

Closes #24446.

9 years agoFix broken links in the book.
Steve Klabnik [Thu, 30 Apr 2015 20:00:44 +0000 (16:00 -0400)]
Fix broken links in the book.

9 years agoDescribe (a,) vs (a) in docs
Steve Klabnik [Thu, 30 Apr 2015 17:55:03 +0000 (13:55 -0400)]
Describe (a,) vs (a) in docs

Fixes #24730

9 years agoAuto merge of #24975 - michaelsproul:enum-diagnostics, r=pnkfelix
bors [Thu, 30 Apr 2015 18:59:11 +0000 (18:59 +0000)]
Auto merge of #24975 - michaelsproul:enum-diagnostics, r=pnkfelix

Explanations for E0079, E0080, E0081, E0082, E0083 and E0084 as part of #24407.

All the errors concern the use of `#[repr(X)]` with enum types.

I also updated the short description for E0079 so that it takes sign into account.

9 years agoFix code sample, remove unstable code
Steve Klabnik [Thu, 30 Apr 2015 18:17:56 +0000 (14:17 -0400)]
Fix code sample, remove unstable code

Fixes #24977

9 years agoFix two issues with TRPL: unsized types
Steve Klabnik [Thu, 30 Apr 2015 17:41:26 +0000 (13:41 -0400)]
Fix two issues with TRPL: unsized types

First, a link was broken.

Second, the wording was a bit unclear, so I fixed it up.

Fixes #24852

9 years agoaddress review comments
Ariel Ben-Yehuda [Thu, 30 Apr 2015 17:35:10 +0000 (20:35 +0300)]
address review comments

9 years agoAuto merge of #24924 - carols10cents:grammar-improvements, r=pnkfelix
bors [Thu, 30 Apr 2015 17:07:14 +0000 (17:07 +0000)]
Auto merge of #24924 - carols10cents:grammar-improvements, r=pnkfelix

I'm interested in helping out with #16676 but more in the grammar than the reference-- here's my first chunk, more to come!! :tada:

I did pull a bit *out* of the reference, though, that was more relevant to the grammar but wasn't moved over as part of #24729.

I'm looking at, e.g. https://github.com/rust-lang/rust/blob/master/src/libsyntax/ast.rs, as the source of truth, please let me know if I should be checking against something else instead/in addition.

r? @steveklabnik

9 years agorustdoc: Fix rendering associated constants
Alex Crichton [Thu, 30 Apr 2015 16:37:13 +0000 (09:37 -0700)]
rustdoc: Fix rendering associated constants

Associated constants were now showing up for traits and would panic if they were
found on an inherent impl. This commit unblocks the nighly builders.

9 years agoremove denied unused import: pid_t in raw
Sébastien Marie [Thu, 30 Apr 2015 15:26:53 +0000 (17:26 +0200)]
remove denied unused import: pid_t in raw

- unbreak the build under openbsd
- while here, apply same modification to dragonfly, freebsd, ios (pid_t
  imported, but not used in raw.rs)

9 years agoAuto merge of #24902 - bombless:configure, r=pnkfelix
bors [Thu, 30 Apr 2015 15:16:24 +0000 (15:16 +0000)]
Auto merge of #24902 - bombless:configure, r=pnkfelix

Closes #24840

9 years agoFixed iOS build
Valerii Hiora [Thu, 30 Apr 2015 13:42:37 +0000 (16:42 +0300)]
Fixed iOS build

9 years agoMention --enable-optimize for --enable-debug
York Xiang [Tue, 28 Apr 2015 14:24:44 +0000 (22:24 +0800)]
Mention --enable-optimize for --enable-debug

9 years agoremove newline within link tag
Poga Po [Thu, 30 Apr 2015 13:28:49 +0000 (21:28 +0800)]
remove newline within link tag

9 years agoUse hash-tables in trait selection
Ariel Ben-Yehuda [Tue, 21 Apr 2015 16:00:12 +0000 (19:00 +0300)]
Use hash-tables in trait selection

Puts implementations in bins hashed by the fast-reject key, and
only looks up the relevant impls, reducing O(n^2)-ishness

Before: 688.92user 5.08system 8:56.70elapsed 129%CPU (0avgtext+0avgdata 1208164maxresident)k, LLVM 379.142s
After: 637.78user 5.11system 8:17.48elapsed 129%CPU (0avgtext+0avgdata 1201448maxresident)k LLVM 375.552s

Performance increase is +7%-ish

9 years agoStop using Rc in TraitRef and TraitDef
Ariel Ben-Yehuda [Tue, 21 Apr 2015 15:59:58 +0000 (18:59 +0300)]
Stop using Rc in TraitRef and TraitDef

The former stopped making sense when we started interning substs and made
TraitRef a 2-word copy type, and I'm moving the latter into an arena as
they live as long as the type context.

9 years agoAuto merge of #24892 - robinst:issue-24407-E0010, r=pnkfelix
bors [Thu, 30 Apr 2015 12:01:44 +0000 (12:01 +0000)]
Auto merge of #24892 - robinst:issue-24407-E0010, r=pnkfelix

Part of #24407.

9 years agoAdd regression test for #22468
Johannes Oertel [Thu, 30 Apr 2015 10:24:56 +0000 (12:24 +0200)]
Add regression test for #22468

Closes #22468.

9 years agoAdd long diagnostics for enum repr errors.
Michael Sproul [Thu, 30 Apr 2015 07:32:20 +0000 (17:32 +1000)]
Add long diagnostics for enum repr errors.

9 years agoAdd regression test for #24446
Johannes Oertel [Thu, 30 Apr 2015 09:59:53 +0000 (11:59 +0200)]
Add regression test for #24446

Closes #24446.

9 years agoAuto merge of #24842 - GBGamer:patch-3, r=steveklabnik
bors [Thu, 30 Apr 2015 10:13:05 +0000 (10:13 +0000)]
Auto merge of #24842 - GBGamer:patch-3, r=steveklabnik

They now use the currently working syntax.

Also, I added two examples.

9 years agoAuto merge of #24970 - Hech:master, r=steveklabnik
bors [Thu, 30 Apr 2015 07:12:25 +0000 (07:12 +0000)]
Auto merge of #24970 - Hech:master, r=steveklabnik

9 years agoAuto merge of #24960 - tynopex:patch-doc, r=alexcrichton
bors [Thu, 30 Apr 2015 04:44:47 +0000 (04:44 +0000)]
Auto merge of #24960 - tynopex:patch-doc, r=alexcrichton

- Removed misleading comments about now-defunct CreatePipe
- Actually use std::process::Child in it's example
- Minor cleanups

9 years agoRemove `priv` from tests that aren't testing deprecated `priv`
Carol Nichols [Thu, 30 Apr 2015 02:53:22 +0000 (22:53 -0400)]
Remove `priv` from tests that aren't testing deprecated `priv`

9 years agoRemove mention of 'priv'; visibility is either PUB or nothing
Carol Nichols [Thu, 30 Apr 2015 02:43:47 +0000 (22:43 -0400)]
Remove mention of 'priv'; visibility is either PUB or nothing

9 years agoRemove lingering mention of 'priv' in the reference
Carol Nichols [Thu, 30 Apr 2015 02:43:26 +0000 (22:43 -0400)]
Remove lingering mention of 'priv' in the reference

9 years agoAuto merge of #24884 - michaelsproul:extended-errors, r=nrc
bors [Thu, 30 Apr 2015 02:03:27 +0000 (02:03 +0000)]
Auto merge of #24884 - michaelsproul:extended-errors, r=nrc

I've been working on improving the diagnostic registration system so that it can:

* Check uniqueness of error codes *across the whole compiler*. The current method using `errorck.py` is prone to failure as it relies on simple text search - I found that it breaks when referencing an error's ident within a string (e.g. `"See also E0303"`).
* Provide JSON output of error metadata, to eventually facilitate HTML output, as well as tracking of which errors need descriptions. The current schema is:

```
<error code>: {
    "description": <long description>,
    "use_site": {
        "filename": <filename where error is used>,
        "line": <line in file where error is used>
    }
}
```

[Here's][metadata-dump] a pretty-printed sample dump for `librustc`.

One thing to note is that I had to move the diagnostics arrays out of the diagnostics modules. I really wanted to be able to capture error usage information, which only becomes available as a crate is compiled. Hence all invocations of `__build_diagnostics_array!` have been moved to the ends of their respective `lib.rs` files. I tried to avoid moving the array by making a plugin that expands to nothing but couldn't invoke it in item position and gave up on hackily generating a fake item. I also briefly considered using a lint, but it seemed like it would impossible to get access to the data stored in the thread-local storage.

The next step will be to generate a web page that lists each error with its rendered description and use site. Simple mapping and filtering of the metadata files also allows us to work out which error numbers are absent, which errors are unused and which need descriptions.

[metadata-dump]: https://gist.github.com/michaelsproul/3246846ff1bea71bd049

9 years agoAdd error explanation for E0010
Robin Stocker [Tue, 28 Apr 2015 09:44:43 +0000 (19:44 +1000)]
Add error explanation for E0010

9 years agodocs: link fix
Hech [Thu, 30 Apr 2015 00:30:46 +0000 (17:30 -0700)]
docs: link fix

9 years agoAuto merge of #24967 - alexcrichton:rollup, r=alexcrichton
bors [Thu, 30 Apr 2015 00:07:10 +0000 (00:07 +0000)]
Auto merge of #24967 - alexcrichton:rollup, r=alexcrichton

9 years agoTest fixes and rebase conflicts
Alex Crichton [Thu, 30 Apr 2015 00:05:20 +0000 (17:05 -0700)]
Test fixes and rebase conflicts

9 years agoAdd metadata output to the diagnostics system.
Michael Sproul [Tue, 28 Apr 2015 02:48:22 +0000 (12:48 +1000)]
Add metadata output to the diagnostics system.

Diagnostic errors are now checked for uniqueness across the compiler and
error metadata is written to JSON files.

9 years agorollup merge of #24921: tamird/bitflags-associated-const
Alex Crichton [Wed, 29 Apr 2015 22:49:07 +0000 (15:49 -0700)]
rollup merge of #24921: tamird/bitflags-associated-const

Conflicts:
src/librustc/lib.rs

9 years agorollup merge of #24873: alexcrichton/fix-windows-stdio
Alex Crichton [Wed, 29 Apr 2015 22:48:38 +0000 (15:48 -0700)]
rollup merge of #24873: alexcrichton/fix-windows-stdio

Conflicts:
src/libstd/sys/windows/fs2.rs

9 years agorollup merge of #24962: tamird/unignore-android-tests
Alex Crichton [Wed, 29 Apr 2015 22:45:58 +0000 (15:45 -0700)]
rollup merge of #24962: tamird/unignore-android-tests

r? @alexcrichton I've tested these locally, so they should all be good to go.

9 years agorollup merge of #24961: nham/net_docs_cleanup
Alex Crichton [Wed, 29 Apr 2015 22:45:57 +0000 (15:45 -0700)]
rollup merge of #24961: nham/net_docs_cleanup

Changes made include adding missing punctuation, adding missing words, and converting uses of "Gets" to "Returns" in libstd/net/addr.rs to make it more consistent with the other documentation.

Fixes #24925.

9 years agorollup merge of #24953: tamird/android-pie
Alex Crichton [Wed, 29 Apr 2015 22:45:56 +0000 (15:45 -0700)]
rollup merge of #24953: tamird/android-pie

This is OK to do given:
  - PIE is supported on Android starting with API 16.
  - The bots are running API 18.
  - API < 16 now has a 12.5% market share[0] as of 2015-04-29.

Closes #17437.

[0] https://developer.android.com/about/dashboards/index.html

r? @alexcrichton

9 years agorollup merge of #24952: pnkfelix/put-back-missing-dash-g-in-24687-test
Alex Crichton [Wed, 29 Apr 2015 22:45:55 +0000 (15:45 -0700)]
rollup merge of #24952: pnkfelix/put-back-missing-dash-g-in-24687-test

Add `-g` (to testcase) that I should have included in PR #24932.

Note it is safe, with respect to autobuilds, to land before #24945.

(In other words, landing this sooner won't break things for anyone any
worse than they were already broken, since there are *other* tests
that also add `-g` to their flags via `compile-flags: -g`.)

9 years agorollup merge of #24945: pnkfelix/fixes-for-dash-g-handling
Alex Crichton [Wed, 29 Apr 2015 22:45:54 +0000 (15:45 -0700)]
rollup merge of #24945: pnkfelix/fixes-for-dash-g-handling

Fixes for -g handling

First:
 * decouples our handling of `-g` for the test suite from our handling of `-g` for the rest of the compiler/stdlib building.
 * Namely, if you do `--enable-debug` or `--enable-debuginfo`, that should only affect `rustc` and the standard library crates; the tests should all continue to compile without `-g` unless:
   * you pass `--enable-debuginfo-tests`, or
   * the test itself requests the `-g` option (e.g. via a `// compile-flags: -g` embedded comment).

Second:
 * Makes `rustc` more flexible in that it now accepts multiple occurrences of `-g -g`
 * (as a drive-by, I gave `-O` the same treatment: multiple occurrences of `-O` are treated as synonymous as a single occurrence of `-O`.

Fix #24937

9 years agorollup merge of #24935: pnkfelix/lint-repr-c-drop
Alex Crichton [Wed, 29 Apr 2015 22:45:53 +0000 (15:45 -0700)]
rollup merge of #24935: pnkfelix/lint-repr-c-drop

Lint: warn when mixing `#[repr(C)]` with Drop

Fix #24585

9 years agorollup merge of #24933: oli-obk/patch-1
Alex Crichton [Wed, 29 Apr 2015 22:45:52 +0000 (15:45 -0700)]
rollup merge of #24933: oli-obk/patch-1

compiler plugins are hosted unter "compiler-plugins.html" not "plugins.html"

9 years agorollup merge of #24931: jooert/patch-1
Alex Crichton [Wed, 29 Apr 2015 22:45:51 +0000 (15:45 -0700)]
rollup merge of #24931: jooert/patch-1

Since #24783, the style guidelines recommend that unit tests should live in a submodule `tests` rather than `test` to not clash with the possible use of libtest. This is especially important for benchmark tests as they require libtest. Fixes #24923.

9 years agorollup merge of #24930: nrc/save-fn
Alex Crichton [Wed, 29 Apr 2015 22:45:50 +0000 (15:45 -0700)]
rollup merge of #24930: nrc/save-fn

9 years agorollup merge of #24929: tamird/unstub-some-tests
Alex Crichton [Wed, 29 Apr 2015 22:45:49 +0000 (15:45 -0700)]
rollup merge of #24929: tamird/unstub-some-tests

r? @alexcrichton

9 years agorollup merge of #24926: frewsxcv/patch-20
Alex Crichton [Wed, 29 Apr 2015 22:45:49 +0000 (15:45 -0700)]
rollup merge of #24926: frewsxcv/patch-20