Commit Graph

33356 Commits

Author SHA1 Message Date
Steve Klabnik 0c3ad8be5b build the crates guide 2014-10-23 07:40:29 -04:00
bors 8a40854660 auto merge of #17868 : nick29581/rust/valgrind, r=alexcrichton
r? @alexcrichton
2014-10-23 05:27:11 +00:00
Nick Cameron 80ff1d1a10 Error if we should be able to Valgrind but can't 2014-10-23 14:28:52 +13:00
Nick Cameron 1285d4f467 Remove support for .rc files from test.mk 2014-10-23 13:52:35 +13:00
Nick Cameron c562b5bd9d Make rpass-valgrind work with pretty 2014-10-23 13:52:34 +13:00
Nick Cameron edc5275563 Move some tests to run-pass-valgrind 2014-10-23 13:52:34 +13:00
Nick Cameron f466e1a59f Add run-pass-valgrind tests
Closes #16914
2014-10-23 13:52:34 +13:00
bors 96991e9335 auto merge of #18224 : nikomatsakis/rust/issue-17594, r=alexcrichton
Add test for issue #17594

Fixes #17594
2014-10-22 23:57:11 +00:00
bors 7d7e409839 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!
😹
2014-10-22 21:32:16 +00:00
bors 9f0c29af02 auto merge of #17846 : tomjakubowski/rust/rustdoc-hide-private-traits, r=alexcrichton
Fix #16563
2014-10-22 16:47:14 +00:00
bors 1d647564b1 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.
2014-10-22 14:32:11 +00:00
Daniel Hofstetter 88cf0b92dd Guide: Adapt range values to variable name 2014-10-22 15:32:28 +02:00
bors d44ea720fa 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
2014-10-22 09:22:09 +00:00
Michael Woerister 423dca7fc6 debuginfo: Print more output in lldb_batchmode.py for better error logs. 2014-10-22 11:08:21 +02:00
Michael Woerister 7fadda6e7e debuginfo: Let LLDB tests run in parallel again since our min-supported version has no problems with that. 2014-10-22 10:47:46 +02:00
Michael Woerister 93bd605c58 debuginfo: Enable LLDB test suite on Darwin. 2014-10-22 10:47:45 +02:00
Michael Woerister dbf0167de9 debuginfo: Make some path LLDB-related paths in the test runner absolute to help the build bots. 2014-10-22 10:47:45 +02:00
Michael Woerister 47e8cf7697 debuginfo: Gate all LLDB debuginfo tests on a minimum LLDB version being available 2014-10-22 10:47:45 +02:00
bors 7088c45ef4 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)
2014-10-22 07:07:09 +00:00
bors c29a7520e7 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
2014-10-22 04:42:11 +00:00
Niko Matsakis 7b021859a4 Add test for issue #17594 2014-10-21 23:58:09 -04:00
Niko Matsakis aeba2ccf30 Adjust orphan rules to consider all input types, not just self type.
Fixes #18222.
2014-10-21 23:52:00 -04:00
bors 3d2cf60631 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
2014-10-22 00:22:04 +00:00
Stuart Pernsteiner c245c5bbad 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.
2014-10-21 14:46:16 -07:00
Niko Matsakis b066d09be8 Patch up broken error messages 2014-10-21 17:36:15 -04:00
bors 2130f22216 auto merge of #18203 : mahkoh/rust/cstring, r=thestinger
This is about 20x faster on my machine.
2014-10-21 19:32:10 +00:00
Niko Matsakis 646ec7d9a9 Address nits by @pcwalton 2014-10-21 12:32:37 -04:00
Niko Matsakis 53ede4403b Coherence tests that seemed to be missing. 2014-10-21 12:32:37 -04:00
Niko Matsakis 450263de4a 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.
2014-10-21 12:32:36 -04:00
Niko Matsakis e09fc03701 Various minor cases where errors are reported in slightly different ways. 2014-10-21 12:32:36 -04:00
Niko Matsakis 7f8ca53669 Test where the old infrastructure failed to detect the (applicable) impl of `FnMut` for
some reason.
2014-10-21 12:32:36 -04:00
Niko Matsakis df714cfda7 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. 2014-10-21 12:32:36 -04:00
Niko Matsakis 98e237a681 Correct case where the old version of method lookup was incorrectly matching,
as far as I can tell.
2014-10-21 12:32:36 -04:00
Niko Matsakis dad2db7c83 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.
2014-10-21 12:32:36 -04:00
Tom Jakubowski 370c9c54c2 rustdoc: hide private traits in strip-private pass
Fix #16563
2014-10-21 08:49:43 -07:00
Niko Matsakis 1562d8cbd8 Generalize the replace-late-bound-regions function to operate
over anything that is foldable, not just fn signatures.
2014-10-21 11:49:38 -04:00
Niko Matsakis 5c505b75b1 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.
2014-10-21 11:49:38 -04:00
Niko Matsakis e6a1936d26 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.
2014-10-21 11:49:38 -04:00
Niko Matsakis 04386f4217 Prune unused parameters. 2014-10-21 11:49:37 -04:00
bors 4764c16011 auto merge of #18201 : Gankro/rust/option-what, r=alexcrichton
🐳
2014-10-21 14:52:11 +00:00
bors b69cd73b7b 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())));
```
2014-10-21 11:37:14 +00:00
bors e8cc3f26ec 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.
2014-10-21 08:22:09 +00:00
Julian Orth 4765bb9cb8 Use strlen in CString::len 2014-10-21 08:12:50 +02:00
Alexis Beingessner 01e8ad6c38 Fix crazy-pants match in Option docs 2014-10-20 21:18:59 -04:00
bors 2fffbe0663 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.
2014-10-21 00:07:33 +00:00
bors 6ef8392b3f auto merge of #17453 : steveklabnik/rust/gh17340, r=alexcrichton
/cc @huonw
2014-10-20 22:17:49 +00:00
Victor Berger dd55c8003c Stability lint checker now handles nested macros.
Closes #17185.
2014-10-20 23:48:29 +02:00
Steve Klabnik 8851ec647a New Guide: crates and modules 2014-10-20 17:29:57 -04:00
bors b2e5773655 auto merge of #18145 : neilpa/rust/master, r=steveklabnik
Noticed a type while reading through the intro
2014-10-20 20:27:32 +00:00
Steve Klabnik f358407dcf Some String Guide improvements.
Fixes #17340
2014-10-20 16:25:35 -04:00