]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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 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 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.

10 years agoFix comment formatting
Brendan Zabarauskas [Mon, 16 Jun 2014 07:22:51 +0000 (00:22 -0700)]
Fix comment formatting

10 years agoUse ByteOrder methods instead of free-standing functions
Brendan Zabarauskas [Sun, 15 Jun 2014 06:11:33 +0000 (23:11 -0700)]
Use ByteOrder methods instead of free-standing functions

10 years agoAdd a ByteOrder trait for abstracting over endian conversions
Brendan Zabarauskas [Sun, 15 Jun 2014 05:53:55 +0000 (22:53 -0700)]
Add a ByteOrder trait for abstracting over endian conversions

The `Bitwise::swap_bytes` method was also moved into the `ByteOrder` trait. This was because it works on the byte level rather than the bit level.

10 years agoAdd commands :RustEmitIr and :RustEmitAsm
Kevin Ballard [Fri, 30 May 2014 23:35:10 +0000 (16:35 -0700)]
Add commands :RustEmitIr and :RustEmitAsm

10 years agoWrite documentation for the Rust vim plugin
Kevin Ballard [Fri, 30 May 2014 07:06:52 +0000 (00:06 -0700)]
Write documentation for the Rust vim plugin

10 years agoRename :Run and :Expand to :RustRun and :RustExpand
Kevin Ballard [Fri, 30 May 2014 06:43:52 +0000 (23:43 -0700)]
Rename :Run and :Expand to :RustRun and :RustExpand

10 years agovim: Add :Run and :Expand commands
Kevin Ballard [Tue, 27 May 2014 22:00:22 +0000 (15:00 -0700)]
vim: Add :Run and :Expand commands

Define a command :Run to compile and run the current file. This supports
unnamed buffers (by writing to a temporary file). See the comment above
the command definition for notes on usage.

Define <D-r> and <D-R> mappings for :Run to make it easier to invoke in
MacVim.

Define a command :Expand to display the --pretty expanded output for the
current file. This can be configured to use different pretty types. See
the comment above the command definition for notes on usage.

Create an autoload file and put function definitions there to speed up
load time.

10 years agoauto merge of #15006 : alexcrichton/rust/fix-nightly, r=brson
bors [Wed, 18 Jun 2014 22:41:40 +0000 (22:41 +0000)]
auto merge of #15006 : alexcrichton/rust/fix-nightly, r=brson

The nightly builds on linux have been failing over the past few days due to a
malformed LD_LIBRARY_PATH. It appears that the underlying cause is that one of
the tests, dep-info-custom, recursively invokes make but the RUSTC variable
passed down has the string "$LD_LIBRARY_PATH". This is intended to read the
host's original LD_LIBRARY_PATH, but it appears that the makefile is eagerly
expanding the "$L" to nothing, causing the original host's LD_LIBRARY_PATH to be
ignored.

This fix removes passing the string "$LD_LIBRARY_PATH" and rather expands it
eagerly to ensure that escaping doesn't happen at a later stage. I'm still not
entirely sure why the makefile is interpreting the dollar as a variable, but
this seems to fix the issue.

10 years agoauto merge of #14854 : jakub-/rust/issue-10991, r=pcwalton
bors [Wed, 18 Jun 2014 20:51:46 +0000 (20:51 +0000)]
auto merge of #14854 : jakub-/rust/issue-10991, r=pcwalton

Fixes #10991.

10 years agotest: Attempt to fix nightly-linux
Alex Crichton [Wed, 18 Jun 2014 15:47:44 +0000 (08:47 -0700)]
test: Attempt to fix nightly-linux

The nightly builds on linux have been failing over the past few days due to a
malformed LD_LIBRARY_PATH. It appears that the underlying cause is that one of
the tests, dep-info-custom, recursively invokes make but the RUSTC variable
passed down has the string "$LD_LIBRARY_PATH". This is intended to read the
host's original LD_LIBRARY_PATH, but it appears that the makefile is eagerly
expanding the "$L" to nothing, causing the original host's LD_LIBRARY_PATH to be
ignored.

This fix removes passing the string "$LD_LIBRARY_PATH" and rather expands it
eagerly to ensure that escaping doesn't happen at a later stage. I'm still not
entirely sure why the makefile is interpreting the dollar as a variable, but
this seems to fix the issue.

10 years agoDon't require mutable StringReader to emit lexer errors
Kevin Ballard [Sat, 24 May 2014 08:12:22 +0000 (01:12 -0700)]
Don't require mutable StringReader to emit lexer errors

Teach StringReader how to emit errors for arbitrary spans, so we don't
need to modify peek_span. This allows for emitting errors without having
a &mut borrow of the StringReader.

10 years agoRemove obsolete test
Piotr Jawniak [Wed, 18 Jun 2014 17:12:30 +0000 (19:12 +0200)]
Remove obsolete test

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 agoauto merge of #14879 : Ryman/rust/resolve_super_hint_cut, r=alexcrichton
bors [Wed, 18 Jun 2014 18:06:42 +0000 (18:06 +0000)]
auto merge of #14879 : Ryman/rust/resolve_super_hint_cut, r=alexcrichton

10 years agoFix spans for doc comments
Kevin Ballard [Sat, 24 May 2014 04:41:59 +0000 (21:41 -0700)]
Fix spans for doc comments

10 years agoauto merge of #14873 : pnkfelix/rust/fsk-dataflow-revisions, r=nikomatsakis
bors [Wed, 18 Jun 2014 16:16:42 +0000 (16:16 +0000)]
auto merge of #14873 : pnkfelix/rust/fsk-dataflow-revisions, r=nikomatsakis

Fix #6298.  Fix  #13767.

This also includes some drive by fixes for some other issues, noted in the commits.

I still need to integrate regression tests for some cases that I noticed were missing from our unit test suite (i.e. things that compiling rustc exposes that should have been exposed when doing `make check-stage1`).  So do not land this yet, until I get the chance to add those tests.

I just wanted to get the review process started soon, since this has been long in the coming.

10 years agoAdapt test case to match current set of emitted warnings. (or lack
Felix S. Klock II [Wed, 18 Jun 2014 13:27:49 +0000 (15:27 +0200)]
Adapt test case to match current set of emitted warnings.  (or lack
thereof.)

PR 14739 injected the new message that this removes from one test
case: borrowck-vec-pattern-loan-from-mut.rs

When reviewing the test case, I was not able to convince myself that
the error message was a legitimate thing to start emitting.  Niko did
not see an obvious reason for it either, so I am going to remove it
and wait for someone (maybe Cameron Zwarich) to explain to me why we
should be emitting it.

10 years agoRegression tests for flowgraph construction bug on ExprWhile.
Felix S. Klock II [Tue, 17 Jun 2014 13:38:50 +0000 (15:38 +0200)]
Regression tests for flowgraph construction bug on ExprWhile.

10 years agosome extra test cases to cover in the borrow checker.
Felix S. Klock II [Tue, 17 Jun 2014 12:52:11 +0000 (14:52 +0200)]
some extra test cases to cover in the borrow checker.

10 years agofix typo in borrowck doc.
Felix S. Klock II [Tue, 10 Jun 2014 12:22:48 +0000 (14:22 +0200)]
fix typo in borrowck doc.

10 years agoEnsure dataflow of a proc never looks at blocks from closed-over context.
Felix S. Klock II [Fri, 13 Jun 2014 15:19:29 +0000 (17:19 +0200)]
Ensure dataflow of a proc never looks at blocks from closed-over context.

Details: in a program like:
```
type T = proc(int) -> int; /* 4 */

pub fn outer(captured /* pat 16 */: T) -> T {
    (proc(x /* pat 23 */) {
        ((captured /* 29 */).foo((x /* 30 */)) /* 28 */)
    } /* block 27 */ /* 20 */)
} /* block 19 */ /* 12 */
```
the `captured` arg is moved from the outer fn into the inner proc (id=20).

The old dataflow analysis for flowed_move_data_moves, when looking at
the inner proc, would attempt to add a kill bit for `captured` at the
end of its scope; the problem is that it thought the end of the
`captured` arg's scope was the outer fn (id=12), even though at that
point in the analysis, the `captured` arg's scope should now be
restricted to the proc itself (id=20).

This patch fixes handling of upvars so that dataflow of a fn/proc
should never attempts to add a gen or kill bit to any NodeId outside
of the current fn/proc.  It accomplishes this by adding an `LpUpvar`
variant to `borrowck::LoanPath`, so for cases like `captured` above
will carry both their original `var_id`, as before, as well as the
`NodeId` for the closure that is capturing them.

As a drive-by fix to another occurrence of a similar bug that
nikomatsakis pointed out to me earlier, this also fixes
`gather_loans::compute_kill_scope` so that it computes the kill scope
of the `captured` arg to be block 27; that is, the block for the proc
itself (id=20).

(This is an updated version that generalizes the new loan path variant
to cover all upvars, and thus renamed the variant from `LpCopiedUpvar`
to just `LpUpvar`.)

10 years agomiddle::cfg code cleanup.
Felix S. Klock II [Wed, 21 May 2014 12:48:33 +0000 (14:48 +0200)]
middle::cfg code cleanup.

Namely:

 1. Now that cfg mod is used for dataflow, we do not need to turn on
    the `allow(deadcode)` to placate the linter.

 2. remove dead struct defn.

10 years agoRevise dataflow to do a cfg-driven walk.
Felix S. Klock II [Wed, 21 May 2014 12:49:16 +0000 (14:49 +0200)]
Revise dataflow to do a cfg-driven walk.

Fix #6298.

This is instead of the prior approach of emulating cfg traversal
privately by traversing AST in same way).

Of special note, this removes a special case handling of `ExprParen`
that was actually injecting a bug (since it was acting like an
expression like `(*func)()` was consuming `*func` *twice*: once from
`(*func)` and again from `*func`).  nikomatsakis was the first one to
point out that it might suffice to simply have the outer `ExprParen`
do the consumption of the contents (alone).

(This version has been updated to incorporate feedback from Niko's
review of PR 14873.)

10 years agoNodeIndex should derive `Show`.
Felix S. Klock II [Wed, 21 May 2014 12:48:03 +0000 (14:48 +0200)]
NodeIndex should derive `Show`.

10 years agoBug fixes for flowgraph construction.
Felix S. Klock II [Tue, 20 May 2014 16:49:19 +0000 (18:49 +0200)]
Bug fixes for flowgraph construction.

1. After recursively processing an ExprWhile, need to pop loop_scopes
   the same way we do for ExprLoop.

2. Proposed fix for flowgraph handling of ExprInlineAsm: we need to
   represent the flow into the subexpressions of an `asm!` block.

10 years agoauto merge of #14984 : thestinger/rust/libc, r=alexcrichton
bors [Wed, 18 Jun 2014 14:26:42 +0000 (14:26 +0000)]
auto merge of #14984 : thestinger/rust/libc, r=alexcrichton

10 years agoauto merge of #14990 : tomjakubowski/rust/emacs-fix-attribute-highlight, r=pnkfelix
bors [Wed, 18 Jun 2014 12:36:42 +0000 (12:36 +0000)]
auto merge of #14990 : tomjakubowski/rust/emacs-fix-attribute-highlight, r=pnkfelix

This addresses the font lock regression introduced by the earlier pull
request #14818 - attributes are no longer be highligted inside of comments
and strings.

Also add some font lock test infrastructure and some tests for attribute
font locking and fix some minor nits.

10 years agoauto merge of #15000 : alexcrichton/rust/fix-rustdoc-tests, r=huonw
bors [Wed, 18 Jun 2014 10:46:41 +0000 (10:46 +0000)]
auto merge of #15000 : alexcrichton/rust/fix-rustdoc-tests, r=huonw

Commits have the descriptions.

10 years agoauto merge of #14994 : nick29581/rust/comments, r=bstrie
bors [Wed, 18 Jun 2014 08:56:43 +0000 (08:56 +0000)]
auto merge of #14994 : nick29581/rust/comments, r=bstrie

Plus a few other misc style things.

10 years agostd: Remove dual export of `Show`
Alex Crichton [Wed, 18 Jun 2014 08:13:53 +0000 (01:13 -0700)]
std: Remove dual export of `Show`

Closes #14996