]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoauto merge of #17683 : gereeter/rust/ident-to-name, r=pcwalton
bors [Thu, 23 Oct 2014 20:22:18 +0000 (20:22 +0000)]
auto merge of #17683 : gereeter/rust/ident-to-name, r=pcwalton

This does a large chunk of #6993. It is based on top of #17654.

9 years agoFail immediately if linking returns status code != 0
Markus Siemens [Wed, 22 Oct 2014 20:23:22 +0000 (22:23 +0200)]
Fail immediately if linking returns status code != 0

9 years agoauto merge of #18253 : steveklabnik/rust/small_doc_fixes, r=huonw
bors [Thu, 23 Oct 2014 16:57:24 +0000 (16:57 +0000)]
auto merge of #18253 : steveklabnik/rust/small_doc_fixes, r=huonw

All these stars aren't needed anymore.

9 years agoplugin-guide: nicer creation of the parser
Robin Gloster [Thu, 23 Oct 2014 15:20:57 +0000 (17:20 +0200)]
plugin-guide: nicer creation of the parser

9 years agoAdd syntax::print::pprint::view_item_to_string
Simon Sapin [Thu, 23 Oct 2014 14:56:33 +0000 (23:56 +0900)]
Add syntax::print::pprint::view_item_to_string

… similar to the existing `item_to_string`.

There may be more missing like this.

9 years agoImprove code in the intro.
Steve Klabnik [Thu, 23 Oct 2014 11:35:34 +0000 (07:35 -0400)]
Improve code in the intro.

All these stars aren't needed anymore.

9 years agobuild the crates guide
Steve Klabnik [Thu, 23 Oct 2014 08:35:35 +0000 (04:35 -0400)]
build the crates guide

9 years agoauto merge of #18217 : mikedilger/rust/bug_report_instructions, r=pnkfelix
bors [Thu, 23 Oct 2014 11:37:12 +0000 (11:37 +0000)]
auto merge of #18217 : mikedilger/rust/bug_report_instructions, r=pnkfelix

Fixed as per @pnkfelix comments in #17848

9 years agoFix codegen breaking aliasing rules for functions with sret results
Björn Steinbrink [Wed, 22 Oct 2014 19:23:26 +0000 (21:23 +0200)]
Fix codegen breaking aliasing rules for functions with sret results

This reverts commit a0ec902e239b2219edf1a18b036dd32c18d3be42 "Avoid
unnecessary temporary on assignments".

Leaving out the temporary for the functions return value can lead to a
situation that conflicts with rust's aliasing rules.

Given this:

````rust
fn func(f: &mut Foo) -> Foo { /* ... */ }

fn bar() {
    let mut foo = Foo { /* ... */ };

    foo = func(&mut foo);
}
````

We effectively get two mutable references to the same variable `foo` at
the same time. One for the parameter `f`, and one for the hidden
out-pointer. So we can't just `trans_into` the destination directly, but
must use `trans` to get a new temporary slot from which the result can
be copied.

9 years agoauto merge of #17868 : nick29581/rust/valgrind, r=alexcrichton
bors [Thu, 23 Oct 2014 05:27:11 +0000 (05:27 +0000)]
auto merge of #17868 : nick29581/rust/valgrind, r=alexcrichton

r? @alexcrichton

9 years agoError if we should be able to Valgrind but can't
Nick Cameron [Wed, 8 Oct 2014 23:11:37 +0000 (12:11 +1300)]
Error if we should be able to Valgrind but can't

9 years agoPart of #6993. Moved a bunch of uses of Ident to Name
Jonathan S [Wed, 1 Oct 2014 00:11:34 +0000 (19:11 -0500)]
Part of #6993. Moved a bunch of uses of Ident to Name

9 years agoRemove support for .rc files from test.mk
Nick Cameron [Wed, 8 Oct 2014 03:30:20 +0000 (16:30 +1300)]
Remove support for .rc files from test.mk

9 years agoMake rpass-valgrind work with pretty
Nick Cameron [Wed, 8 Oct 2014 02:41:15 +0000 (15:41 +1300)]
Make rpass-valgrind work with pretty

9 years agoMove some tests to run-pass-valgrind
Nick Cameron [Tue, 7 Oct 2014 07:59:07 +0000 (20:59 +1300)]
Move some tests to run-pass-valgrind

9 years agoAdd run-pass-valgrind tests
Nick Cameron [Tue, 7 Oct 2014 07:00:26 +0000 (20:00 +1300)]
Add run-pass-valgrind tests

Closes #16914

9 years agoauto merge of #18224 : nikomatsakis/rust/issue-17594, r=alexcrichton
bors [Wed, 22 Oct 2014 23:57:11 +0000 (23:57 +0000)]
auto merge of #18224 : nikomatsakis/rust/issue-17594, r=alexcrichton

Add test for issue #17594

Fixes #17594

9 years agoFixed single quote around string slice and simplify example
areski [Wed, 22 Oct 2014 22:44:17 +0000 (00:44 +0200)]
Fixed single quote around string slice and simplify example

This patch contains a fix for:
- single quote around string slice
- string: String is confusing for newbies and it's more readble if the
  argument name is different that the argument type name

9 years agoauto merge of #18092 : michaelwoerister/rust/lldb-test-versioning, r=alexcrichton
bors [Wed, 22 Oct 2014 21:32:16 +0000 (21:32 +0000)]
auto merge of #18092 : michaelwoerister/rust/lldb-test-versioning, r=alexcrichton

Now that there are build bots with a stable enough LLDB version on OSX we can finally let the tests run on every PR!
:joy_cat:

9 years agoauto merge of #17846 : tomjakubowski/rust/rustdoc-hide-private-traits, r=alexcrichton
bors [Wed, 22 Oct 2014 16:47:14 +0000 (16:47 +0000)]
auto merge of #17846 : tomjakubowski/rust/rustdoc-hide-private-traits, r=alexcrichton

Fix #16563

9 years agoUse local cache when there are unbound type variables and where clauses in scope.
Niko Matsakis [Wed, 22 Oct 2014 15:35:53 +0000 (11:35 -0400)]
Use local cache when there are unbound type variables and where clauses in scope.

Fixes #18209.

9 years agoauto merge of #18230 : cakebaker/rust/adapt_range_value_to_variable_name, r=steveklabnik
bors [Wed, 22 Oct 2014 14:32:11 +0000 (14:32 +0000)]
auto merge of #18230 : cakebaker/rust/adapt_range_value_to_variable_name, r=steveklabnik

 The variable name <code>one_to_one_hundred</code> implies that it will contain a collection with the values from 1 to 100, but the collection contains the values from 0 to 99. This patch changes the ranges to produce a collection with the values from 1 to 100.

9 years agoGuide: Change >= to > in closure
Daniel Hofstetter [Wed, 22 Oct 2014 14:16:05 +0000 (16:16 +0200)]
Guide: Change >= to > in closure

9 years agoGuide: Adapt range values to variable name
Daniel Hofstetter [Wed, 22 Oct 2014 13:32:28 +0000 (15:32 +0200)]
Guide: Adapt range values to variable name

9 years agoauto merge of #18223 : nikomatsakis/rust/coherence-orphan-18222, r=pcwalton
bors [Wed, 22 Oct 2014 09:22:09 +0000 (09:22 +0000)]
auto merge of #18223 : nikomatsakis/rust/coherence-orphan-18222, r=pcwalton

Adjust orphan rules to consider all input types, not just self type.

Fixes #18222.

r? @pcwalton

9 years agodebuginfo: Print more output in lldb_batchmode.py for better error logs.
Michael Woerister [Wed, 22 Oct 2014 08:45:29 +0000 (10:45 +0200)]
debuginfo: Print more output in lldb_batchmode.py for better error logs.

9 years agodebuginfo: Let LLDB tests run in parallel again since our min-supported version has...
Michael Woerister [Thu, 16 Oct 2014 08:18:54 +0000 (10:18 +0200)]
debuginfo: Let LLDB tests run in parallel again since our min-supported version has no problems with that.

9 years agodebuginfo: Enable LLDB test suite on Darwin.
Michael Woerister [Thu, 16 Oct 2014 08:09:16 +0000 (10:09 +0200)]
debuginfo: Enable LLDB test suite on Darwin.

9 years agodebuginfo: Make some path LLDB-related paths in the test runner absolute to help...
Michael Woerister [Wed, 8 Oct 2014 16:28:30 +0000 (18:28 +0200)]
debuginfo: Make some path LLDB-related paths in the test runner absolute to help the build bots.

9 years agodebuginfo: Gate all LLDB debuginfo tests on a minimum LLDB version being available
Michael Woerister [Thu, 9 Oct 2014 14:31:03 +0000 (16:31 +0200)]
debuginfo: Gate all LLDB debuginfo tests on a minimum LLDB version being available

9 years agoauto merge of #18141 : phildawes/rust/master, r=brson
bors [Wed, 22 Oct 2014 07:07:09 +0000 (07:07 +0000)]
auto merge of #18141 : phildawes/rust/master, r=brson

Hello! I noticed spans are wrong for the PatIdents of self args. (I use spans a lot in racer)

9 years agoauto merge of #18213 : pcwalton/rust/pcg-default, r=aturon
bors [Wed, 22 Oct 2014 04:42:11 +0000 (04:42 +0000)]
auto merge of #18213 : pcwalton/rust/pcg-default, r=aturon

Enable parallel codegen (2 units) by default when --opt-level is 0 or 1.  This
gives a minor speedup on large crates (~10%), with only a tiny slowdown (~2%)
for small ones (which usually build in under a second regardless).  The current
default (no parallelization) is used when the user requests optimization
(--opt-level 2 or 3), and when the user has enabled LTO (which is incompatible
with parallel codegen).

This commit also changes the rust build system to use parallel codegen
when appropriate.  This means codegen-units=4 for stage0 always, and
also for stage1 and stage2 when configured with --disable-optimize.
(Other settings use codegen-units=1 for stage1 and stage2, to get
maximum performance for release binaries.)  The build system also sets
codegen-units=1 for compiletest tests (compiletest does its own
parallelization) and uses the same setting as stage2 for crate tests.

r? @aturon

9 years agoAdd test for issue #17594
Niko Matsakis [Wed, 22 Oct 2014 03:57:16 +0000 (23:57 -0400)]
Add test for issue #17594

9 years agoAdjust orphan rules to consider all input types, not just self type.
Niko Matsakis [Wed, 22 Oct 2014 03:48:39 +0000 (23:48 -0400)]
Adjust orphan rules to consider all input types, not just self type.

Fixes #18222.

9 years agoFix issue #17848 (Questionable advice in bug report instructions)
Mike Dilger [Tue, 21 Oct 2014 23:17:50 +0000 (12:17 +1300)]
Fix issue #17848 (Questionable advice in bug report instructions)

9 years agoauto merge of #18121 : nikomatsakis/rust/method-call-use-trait-matching-infrastructur...
bors [Wed, 22 Oct 2014 00:22:04 +0000 (00:22 +0000)]
auto merge of #18121 : nikomatsakis/rust/method-call-use-trait-matching-infrastructure-2, r=pcwalton

Convert trait method dispatch to use new trait matching machinery.

This fixes about 90% of #17918. What remains to be done is to make inherent dispatch work with conditional dispatch as well. I plan to do this in a future patch by generalizing the "method match" code slightly to work for inherent impls as well (the basic algorithm is precisely the same).

Fixes #17178.

This is a [breaking-change] for two reasons:

1. The old code was a bit broken. I found various minor cases, particularly around operators, where the old code incorrectly matched, but an extra `*` or other change is now required. (See commit e8cef25 ("Correct case where the old version of method lookup...") for examples.)
2. The old code didn't type check calls against the method signature from the *trait* but rather the *impl*. The two can be different in subtle ways. This makes the new method dispatch both more liberal and more conservative than the original. (See commit 8308332 ("The new method lookup mechanism typechecks...") for examples.)

r? @pcwalton since he's been reviewing most of this series of changes
f? @nick29581 for commit 39df55f ("Permit DST types to unify like other types")
cc @aturon as this relates to library stabilization

9 years agoenable parallel codegen by default
Stuart Pernsteiner [Mon, 6 Oct 2014 23:59:21 +0000 (16:59 -0700)]
enable parallel codegen by default

Enable parallel codegen (2 units) by default when --opt-level is 0 or 1.  This
gives a minor speedup on large crates (~10%), with only a tiny slowdown (~2%)
for small ones (which usually build in under a second regardless).  The current
default (no parallelization) is used when the user requests optimization
(--opt-level 2 or 3), and when the user has enabled LTO (which is incompatible
with parallel codegen).

This commit also changes the rust build system to use parallel codegen
when appropriate.  This means codegen-units=4 for stage0 always, and
also for stage1 and stage2 when configured with --disable-optimize.
(Other settings use codegen-units=1 for stage1 and stage2, to get
maximum performance for release binaries.)  The build system also sets
codegen-units=1 for compiletest tests (compiletest does its own
parallelization) and uses the same setting as stage2 for crate tests.

9 years agoPatch up broken error messages
Niko Matsakis [Tue, 21 Oct 2014 21:36:15 +0000 (17:36 -0400)]
Patch up broken error messages

9 years agoauto merge of #18203 : mahkoh/rust/cstring, r=thestinger
bors [Tue, 21 Oct 2014 19:32:10 +0000 (19:32 +0000)]
auto merge of #18203 : mahkoh/rust/cstring, r=thestinger

This is about 20x faster on my machine.

9 years agoAddress nits by @pcwalton
Niko Matsakis [Tue, 21 Oct 2014 15:49:06 +0000 (11:49 -0400)]
Address nits by @pcwalton

9 years agoCoherence tests that seemed to be missing.
Niko Matsakis [Fri, 17 Oct 2014 13:13:22 +0000 (09:13 -0400)]
Coherence tests that seemed to be missing.

9 years agoTests for method resolution in the face of various ambiguities or non-ambiguities...
Niko Matsakis [Fri, 17 Oct 2014 13:13:12 +0000 (09:13 -0400)]
Tests for method resolution in the face of various ambiguities or non-ambiguities. These
are mostly new tests though I also revamped (and renamed) some of the existing tests.

9 years agoVarious minor cases where errors are reported in slightly different ways.
Niko Matsakis [Fri, 17 Oct 2014 13:12:25 +0000 (09:12 -0400)]
Various minor cases where errors are reported in slightly different ways.

9 years agoTest where the old infrastructure failed to detect the (applicable) impl of `FnMut...
Niko Matsakis [Fri, 17 Oct 2014 13:12:10 +0000 (09:12 -0400)]
Test where the old infrastructure failed to detect the (applicable) impl of `FnMut` for
some reason.

9 years agoThe new method lookup mechanism typechecks calls against the method type declared...
Niko Matsakis [Fri, 17 Oct 2014 13:11:10 +0000 (09:11 -0400)]
The new method lookup mechanism typechecks calls against the method type declared in the trait, not in the impl. In some cases that results in tighter rules, and in some cases looser. Correct for that.

9 years agoCorrect case where the old version of method lookup was incorrectly matching,
Niko Matsakis [Fri, 17 Oct 2014 13:10:34 +0000 (09:10 -0400)]
Correct case where the old version of method lookup was incorrectly matching,
as far as I can tell.

9 years agoChange method lookup infrastructure to use the trait methods. Instead
Niko Matsakis [Fri, 17 Oct 2014 13:07:45 +0000 (09:07 -0400)]
Change method lookup infrastructure to use the trait methods. Instead
of tracking individual candidates per impl, we just track one
candidate for the extension trait itself, and let the trait resolution
handle walking the individual impls and so forth. Also change the
interface to report back a richer notion of error.

9 years agorustdoc: hide private traits in strip-private pass
Tom Jakubowski [Tue, 7 Oct 2014 15:36:55 +0000 (08:36 -0700)]
rustdoc: hide private traits in strip-private pass

Fix #16563

9 years agoGeneralize the replace-late-bound-regions function to operate
Niko Matsakis [Fri, 17 Oct 2014 12:56:27 +0000 (08:56 -0400)]
Generalize the replace-late-bound-regions function to operate
over anything that is foldable, not just fn signatures.

9 years agoPermit DST types to unify like other types.
Niko Matsakis [Fri, 17 Oct 2014 12:54:31 +0000 (08:54 -0400)]
Permit DST types to unify like other types.

Also:
1. stop eagerly coercing from `[T, ..n]` to `[T]` only do so if requested.
2. permit error to be interact more freely.

Fixes #17178.

9 years agoImplement "method matching". Similar to trait matching, but with the twist that we
Niko Matsakis [Fri, 17 Oct 2014 12:51:43 +0000 (08:51 -0400)]
Implement "method matching". Similar to trait matching, but with the twist that we
have to take the transformed self type into account, and allow for coercion between
the receiver and the actual type declared on the impl.

9 years agoPrune unused parameters.
Niko Matsakis [Fri, 19 Sep 2014 20:07:31 +0000 (16:07 -0400)]
Prune unused parameters.

9 years agoauto merge of #18201 : Gankro/rust/option-what, r=alexcrichton
bors [Tue, 21 Oct 2014 14:52:11 +0000 (14:52 +0000)]
auto merge of #18201 : Gankro/rust/option-what, r=alexcrichton

:whale:

9 years agoGuide: articulate the advantages of ownership over garbage collection.
John Kleint [Mon, 20 Oct 2014 00:49:10 +0000 (20:49 -0400)]
Guide: articulate the advantages of ownership over garbage collection.

Explain the primary disadvantage of garbage collection is runtime
overhead and unpredictable pauses.  Elucidate where the name "race
condition" comes from.  Emphasize that Rust can guarantee your code is
free of race conditions and other memory errors, with no runtime
overhead.

9 years agoauto merge of #17508 : vberger/rust/stability_lint_for_nested_macros, r=pnkfelix
bors [Tue, 21 Oct 2014 11:37:14 +0000 (11:37 +0000)]
auto merge of #17508 : vberger/rust/stability_lint_for_nested_macros, r=pnkfelix

Finishes the job of #17286.

Now the stability lint will successfully detect patterns such as:
```
first_macro!(second_macro!(deprecated_function()));
```
```
macro_rules! foo (
    ($e: expr) => (bar!($e))
)
foo!(deprected_function());
```
and
```
println!("{}", deprecated_function());
```
even with more levels of nesting, such as
```
println!("{}", foo!(bar!(deprecated_function())));
```

9 years agoauto merge of #18194 : jmesmon/rust/libbacktrace-env, r=alexcrichton
bors [Tue, 21 Oct 2014 08:22:09 +0000 (08:22 +0000)]
auto merge of #18194 : jmesmon/rust/libbacktrace-env, r=alexcrichton

This was run into while attempting to integrate rust with bitbake's build system. I expect it's caused by some other environment variables being set to gcc but didn't track down the exact cause myself.

9 years agoUse strlen in CString::len
Julian Orth [Tue, 21 Oct 2014 06:12:50 +0000 (08:12 +0200)]
Use strlen in CString::len

9 years agoFix crazy-pants match in Option docs
Alexis Beingessner [Tue, 21 Oct 2014 01:18:59 +0000 (21:18 -0400)]
Fix crazy-pants match in Option docs

9 years agoauto merge of #17555 : steveklabnik/rust/module_guide, r=alexcrichton
bors [Tue, 21 Oct 2014 00:07:33 +0000 (00:07 +0000)]
auto merge of #17555 : steveklabnik/rust/module_guide, r=alexcrichton

This is an almost-done draft of a guide on crates and modules. This is a hard guide to get right, I had to remove a chunk of the Guide because it was confusing.

I've also pushed up https://github.com/steveklabnik/phrases which has matching code. Whenever we finish this guide, I think it'd be good to have a sample crate like this in the rust-lang org for people to compare against. The hardest part of a guide like this is that it depends on multiple files being correct, and being able to point to a repository would be very helpful.

Things yet to do:

1. external crates via cargo
2. documentation

I'm super open to still revising this if it's still confusing. There's been a lot of Reddit discussion about the module system, and I tried to incorporate those posts and the comments into this.

9 years agoauto merge of #17453 : steveklabnik/rust/gh17340, r=alexcrichton
bors [Mon, 20 Oct 2014 22:17:49 +0000 (22:17 +0000)]
auto merge of #17453 : steveklabnik/rust/gh17340, r=alexcrichton

/cc @huonw

9 years agoStability lint checker now handles nested macros.
Victor Berger [Wed, 24 Sep 2014 09:14:19 +0000 (11:14 +0200)]
Stability lint checker now handles nested macros.

Closes #17185.

9 years agoNew Guide: crates and modules
Steve Klabnik [Fri, 26 Sep 2014 04:20:25 +0000 (00:20 -0400)]
New Guide: crates and modules

9 years agoauto merge of #18145 : neilpa/rust/master, r=steveklabnik
bors [Mon, 20 Oct 2014 20:27:32 +0000 (20:27 +0000)]
auto merge of #18145 : neilpa/rust/master, r=steveklabnik

Noticed a type while reading through the intro

9 years agoSome String Guide improvements.
Steve Klabnik [Mon, 22 Sep 2014 19:55:55 +0000 (15:55 -0400)]
Some String Guide improvements.

Fixes #17340

9 years agomk/rt: "export CC" does not seem to work (gcc observed), use explicit shell variables...
Cody P Schafer [Mon, 20 Oct 2014 18:04:45 +0000 (14:04 -0400)]
mk/rt: "export CC" does not seem to work (gcc observed), use explicit shell variables instead

9 years agoauto merge of #18186 : cakebaker/rust/fix_test_count, r=alexcrichton
bors [Mon, 20 Oct 2014 17:57:39 +0000 (17:57 +0000)]
auto merge of #18186 : cakebaker/rust/fix_test_count, r=alexcrichton

9 years agoauto merge of #18070 : alexcrichton/rust/spring-cleaning, r=aturon
bors [Mon, 20 Oct 2014 16:07:43 +0000 (16:07 +0000)]
auto merge of #18070 : alexcrichton/rust/spring-cleaning, r=aturon

This is a large spring-cleaning commit now that the 0.12.0 release has passed removing an amount of deprecated functionality. This removes a number of deprecated crates (all still available as cargo packages in the rust-lang organization) as well as a slew of deprecated functions. All `#[crate_id]` support has also been removed.

I tried to avoid anything that was recently deprecated, but I may have missed something! The major pain points of this commit is the fact that rustc/syntax have `#[allow(deprecated)]`, but I've removed that annotation so moving forward they should be cleaned up as we go.

9 years agoTest fixes and rebase conflicts
Alex Crichton [Sun, 19 Oct 2014 20:00:32 +0000 (13:00 -0700)]
Test fixes and rebase conflicts

9 years agoGuide: Fix test count
Daniel Hofstetter [Mon, 20 Oct 2014 14:17:59 +0000 (16:17 +0200)]
Guide: Fix test count

9 years agoauto merge of #18184 : cakebaker/rust/typo_in_path, r=steveklabnik
bors [Mon, 20 Oct 2014 14:17:10 +0000 (14:17 +0000)]
auto merge of #18184 : cakebaker/rust/typo_in_path, r=steveklabnik

9 years agoGuide: Fix typo in path
Daniel Hofstetter [Mon, 20 Oct 2014 13:26:09 +0000 (15:26 +0200)]
Guide: Fix typo in path

9 years agoauto merge of #18174 : huonw/rust/fix-sqrt, r=alexcrichton
bors [Mon, 20 Oct 2014 10:17:09 +0000 (10:17 +0000)]
auto merge of #18174 : huonw/rust/fix-sqrt, r=alexcrichton

Closes #9987.

9 years agoHandle negative numbers in `sqrt` properly.
Huon Wilson [Mon, 20 Oct 2014 00:39:01 +0000 (11:39 +1100)]
Handle negative numbers in `sqrt` properly.

Closes #9987.

9 years agoauto merge of #18108 : mahkoh/rust/buffered_reader, r=alexcrichton
bors [Mon, 20 Oct 2014 03:27:12 +0000 (03:27 +0000)]
auto merge of #18108 : mahkoh/rust/buffered_reader, r=alexcrichton

This optimizes `read` for the case in which the number of bytes
requested is larger than the internal buffer. Note that the first
comparison occurs again right afterwards and should thus be free. The
second comparison occurs only in the cold branch.

9 years agoOptimize BufferedReader::read for large buffers.
Julian Orth [Fri, 17 Oct 2014 00:48:29 +0000 (02:48 +0200)]
Optimize BufferedReader::read for large buffers.

This optimizes `read` for the case in which the number of bytes
requested is larger than the internal buffer. Note that the first
comparison occurs again right afterwards and should thus be free. The
second comparison occurs only in the cold branch.

9 years agoauto merge of #18160 : koshlo/rust/to-source-fix, r=alexcrichton
bors [Sun, 19 Oct 2014 23:32:07 +0000 (23:32 +0000)]
auto merge of #18160 : koshlo/rust/to-source-fix, r=alexcrichton

Fix for issue #18091

The problem seems to be that `ast_util::int_ty_to_string` takes unsigned number, and no one adds `-` to result string. I've fixed it by putting `-` before result string using `format!`.

I've also added `test_signed_int_to_string()` to check if implementation is valid.

9 years agoauto merge of #18142 : arielb1/rust/return-type-sized, r=eddyb
bors [Sun, 19 Oct 2014 21:42:05 +0000 (21:42 +0000)]
auto merge of #18142 : arielb1/rust/return-type-sized, r=eddyb

Fixes #18107

r? @eddyb

9 years agoEnsure that the return type of a function is Sized
Ariel Ben-Yehuda [Sat, 18 Oct 2014 20:12:02 +0000 (23:12 +0300)]
Ensure that the return type of a function is Sized

While no real rvalue of an unsized type can exist, a diverging function
can still "return" a value of such a type, which causes an ICE.

Fixes #18107.

9 years agoRemove a large amount of deprecated functionality
Alex Crichton [Wed, 15 Oct 2014 06:05:01 +0000 (23:05 -0700)]
Remove a large amount of deprecated functionality

Spring cleaning is here! In the Fall! This commit removes quite a large amount
of deprecated functionality from the standard libraries. I tried to ensure that
only old deprecated functionality was removed.

This is removing lots and lots of deprecated features, so this is a breaking
change. Please consult the deprecation messages of the deleted code to see how
to migrate code forward if it still needs migration.

[breaking-change]

9 years agoRemove a number of deprecated crates
Alex Crichton [Wed, 15 Oct 2014 04:57:50 +0000 (21:57 -0700)]
Remove a number of deprecated crates

All of these crates have been deprecated for some time and properly live in the
rust-lang organization as cargo-based crates.

To update your code, depend on the rust-lang/foo repository via cargo.

[breaking-change]

9 years agofix printing signed literal in print_literal
Aleksandr Koshlo [Sun, 19 Oct 2014 15:39:39 +0000 (18:39 +0300)]
fix printing signed literal in print_literal

9 years agoauto merge of #18139 : JelteF/rust-1/patch-1, r=steveklabnik
bors [Sun, 19 Oct 2014 13:52:06 +0000 (13:52 +0000)]
auto merge of #18139 : JelteF/rust-1/patch-1, r=steveklabnik

The explanation of fold talks about three elements that should be summed, but it uses different values in the provided code.

9 years agoauto merge of #18138 : rclanan/rust/mark-lt-partialord-inline, r=sfackler
bors [Sun, 19 Oct 2014 10:57:09 +0000 (10:57 +0000)]
auto merge of #18138 : rclanan/rust/mark-lt-partialord-inline, r=sfackler

Fixes issue #18090

9 years agoauto merge of #18136 : mprobinson/rust/example-warning, r=alexcrichton
bors [Sun, 19 Oct 2014 09:07:10 +0000 (09:07 +0000)]
auto merge of #18136 : mprobinson/rust/example-warning, r=alexcrichton

let mut value = mutex.lock();
warning: variable does not need to be mutable

9 years agoauto merge of #18135 : EduardoBautista/rust/fix-misaligned-carot, r=steveklabnik
bors [Sun, 19 Oct 2014 07:17:15 +0000 (07:17 +0000)]
auto merge of #18135 : EduardoBautista/rust/fix-misaligned-carot, r=steveklabnik

9 years agoauto merge of #18124 : pnkfelix/rust/fsk-add-check-of-borrow-local-static, r=thestinger
bors [Sun, 19 Oct 2014 05:12:14 +0000 (05:12 +0000)]
auto merge of #18124 : pnkfelix/rust/fsk-add-check-of-borrow-local-static, r=thestinger

Check for borrow of local variable introduced within static block.

(Rather than ICE on it.)

Fix #18118.

9 years agoauto merge of #18123 : dotdash/rust/llvm_memcpy, r=alexcrichton
bors [Sun, 19 Oct 2014 02:52:36 +0000 (02:52 +0000)]
auto merge of #18123 : dotdash/rust/llvm_memcpy, r=alexcrichton

9 years agoauto merge of #18120 : jrincayc/rust/match_exp, r=thestinger
bors [Sun, 19 Oct 2014 00:47:18 +0000 (00:47 +0000)]
auto merge of #18120 : jrincayc/rust/match_exp, r=thestinger

Use a match expression directly in the println statement, instead of creating a second variable.  It seems weird that the current guide.md complains about creating an extra variable, when the same feature could be demonstrated without creating the extra variable.

9 years ago[Docs] more intro typos
Neil Pankey [Sun, 19 Oct 2014 00:40:32 +0000 (17:40 -0700)]
[Docs] more intro typos

9 years ago[Docs] intro typo
Neil Pankey [Sat, 18 Oct 2014 23:15:38 +0000 (16:15 -0700)]
[Docs] intro typo

9 years agoauto merge of #18109 : bkoropoff/rust/issue-16939, r=aturon
bors [Sat, 18 Oct 2014 22:57:16 +0000 (22:57 +0000)]
auto merge of #18109 : bkoropoff/rust/issue-16939, r=aturon

Closes #16939

9 years agoauto merge of #18113 : bkoropoff/rust/issue-16739, r=alexcrichton
bors [Sat, 18 Oct 2014 21:02:17 +0000 (21:02 +0000)]
auto merge of #18113 : bkoropoff/rust/issue-16739, r=alexcrichton

When translating the unboxing shim, account for the fact that the shim translation has already performed the necessary unboxing of input types and values when forwarding to the shimmed function.  This prevents ICEing or generating incorrect code.

Closes #16739

9 years agoFix fold explanation in the guide
Jelte Fennema [Sat, 18 Oct 2014 17:29:53 +0000 (19:29 +0200)]
Fix fold explanation in the guide

The explanation of fold talks about three elements that should be summed, but it uses different values in the provided code.

9 years agoauto merge of #18041 : arielb1/rust/no-size-overflow, r=pnkfelix
bors [Sat, 18 Oct 2014 17:02:13 +0000 (17:02 +0000)]
auto merge of #18041 : arielb1/rust/no-size-overflow, r=pnkfelix

Should fix #17913.

Also clean-up u64/u32-ness. I really should split this commit and add tests (I have no idea how to add them).

9 years agotrailing whitespace
Ariel Ben-Yehuda [Sat, 18 Oct 2014 16:34:00 +0000 (19:34 +0300)]
trailing whitespace

9 years agoMark lt as inline in PartialOrd
Ray Clanan [Sat, 18 Oct 2014 15:49:33 +0000 (11:49 -0400)]
Mark lt as inline in PartialOrd

9 years agoauto merge of #18105 : nikomatsakis/rust/issue-18055, r=pcwalton
bors [Sat, 18 Oct 2014 15:12:11 +0000 (15:12 +0000)]
auto merge of #18105 : nikomatsakis/rust/issue-18055, r=pcwalton

Check object lifetime bounds in coercions, not just trait bounds.  Fixes #18055.

r? @pcwalton

This is a [breaking change]. Change code like this:

    fn foo(v: &[u8]) -> Box<Clone+'static> { ... }

to make the lifetimes agree:

    // either...
    fn foo(v: &'static[u8]) -> Box<Clone+'static> { box v }

    // or ...
    fn foo<'a>(v: &'a [u8]) -> Box<Clone+'a> { box v }

9 years agoParser: Fix spans of explicit self arg idents
Phil Dawes [Wed, 15 Oct 2014 17:04:29 +0000 (18:04 +0100)]
Parser: Fix spans of explicit self arg idents

9 years agoauto merge of #18099 : jakub-/rust/fixed-issues, r=alexcrichton
bors [Sat, 18 Oct 2014 13:22:11 +0000 (13:22 +0000)]
auto merge of #18099 : jakub-/rust/fixed-issues, r=alexcrichton

Closes #9249.
Closes #13105.
Closes #13837.
Closes #13847.
Closes #15207.
Closes #15261.
Closes #16048.
Closes #16098.
Closes #16256.
Closes #16562.
Closes #16596.
Closes #16709.
Closes #16747.
Closes #17025.
Closes #17121.
Closes #17450.
Closes #17636.

9 years agoauto merge of #18103 : pcwalton/rust/bitflags-inline, r=thestinger
bors [Sat, 18 Oct 2014 10:17:14 +0000 (10:17 +0000)]
auto merge of #18103 : pcwalton/rust/bitflags-inline, r=thestinger

Servo really wants this.

r? @nick29581