]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoREADME: Add instructions for building on windows.
Luqman Aden [Fri, 27 Jun 2014 00:07:44 +0000 (20:07 -0400)]
README: Add instructions for building on windows.

10 years agoauto merge of #14885 : pcwalton/rust/struct-literal-tightening, r=alexcrichton
bors [Tue, 24 Jun 2014 00:36:54 +0000 (00:36 +0000)]
auto merge of #14885 : pcwalton/rust/struct-literal-tightening, r=alexcrichton

`for...in`.

Closes #14803.

If you used a structure literal after one of these keywords, surround it
in parentheses.

[breaking-change]

r? @nick29581

10 years agolibsyntax: Disallow struct literals after `if`, `while`, `match`, and
Patrick Walton [Sat, 14 Jun 2014 02:09:12 +0000 (19:09 -0700)]
libsyntax: Disallow struct literals after `if`, `while`, `match`, and
`for...in`.

Closes #14803.

If you used a structure literal after one of these keywords, surround it
in parentheses.

[breaking-change]

10 years agoauto merge of #14974 : Ryman/rust/non_trait_method, r=alexcrichton
bors [Mon, 23 Jun 2014 21:46:46 +0000 (21:46 +0000)]
auto merge of #14974 : Ryman/rust/non_trait_method, r=alexcrichton

Closes #3973.

10 years agorustc: catch `impl X for Y` where X is not a trait in resolve.
Kevin Butler [Thu, 19 Jun 2014 22:23:51 +0000 (23:23 +0100)]
rustc: catch `impl X for Y` where X is not a trait in resolve.

10 years agorustc: catch non-trait methods before typeck.
Kevin Butler [Wed, 18 Jun 2014 13:16:45 +0000 (14:16 +0100)]
rustc: catch non-trait methods before typeck.

Closes #3973.

10 years agoauto merge of #15106 : Sawyer47/rust/rm-duplicated-tests, r=alexcrichton
bors [Mon, 23 Jun 2014 16:16:37 +0000 (16:16 +0000)]
auto merge of #15106 : Sawyer47/rust/rm-duplicated-tests, r=alexcrichton

Even if they used to test different things in the past, they are
now identical to other files.

Closes #11496

10 years agoauto merge of #15100 : rapha/rust/master, r=alexcrichton
bors [Mon, 23 Jun 2014 14:31:39 +0000 (14:31 +0000)]
auto merge of #15100 : rapha/rust/master, r=alexcrichton

/usr/bin/env appears to be more portable.

10 years agoauto merge of #15098 : ben0x539/rust/nullary-tuple-struct, r=pcwalton
bors [Mon, 23 Jun 2014 12:46:33 +0000 (12:46 +0000)]
auto merge of #15098 : ben0x539/rust/nullary-tuple-struct, r=pcwalton

Reject `struct Foo();` to fix #15095.

10 years agoauto merge of #15089 : tomjakubowski/rust/rustdoc-default-typarams-12291, r=alexcrichton
bors [Mon, 23 Jun 2014 11:01:36 +0000 (11:01 +0000)]
auto merge of #15089 : tomjakubowski/rust/rustdoc-default-typarams-12291, r=alexcrichton

fix #12291

10 years agoauto merge of #15086 : jakub-/rust/xc-struct-variants-match, r=alexcrichton
bors [Mon, 23 Jun 2014 09:16:36 +0000 (09:16 +0000)]
auto merge of #15086 : jakub-/rust/xc-struct-variants-match, r=alexcrichton

Turns out field names of struct variants are not encoded in crate metadata.

10 years agoauto merge of #15083 : edwardw/rust/destructure-trait-ref, r=pcwalton
bors [Mon, 23 Jun 2014 07:26:37 +0000 (07:26 +0000)]
auto merge of #15083 : edwardw/rust/destructure-trait-ref, r=pcwalton

Closes #15031.

10 years agoauto merge of #15061 : pnkfelix/rust/fsk-fix-issue-10846, r=nikomatsakis
bors [Mon, 23 Jun 2014 04:31:35 +0000 (04:31 +0000)]
auto merge of #15061 : pnkfelix/rust/fsk-fix-issue-10846, r=nikomatsakis

In other words, Late-bound regions that occur non-free should be
skipped.

Fix #10846 (specifically the ICE, not the weakness in the current type inference).

10 years agoauto merge of #15097 : tomjakubowski/rust/fix-feature-gate-docs, r=sfackler
bors [Mon, 23 Jun 2014 02:21:37 +0000 (02:21 +0000)]
auto merge of #15097 : tomjakubowski/rust/fix-feature-gate-docs, r=sfackler

See http://static.rust-lang.org/doc/master/rustc/front/feature_gate/index.html for the problem this fixes.

10 years agoauto merge of #15068 : erickt/rust/mem-inline, r=pcwalton
bors [Mon, 23 Jun 2014 00:11:39 +0000 (00:11 +0000)]
auto merge of #15068 : erickt/rust/mem-inline, r=pcwalton

This is a couple micro-optimizations I've been sitting on for a while. This inlines a couple functions that are important to the `std::io::mem`. Ultimately, this results in about a 15% performance increase in some micro-benchmarks for my [libserialize](https://github.com/erickt/rust-serde) rewrite.

10 years agoChange /bin/env to /usr/bin/env in helper python script, as it is more portable
Raphael Speyer [Sun, 22 Jun 2014 23:17:40 +0000 (09:17 +1000)]
Change /bin/env to /usr/bin/env in helper python script, as it is more portable

10 years agoauto merge of #15081 : jakub-/rust/issue-15080, r=alexcrichton
bors [Sun, 22 Jun 2014 21:31:39 +0000 (21:31 +0000)]
auto merge of #15081 : jakub-/rust/issue-15080, r=alexcrichton

Fixes #15080.

10 years agoauto merge of #15091 : nikomatsakis/rust/issue-5527-rename-types, r=pcwalton
bors [Sun, 22 Jun 2014 18:41:41 +0000 (18:41 +0000)]
auto merge of #15091 : nikomatsakis/rust/issue-5527-rename-types, r=pcwalton

Some cleanups I'm sick of rebasing.

r? @pcwalton (do you agree with new names?)

10 years agolibsyntax: don't allow enum structs with no fields
Benjamin Herr [Sun, 22 Jun 2014 17:53:56 +0000 (19:53 +0200)]
libsyntax: don't allow enum structs with no fields

Unit-like structs are written as `struct Foo;`, but we erroneously
accepted `struct Foo();` and took it to mean the same thing. Now we
don't, so use the `struct Foo;` form!

[breaking-change]

10 years agolibrustc: Fix poorly formatted doc in feature_gate
Tom Jakubowski [Sun, 22 Jun 2014 17:29:42 +0000 (10:29 -0700)]
librustc: Fix poorly formatted doc in feature_gate

The #![feature(...)] line had been rendering in the docs as a header
because of Markdown syntax.

10 years agoauto merge of #15088 : Sawyer47/rust/detotal, r=alexcrichton
bors [Sun, 22 Jun 2014 15:16:39 +0000 (15:16 +0000)]
auto merge of #15088 : Sawyer47/rust/detotal, r=alexcrichton

There were still Total{Ord,Eq} in docs and src/etc

10 years agoRename ty_param_bounds_and_ty to Polytype
Niko Matsakis [Tue, 6 May 2014 19:59:45 +0000 (15:59 -0400)]
Rename ty_param_bounds_and_ty to Polytype

10 years agoRename and move ty_param_substs_and_ty
Niko Matsakis [Tue, 6 May 2014 13:52:04 +0000 (09:52 -0400)]
Rename and move ty_param_substs_and_ty

10 years agoRemove duplicated test files
Piotr Jawniak [Sun, 22 Jun 2014 13:55:27 +0000 (15:55 +0200)]
Remove duplicated test files

Even if they used to test different things in the past, they are
now identical to other files.

Closes #11496

10 years agoUpdate few files after comparison traits renaming
Piotr Jawniak [Sun, 22 Jun 2014 07:31:39 +0000 (09:31 +0200)]
Update few files after comparison traits renaming

There were still Total{Ord,Eq} in docs and src/etc

10 years agoRegionFolder should only invoke callback on free regions.
Felix S. Klock II [Fri, 20 Jun 2014 20:26:14 +0000 (22:26 +0200)]
RegionFolder should only invoke callback on free regions.

In other words, Late-bound regions that occur non-free should be
skipped.

Fix #10846.

10 years agoauto merge of #15005 : dotdash/rust/i1_bool, r=alexcrichton
bors [Sun, 22 Jun 2014 00:01:34 +0000 (00:01 +0000)]
auto merge of #15005 : dotdash/rust/i1_bool, r=alexcrichton

We currently compiled bools to i8 values, because there was a bug in
LLVM that sometimes caused miscompilations when using i1 in, for
example, structs.

Using i8 means a lot of unnecessary zero-extend and truncate operations
though, since we have to convert the value from and to i1 when using for
example icmp or br instructions. Besides the unnecessary overhead caused
by this, it also sometimes made LLVM miss some optimizations.

First, we have to fix some bugs concerning the handling of
attributes in foreign function declarations and calls. These
are required because the i1 type needs the ZExt attribute when
used as a function parameter or return type.

Then we have to update LLVM to get a bugfix without which LLVM
sometimes generates broken code when using i1.

And then, finally, we can switch bools over to i1.

10 years agoFix spurious non-exhaustive errors for cross-crate struct variants
Jakub Wieczorek [Sat, 21 Jun 2014 21:16:31 +0000 (23:16 +0200)]
Fix spurious non-exhaustive errors for cross-crate struct variants

10 years agocollections: fix running `make check-stage1-collections`
Erick Tryzelaar [Sat, 21 Jun 2014 03:08:17 +0000 (23:08 -0400)]
collections: fix running `make check-stage1-collections`

10 years agostd: inline many of the Writer/Reader methods
Erick Tryzelaar [Sat, 21 Jun 2014 03:05:42 +0000 (23:05 -0400)]
std: inline many of the Writer/Reader methods

This allows llvm to optimize away much of the overhead from using
the MemReader/MemWriters. My benchmarks showed it to shave 15% off
of my in progress serialization/json encoding.

10 years agoserialize: Simplify the json docs
Erick Tryzelaar [Thu, 12 Jun 2014 03:35:57 +0000 (20:35 -0700)]
serialize: Simplify the json docs

10 years agostd: micro-optimize Vec constructors and add benchmarks
Erick Tryzelaar [Tue, 3 Jun 2014 04:56:29 +0000 (21:56 -0700)]
std: micro-optimize Vec constructors and add benchmarks

Generally speaking, inlining doesn't really help out with
constructing vectors, except for when we construct a zero-sized
vector. This patch allows llvm to optimize this case away in
a lot of cases, which shaves off 4-8ns. It's not much, but it
might help in some inner loop somewhere.

before:

running 12 tests
test bench_extend_0          ... bench:       123 ns/iter (+/- 6)
test bench_extend_5          ... bench:       323 ns/iter (+/- 11)
test bench_from_fn_0         ... bench:         7 ns/iter (+/- 0)
test bench_from_fn_5         ... bench:        49 ns/iter (+/- 6)
test bench_from_iter_0       ... bench:        11 ns/iter (+/- 0)
test bench_from_iter_5       ... bench:       176 ns/iter (+/- 11)
test bench_from_slice_0      ... bench:         8 ns/iter (+/- 1)
test bench_from_slice_5      ... bench:        73 ns/iter (+/- 5)
test bench_new               ... bench:         0 ns/iter (+/- 0)
test bench_with_capacity_0   ... bench:         6 ns/iter (+/- 1)
test bench_with_capacity_100 ... bench:        41 ns/iter (+/- 3)
test bench_with_capacity_5   ... bench:        40 ns/iter (+/- 2)

after:

test bench_extend_0          ... bench:       123 ns/iter (+/- 7)
test bench_extend_5          ... bench:       339 ns/iter (+/- 27)
test bench_from_fn_0         ... bench:         7 ns/iter (+/- 0)
test bench_from_fn_5         ... bench:        54 ns/iter (+/- 4)
test bench_from_iter_0       ... bench:        11 ns/iter (+/- 1)
test bench_from_iter_5       ... bench:       182 ns/iter (+/- 16)
test bench_from_slice_0      ... bench:         4 ns/iter (+/- 0)
test bench_from_slice_5      ... bench:        62 ns/iter (+/- 3)
test bench_new               ... bench:         0 ns/iter (+/- 0)
test bench_with_capacity_0   ... bench:         0 ns/iter (+/- 0)
test bench_with_capacity_100 ... bench:        41 ns/iter (+/- 1)
test bench_with_capacity_5   ... bench:        41 ns/iter (+/- 3)

10 years agoMake destructuring trait reference work
Edward Wang [Sat, 21 Jun 2014 20:03:15 +0000 (04:03 +0800)]
Make destructuring trait reference work

Closes #15031.

10 years agoFix a #14731 regression in missing_constructor() for vector patterns
Jakub Wieczorek [Sat, 21 Jun 2014 12:52:23 +0000 (14:52 +0200)]
Fix a #14731 regression in missing_constructor() for vector patterns

Fixes #15080.

10 years agoCompile bools to i1
Björn Steinbrink [Sun, 16 Mar 2014 08:29:05 +0000 (09:29 +0100)]
Compile bools to i1

We currently compiled bools to i8 values, because there was a bug in
LLVM that sometimes caused miscompilations when using i1 in, for
example, structs.

Using i8 means a lot of unnecessary zero-extend and truncate operations
though, since we have to convert the value from and to i1 when using for
example icmp or br instructions. Besides the unnecessary overhead caused
by this, it also sometimes made LLVM miss some optimizations.

Fixes #8106.

10 years agoUpdate LLVM
Björn Steinbrink [Tue, 17 Jun 2014 16:34:50 +0000 (18:34 +0200)]
Update LLVM

To fix #8106, we need an LLVM version that contains r211082 aka 0dee6756
which fixes a bug that blocks that issue.

There have been some tiny API changes in LLVM, and cmpxchg changed its
return type. The i1 part of the new return type is only interesting when
using the new weak cmpxchg, which we don't do.

10 years agoAdd missing attributes to indirect calls for foreign functions
Björn Steinbrink [Tue, 17 Jun 2014 19:51:24 +0000 (21:51 +0200)]
Add missing attributes to indirect calls for foreign functions

When calling a foreign function, some arguments and/or return value
attributes are required to conform to the foreign ABI. Currently those
attributes are only added to the declaration of foreign functions. With
direct calls, this is no problem, because LLVM can see that those
attributes apply to the call. But with an indirect call, LLVM cannot do
that and the attribute is missing.

To fix that, we have to add those attribute to the calls to foreign
functions as well.

This also allows to remove the special handling of the SRet attribute,
which is ABI-dependent and will be set via the `attr` field of the
return type's `ArgType`.

10 years agoCorrectly set return type attributes on foreign function declarations
Björn Steinbrink [Wed, 18 Jun 2014 11:01:23 +0000 (13:01 +0200)]
Correctly set return type attributes on foreign function declarations

The ArgType type gives us a generic way to specify an attribute for a
type to ensure ABI conformance for foreign functions. But the code that
actually sets the argument attributes in the function declaration
only sets the attribute for the return type when the type is indirect.

Since LLVMAddAttribute() doesn't allow to set attributes on the return
type, we have to use LLVMAddFunctionAttribute() instead.

This didn't cause problems yet, because currently only some indirect
types require attributes to be set.

10 years agoauto merge of #15074 : conradkleinespel/rust/master, r=pcwalton
bors [Sat, 21 Jun 2014 17:31:32 +0000 (17:31 +0000)]
auto merge of #15074 : conradkleinespel/rust/master, r=pcwalton

Using something like:

```rust
box "string"
```

yields
```shell
"`~\"string\"` has been removed; use `\"string\".to_string()` instead"
```

Should the error message maybe say `box "string"` instead?

10 years agoauto merge of #15062 : pcwalton/rust/trailing-plus, r=brson
bors [Sat, 21 Jun 2014 15:36:39 +0000 (15:36 +0000)]
auto merge of #15062 : pcwalton/rust/trailing-plus, r=brson

This will break code that looks like `Box<Trait+>`. Change that code to
`Box<Trait>` instead.

Closes #14925.

[breaking-change]

r? @brson

10 years agorustdoc: show default type parameters in generics
Tom Jakubowski [Sat, 21 Jun 2014 12:03:33 +0000 (05:03 -0700)]
rustdoc: show default type parameters in generics

fix #12291

10 years agoreplace reference to ~"string" with box "string"
Conrad Kleinespel [Sat, 21 Jun 2014 10:31:10 +0000 (12:31 +0200)]
replace reference to ~"string" with box "string"

10 years agoauto merge of #15029 : aturon/rust/stability-index, r=brson
bors [Sat, 21 Jun 2014 04:01:25 +0000 (04:01 +0000)]
auto merge of #15029 : aturon/rust/stability-index, r=brson

This commit makes several changes to the stability index infrastructure:

* Stability levels are now inherited lexically, i.e., each item's
  stability level becomes the default for any nested items.

* The computed stability level for an item is stored as part of the
  metadata. When using an item from an external crate, this data is
  looked up and cached.

* The stability lint works from the computed stability level, rather
  than manual stability attribute annotations. However, the lint still
  checks only a limited set of item uses (e.g., it does not check every
  component of a path on import). This will be addressed in a later PR,
  as part of issue #8962.

* The stability lint only applies to items originating from external
  crates, since the stability index is intended as a promise to
  downstream crates.

* The "experimental" lint is now _allow_ by default. This is because
  almost all existing crates have been marked "experimental", pending
  library stabilization. With inheritance in place, this would generate
  a massive explosion of warnings for every Rust program.

  The lint should be changed back to deny-by-default after library
  stabilization is complete.

* The "deprecated" lint still warns by default.

The net result: we can begin tracking stability index for the standard
libraries as we stabilize, without impacting most clients.

Closes #13540.

10 years agoauto merge of #14731 : jakub-/rust/pattern-matching-refactor, r=alexcrichton
bors [Sat, 21 Jun 2014 02:11:22 +0000 (02:11 +0000)]
auto merge of #14731 : jakub-/rust/pattern-matching-refactor, r=alexcrichton

This PR is changing the error messages for non-exhaustive pattern matching to include a more accurate witness, i.e. a pattern that is not covered by any of the ones provided by the user. Example:

```rust
fn main() {
match (true, (Some("foo"), [true, true]), Some(42u)) {
(false, _, _) => (),
(true, (None, [true, _]), None) => (),
(true, (None, [false, _]), Some(1u)) => ()
}
}
```

```sh
/tmp/witness.rs:2:2: 6:3 error: non-exhaustive patterns: (true, (core::option::Some(_), _), _) not covered
/tmp/witness.rs:2  match (true, (Some("foo"), [true, true]), Some(42u)) {
/tmp/witness.rs:3  (false, _, _) => (),
/tmp/witness.rs:4  (true, (None, [true, _]), None) => (),
/tmp/witness.rs:5  (true, (None, [false, _]), Some(1u)) => ()
/tmp/witness.rs:6  }
```

As part of that, I refactored some of the relevant code and carried over the changes to fixed vectors from the previous PR.

I'm putting it out there for now but the tests will be red.

10 years agolibsyntax: Stop parsing `+` with no bounds after it.
Patrick Walton [Fri, 20 Jun 2014 17:49:54 +0000 (10:49 -0700)]
libsyntax: Stop parsing `+` with no bounds after it.

This will break code that looks like `Box<Trait+>`. Change that code to
`Box<Trait>` instead.

Closes #14925.

[breaking-change]

10 years agoauto merge of #14988 : pcwalton/rust/unsafe-destructor-feature-gate, r=alexcrichton
bors [Fri, 20 Jun 2014 21:31:22 +0000 (21:31 +0000)]
auto merge of #14988 : pcwalton/rust/unsafe-destructor-feature-gate, r=alexcrichton

Closes #8142.

This is not the semantics we want long-term. You can continue to use
`#[unsafe_destructor]`, but you'll need to add
`#![feature(unsafe_destructor)]` to the crate attributes.

[breaking-change]

r? @alexcrichton

10 years agolibrustc: Put `#[unsafe_destructor]` behind a feature gate.
Patrick Walton [Tue, 17 Jun 2014 23:00:04 +0000 (16:00 -0700)]
librustc: Put `#[unsafe_destructor]` behind a feature gate.

Closes #8142.

This is not the semantics we want long-term. You can continue to use
`#[unsafe_destructor]`, but you'll need to add
`#![feature(unsafe_destructor)]` to the crate attributes.

[breaking-change]

10 years agoIgnore issue-14393 on Windows
Jakub Wieczorek [Fri, 20 Jun 2014 21:06:06 +0000 (23:06 +0200)]
Ignore issue-14393 on Windows

10 years agoauto merge of #15056 : alexcrichton/rust/issue-15043, r=kballard
bors [Fri, 20 Jun 2014 17:06:19 +0000 (17:06 +0000)]
auto merge of #15056 : alexcrichton/rust/issue-15043, r=kballard

The parser already has special logic for parsing `>` tokens from `>>`, and this
commit extends the logic to the acquiring a `>` from the `>=` and `>>=` tokens
as well.

Closes #15043

10 years agosyntax: Parse GT tokens from `>=` and `>>=`
Alex Crichton [Fri, 20 Jun 2014 16:53:12 +0000 (09:53 -0700)]
syntax: Parse GT tokens from `>=` and `>>=`

The parser already has special logic for parsing `>` tokens from `>>`, and this
commit extends the logic to the acquiring a `>` from the `>=` and `>>=` tokens
as well.

Closes #15043

10 years agoAddress review comments
Jakub Wieczorek [Thu, 19 Jun 2014 18:55:12 +0000 (20:55 +0200)]
Address review comments

10 years agoFix #14393
Jakub Wieczorek [Sun, 8 Jun 2014 23:28:26 +0000 (01:28 +0200)]
Fix #14393

String patterns should have a single constructor of arity 0.

10 years agoAdd unreachability detection for missized patterns of fixed size vectors
Jakub Wieczorek [Sun, 1 Jun 2014 12:40:55 +0000 (14:40 +0200)]
Add unreachability detection for missized patterns of fixed size vectors

Fixed #13482

10 years agoAdd support for fixed size vectors in let/arg patterns
Jakub Wieczorek [Sun, 1 Jun 2014 13:46:14 +0000 (15:46 +0200)]
Add support for fixed size vectors in let/arg patterns

Fixes #7784

10 years agoProvide a witness pattern for non-exhaustive patterns
Jakub Wieczorek [Sat, 7 Jun 2014 12:17:01 +0000 (14:17 +0200)]
Provide a witness pattern for non-exhaustive patterns

Fixed #4321

10 years agoCheck pattern refutability the same way exhaustiveness is checked
Jakub Wieczorek [Sat, 31 May 2014 13:13:46 +0000 (15:13 +0200)]
Check pattern refutability the same way exhaustiveness is checked

10 years agoauto merge of #15050 : kaseyc/rust/impl_eq_for_bitv_bitvset, r=alexcrichton
bors [Fri, 20 Jun 2014 12:56:19 +0000 (12:56 +0000)]
auto merge of #15050 : kaseyc/rust/impl_eq_for_bitv_bitvset, r=alexcrichton

10 years agoauto merge of #15048 : brson/rust/toc-margin, r=alexcrichton
bors [Fri, 20 Jun 2014 11:01:33 +0000 (11:01 +0000)]
auto merge of #15048 : brson/rust/toc-margin, r=alexcrichton

There is no space between the TOC and the succeeding para.

See http://doc.rust-lang.org/guide-pointers.html for example.

10 years agoauto merge of #15047 : brson/rust/taskdocs, r=huonw
bors [Fri, 20 Jun 2014 09:16:22 +0000 (09:16 +0000)]
auto merge of #15047 : brson/rust/taskdocs, r=huonw

This corrects some misinformation.

10 years agoauto merge of #15044 : alexcrichton/rust/speed-up-select, r=kballard
bors [Fri, 20 Jun 2014 07:31:28 +0000 (07:31 +0000)]
auto merge of #15044 : alexcrichton/rust/speed-up-select, r=kballard

This was erroneously disabled as part of 065e121f and it hasn't been turned on
since. This was a 3x perf improvement in a test of mine.

10 years agoauto merge of #14993 : alxgnon/rust/taskpooldocfix, r=alexcrichton
bors [Fri, 20 Jun 2014 05:46:23 +0000 (05:46 +0000)]
auto merge of #14993 : alxgnon/rust/taskpooldocfix, r=alexcrichton

TaskPool is the only item in the std::sync doc that doesn't have a summary. This fixes that problem.

10 years agoImplement Eq for Bitv and BitvSet
Kasey Carrothers [Fri, 20 Jun 2014 04:13:39 +0000 (21:13 -0700)]
Implement Eq for Bitv and BitvSet

10 years agostd::sync::TaskPool: Improve module documentation
Alexandre Gagnon [Fri, 20 Jun 2014 03:17:49 +0000 (23:17 -0400)]
std::sync::TaskPool: Improve module documentation

The struct and module doc comments are reformulated. The `execute`
method's documentation are put up to date, and failure information
is added. A test is also added to address the possible failure.

10 years agoauto merge of #15041 : brson/rust/docindex, r=alexcrichton
bors [Fri, 20 Jun 2014 03:16:26 +0000 (03:16 +0000)]
auto merge of #15041 : brson/rust/docindex, r=alexcrichton

Splits 'extern resources' into 'external documentation and 'community',
adds rustforrubyists.com, rustbyexample.com, stackoverflow.com.

10 years agoauto merge of #15039 : huonw/rust/rustdoc-testharnesss, r=alexcrichton
bors [Fri, 20 Jun 2014 01:31:28 +0000 (01:31 +0000)]
auto merge of #15039 : huonw/rust/rustdoc-testharnesss, r=alexcrichton

    ```test_harness
    #[test]
    fn foo() {}
    ```

will now compile and run the tests, rather than just ignoring & stripping them (i.e. it is as if `--test` was passed).

Also, the specific example in https://github.com/rust-lang/rust/issues/12242 was fixed (but that issue is broader than that example).

10 years agostd: Update std::task docs to reflect modern times
Brian Anderson [Thu, 19 Jun 2014 22:24:21 +0000 (15:24 -0700)]
std: Update std::task docs to reflect modern times

This corrects some misinformation.

10 years agodoc: Fix margins around tables of contents
Brian Anderson [Thu, 19 Jun 2014 23:12:11 +0000 (16:12 -0700)]
doc: Fix margins around tables of contents

There is no space between the TOC and the succeeding para.

10 years agotesting guide: update to use `test_harness` & fix problems.
Huon Wilson [Thu, 19 Jun 2014 13:16:14 +0000 (23:16 +1000)]
testing guide: update to use `test_harness` & fix problems.

rustdoc now supports compiling things with `--test` so the examples in
this guide can be compiled & tested properly (revealing a few issues &
out-dated behaviours).

Also, reword an example to be clearer, cc #12242.

10 years agosync: Enable the fast path of select()
Alex Crichton [Thu, 19 Jun 2014 20:42:23 +0000 (13:42 -0700)]
sync: Enable the fast path of select()

This was erroneously disabled as part of 065e121f and it hasn't been turned on
since. This was a 3x perf improvement in a test of mine.

10 years agoauto merge of #15037 : zzmp/rust/doc/hotkeys, r=alexcrichton
bors [Thu, 19 Jun 2014 19:21:26 +0000 (19:21 +0000)]
auto merge of #15037 : zzmp/rust/doc/hotkeys, r=alexcrichton

Continuing from #15012, this makes four changes to the `rustdoc` static files.

- Change the placeholder text of the search bar to `Click or press 'S' to search, '?' for more options...` to make keyboard hotkeys more apparent (capitalizing the `S` to match the help text).
- Change the `main.js` file to use browser-normalized key codes (`e.which`, from `jQuery`), instead of `e.keyCode`.
- Change the key code for `?` to be the correct `191` instead of `188`, so that the hotkey works to bring up search information.
- Change the search information to display `tab` and `shift+tab` instead of `up` and `down`, as those do not yet work outside of Firefox (see #15011). Also, adjust the height so it does not cut off the help text.

<s>I've also opened up #15038 about the non-functional `up` and `down` functionality, although this does nothing to fix it.</s>

10 years agodoc: Add disclaimers about versions of external docs
Brian Anderson [Thu, 19 Jun 2014 18:45:16 +0000 (11:45 -0700)]
doc: Add disclaimers about versions of external docs

10 years agoUpdate the external links in the doc index
Brian Anderson [Thu, 19 Jun 2014 17:52:02 +0000 (10:52 -0700)]
Update the external links in the doc index

Splits 'extern resources' into 'external documentation and 'community',
adds rustforrubyists.com and rustbyexample.com, stackoverflow.com.

10 years agoauto merge of #15033 : Sawyer47/rust/old-test, r=alexcrichton
bors [Thu, 19 Jun 2014 17:26:26 +0000 (17:26 +0000)]
auto merge of #15033 : Sawyer47/rust/old-test, r=alexcrichton

This test was added long time ago and marked as ignored.
The same test was added later in #8485 as run-fail/issue-3907.rs,
but the old one was not deleted.

10 years ago(doc) Properly doc hotkeys in generated docs.
Zach Pomerantz [Wed, 18 Jun 2014 18:25:04 +0000 (11:25 -0700)]
(doc) Properly doc hotkeys in generated docs.

Updated search bar to match help text.
Used correct, normalized hotkeys in search.
Updated shortcut menu with working shortcuts (tabs).
Changed height of search help.

10 years agorustdoc: add the ability to run tests with --test.
Huon Wilson [Thu, 19 Jun 2014 13:11:18 +0000 (23:11 +1000)]
rustdoc: add the ability to run tests with --test.

This adds the `test_harness` directive that runs a code block using the
test runner, to allow for `#[test]` items to be demonstrated and still
tested (currently they are just stripped and not even compiled, let
alone run).

10 years agorustdoc: refactor code block language info into a struct.
Huon Wilson [Thu, 19 Jun 2014 12:38:01 +0000 (22:38 +1000)]
rustdoc: refactor code block language info into a struct.

Fields have names, unlike an anonymous tuple.

10 years agoauto merge of #14830 : luqmana/rust/cmtrttcbctto, r=nikomatsakis
bors [Thu, 19 Jun 2014 09:26:24 +0000 (09:26 +0000)]
auto merge of #14830 : luqmana/rust/cmtrttcbctto, r=nikomatsakis

Fixes #14399.

10 years agoAdd stability inheritance
Aaron Turon [Thu, 12 Jun 2014 00:23:11 +0000 (17:23 -0700)]
Add stability inheritance

This commit makes several changes to the stability index infrastructure:

* Stability levels are now inherited lexically, i.e., each item's
  stability level becomes the default for any nested items.

* The computed stability level for an item is stored as part of the
  metadata. When using an item from an external crate, this data is
  looked up and cached.

* The stability lint works from the computed stability level, rather
  than manual stability attribute annotations. However, the lint still
  checks only a limited set of item uses (e.g., it does not check every
  component of a path on import). This will be addressed in a later PR,
  as part of issue #8962.

* The stability lint only applies to items originating from external
  crates, since the stability index is intended as a promise to
  downstream crates.

* The "experimental" lint is now _allow_ by default. This is because
  almost all existing crates have been marked "experimental", pending
  library stabilization. With inheritance in place, this would generate
  a massive explosion of warnings for every Rust program.

  The lint should be changed back to deny-by-default after library
  stabilization is complete.

* The "deprecated" lint still warns by default.

The net result: we can begin tracking stability index for the standard
libraries as we stabilize, without impacting most clients.

Closes #13540.

10 years agoauto merge of #14400 : kballard/rust/lexer_crlf_handling, r=cmr
bors [Thu, 19 Jun 2014 05:21:16 +0000 (05:21 +0000)]
auto merge of #14400 : kballard/rust/lexer_crlf_handling, r=cmr

The lexer already ignores CRLF in between tokens, but it doesn't
properly handle carriage returns inside strings and doc comments. Teach
it to treat CRLF as LF inside these tokens, and to disallow carriage
returns that are not followed by linefeeds. This includes handling an
escaped CRLF inside a regular string token the same way it handles an
escaped LF.

This is technically a breaking change, as bare carriage returns are no
longer allowed, and CRLF sequences are now treated as LF inside strings
and doc comments, but it's very unlikely to actually affect any
real-world code.

This change is necessary to have Rust code compile on Windows the same
way it does on Unix. The mozilla/rust repository explicitly sets eol=lf
for Rust source files, but other Rust repositories don't. Notably,
rust-http cannot be compiled on Windows without converting the CRLF line
endings back to LF.

[breaking-change]

10 years agoHandle CRLF properly in the lexer
Kevin Ballard [Sat, 24 May 2014 08:13:59 +0000 (01:13 -0700)]
Handle CRLF properly in the lexer

The lexer already ignores CRLF in between tokens, but it doesn't
properly handle carriage returns inside strings and doc comments. Teach
it to treat CRLF as LF inside these tokens, and to disallow carriage
returns that are not followed by linefeeds. This includes handling an
escaped CRLF inside a regular string token the same way it handles an
escaped LF.

This is technically a breaking change, as bare carriage returns are no
longer allowed, and CRLF sequences are now treated as LF inside strings
and doc comments, but it's very unlikely to actually affect any
real-world code.

This change is necessary to have Rust code compile on Windows the same
way it does on Unix. The mozilla/rust repository explicitly sets eol=lf
for Rust source files, but other Rust repositories don't. Notably,
rust-http cannot be compiled on Windows without converting the CRLF line
endings back to LF.

[breaking-change]

10 years agoauto merge of #15014 : brson/rust/all-crates-experimental, r=cmr
bors [Thu, 19 Jun 2014 03:31:18 +0000 (03:31 +0000)]
auto merge of #15014 : brson/rust/all-crates-experimental, r=cmr

This creates a stability baseline for all crates that we distribute that are not `std`. In general, all library code must start as experimental and progress in stages to become stable.

10 years agoauto merge of #15025 : alexcrichton/rust/rollup, r=alexcrichton
bors [Thu, 19 Jun 2014 01:41:43 +0000 (01:41 +0000)]
auto merge of #15025 : alexcrichton/rust/rollup, r=alexcrichton

10 years agoMerge conflicts from the rollup
Alex Crichton [Thu, 19 Jun 2014 00:05:15 +0000 (17:05 -0700)]
Merge conflicts from the rollup

Closes #14480 (vim: Add :RustRun and associated commands)
Closes #14917 (Deprecate free-standing endian conversions in favor of methods on Int. Merge Bitwise into Int and add more bit operations.)
Closes #14981 (librustc: Use expr_ty_adjusted in trans_overloaded_call.)
Closes #14989 (std::task - Revamp TaskBuilder API)
Closes #14997 (Reject double moves out of array elements)
Closes #14998 (Vim: highlight escapes for byte literals.)
Closes #15002 (Fix FIXME #5275)
Closes #15004 (Fix #14865)
Closes #15007 (debuginfo: Add test case for issue #14411.)
Closes #15012 ((doc) Change search placeholder text.)
Closes #15013 (Update compiler-rt.)
Closes #15017 (Deprecate the bytes!() macro.)

10 years agoRevert bytes!() docstring change, and fix a typo.
Simon Sapin [Wed, 18 Jun 2014 22:59:40 +0000 (00:59 +0200)]
Revert bytes!() docstring change, and fix a typo.

10 years agoDeprecate the bytes!() macro.
Simon Sapin [Wed, 18 Jun 2014 18:25:36 +0000 (20:25 +0200)]
Deprecate the bytes!() macro.

Replace its usage with byte string literals, except in `bytes!()` tests.
Also add a new snapshot, to be able to use the new b"foo" syntax.

The src/etc/2014-06-rewrite-bytes-macros.py script automatically
rewrites `bytes!()` invocations into byte string literals.
Pass it filenames as arguments to generate a diff that you can inspect,
or `--apply` followed by filenames to apply the changes in place.
Diffs can be piped into `tip` or `pygmentize -l diff` for coloring.

10 years agoUpdate compiler-rt to work for non-v7 arm.
Luqman Aden [Wed, 18 Jun 2014 18:51:15 +0000 (14:51 -0400)]
Update compiler-rt to work for non-v7 arm.

10 years ago(doc) Change search placeholder text.
Zach Pomerantz [Wed, 18 Jun 2014 18:25:04 +0000 (11:25 -0700)]
(doc) Change search placeholder text.

Update placeholder text to make keyboard shortcuts more apparent.

10 years agodebuginfo: Add test case for issue 14411.
Michael Woerister [Wed, 18 Jun 2014 15:56:21 +0000 (17:56 +0200)]
debuginfo: Add test case for issue 14411.

10 years agoFix #14865
Edward Wang [Wed, 18 Jun 2014 14:33:58 +0000 (22:33 +0800)]
Fix #14865

Fixes a codegen bug which generates illegal non-terminated LLVM block
when there are wildcard pattern with guard and enum patterns in a match
expression. Also refactors the code a little.

Closes #14865

10 years agoFix FIXME #5275
Piotr Jawniak [Wed, 18 Jun 2014 09:40:41 +0000 (11:40 +0200)]
Fix FIXME #5275

Issue #5275 was closed, but there still was a FIXME for it.

10 years agoVim: highlight invalid characters in char literals.
Chris Morgan [Wed, 18 Jun 2014 09:58:04 +0000 (19:58 +1000)]
Vim: highlight invalid characters in char literals.

10 years agoVim: highlight escapes for byte literals.
Chris Morgan [Wed, 18 Jun 2014 07:39:18 +0000 (17:39 +1000)]
Vim: highlight escapes for byte literals.

10 years agoReject double moves out of array elements
Cameron Zwarich [Wed, 18 Jun 2014 07:06:39 +0000 (00:06 -0700)]
Reject double moves out of array elements

Fixes #14986.

10 years agoFallout from TaskBuilder changes
Aaron Turon [Mon, 16 Jun 2014 23:17:59 +0000 (16:17 -0700)]
Fallout from TaskBuilder changes

This commit brings code downstream of libstd up to date with the new
TaskBuilder API.

10 years agoRevamp TaskBuilder API
Aaron Turon [Tue, 17 Jun 2014 21:48:54 +0000 (14:48 -0700)]
Revamp TaskBuilder API

This patch consolidates and cleans up the task spawning APIs:

* Removes the problematic `future_result` method from `std::task::TaskBuilder`,
  and adds a `try_future` that both spawns the task and returns a future
  representing its eventual result (or failure).

* Removes the public `opts` field from `TaskBuilder`, instead adding appropriate
  builder methods to configure the task.

* Adds extension traits to libgreen and libnative that add methods to
  `TaskBuilder` for spawning the task as a green or native thread.

Previously, there was no way to benefit from the `TaskBuilder` functionality and
also set the scheduler to spawn within.

With this change, all task spawning scenarios are supported through the
`TaskBuilder` interface.

Closes #3725.

[breaking-change]

10 years agolibrustc: Use expr_ty_adjusted in trans_overloaded_call.
Luqman Aden [Tue, 17 Jun 2014 19:21:28 +0000 (15:21 -0400)]
librustc: Use expr_ty_adjusted in trans_overloaded_call.

10 years agoUpdate doc comment for Int trait
Brendan Zabarauskas [Tue, 17 Jun 2014 18:09:20 +0000 (11:09 -0700)]
Update doc comment for Int trait

10 years agoShorten endian conversion method names
Brendan Zabarauskas [Tue, 17 Jun 2014 22:47:31 +0000 (15:47 -0700)]
Shorten endian conversion method names

The consensus on #14917 was that the proposed names were too long.

10 years agoRemove `#[stable]` attribute from free-standing endian conversions and mark them...
Brendan Zabarauskas [Mon, 16 Jun 2014 21:33:45 +0000 (14:33 -0700)]
Remove `#[stable]` attribute from free-standing endian conversions and mark them as deprecated

10 years agoMerge the Bitwise and ByteOrder traits into the Int trait
Brendan Zabarauskas [Mon, 16 Jun 2014 18:25:47 +0000 (11:25 -0700)]
Merge the Bitwise and ByteOrder traits into the Int trait

This reduces the complexity of the trait hierarchy.