about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2014-10-22auto merge of #18223 : nikomatsakis/rust/coherence-orphan-18222, r=pcwaltonbors-3/+42
Adjust orphan rules to consider all input types, not just self type. Fixes #18222. r? @pcwalton
2014-10-22auto merge of #18141 : phildawes/rust/master, r=brsonbors-3/+49
Hello! I noticed spans are wrong for the PatIdents of self args. (I use spans a lot in racer)
2014-10-22auto merge of #18213 : pcwalton/rust/pcg-default, r=aturonbors-1/+14
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-21Adjust orphan rules to consider all input types, not just self type.Niko Matsakis-3/+42
Fixes #18222.
2014-10-22auto merge of #18121 : ↵bors-864/+1464
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-21enable parallel codegen by defaultStuart Pernsteiner-1/+14
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-21Patch up broken error messagesNiko Matsakis-2/+3
2014-10-21auto merge of #18203 : mahkoh/rust/cstring, r=thestingerbors-9/+1
This is about 20x faster on my machine.
2014-10-21Address nits by @pcwaltonNiko Matsakis-9/+12
2014-10-21Coherence tests that seemed to be missing.Niko Matsakis-0/+72
2014-10-21Tests for method resolution in the face of various ambiguities or ↵Niko Matsakis-13/+204
non-ambiguities. These are mostly new tests though I also revamped (and renamed) some of the existing tests.
2014-10-21Various minor cases where errors are reported in slightly different ways.Niko Matsakis-12/+19
2014-10-21Test where the old infrastructure failed to detect the (applicable) impl of ↵Niko Matsakis-1/+3
`FnMut` for some reason.
2014-10-21The new method lookup mechanism typechecks calls against the method type ↵Niko Matsakis-19/+34
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-21Correct case where the old version of method lookup was incorrectly matching,Niko Matsakis-2/+2
as far as I can tell.
2014-10-21Change method lookup infrastructure to use the trait methods. InsteadNiko Matsakis-661/+640
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-21Generalize the replace-late-bound-regions function to operateNiko Matsakis-31/+35
over anything that is foldable, not just fn signatures.
2014-10-21Permit DST types to unify like other types.Niko Matsakis-45/+15
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-21Implement "method matching". Similar to trait matching, but with the twist ↵Niko Matsakis-50/+422
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-21Prune unused parameters.Niko Matsakis-30/+14
2014-10-21auto merge of #18201 : Gankro/rust/option-what, r=alexcrichtonbors-1/+1
:whale:
2014-10-21auto merge of #17508 : vberger/rust/stability_lint_for_nested_macros, r=pnkfelixbors-16/+23
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-21Use strlen in CString::lenJulian Orth-9/+1
2014-10-20Fix crazy-pants match in Option docsAlexis Beingessner-1/+1
2014-10-21auto merge of #17555 : steveklabnik/rust/module_guide, r=alexcrichtonbors-0/+569
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-20auto merge of #17453 : steveklabnik/rust/gh17340, r=alexcrichtonbors-22/+120
/cc @huonw
2014-10-20Stability lint checker now handles nested macros.Victor Berger-16/+23
Closes #17185.
2014-10-20New Guide: crates and modulesSteve Klabnik-0/+569
2014-10-20auto merge of #18145 : neilpa/rust/master, r=steveklabnikbors-9/+9
Noticed a type while reading through the intro
2014-10-20Some String Guide improvements.Steve Klabnik-22/+120
Fixes #17340
2014-10-20auto merge of #18186 : cakebaker/rust/fix_test_count, r=alexcrichtonbors-2/+2
2014-10-20auto merge of #18070 : alexcrichton/rust/spring-cleaning, r=aturonbors-12812/+1360
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.
2014-10-20Test fixes and rebase conflictsAlex Crichton-9/+9
2014-10-20Guide: Fix test countDaniel Hofstetter-2/+2
2014-10-20Guide: Fix typo in pathDaniel Hofstetter-4/+4
2014-10-20auto merge of #18174 : huonw/rust/fix-sqrt, r=alexcrichtonbors-3/+34
Closes #9987.
2014-10-20Handle negative numbers in `sqrt` properly.Huon Wilson-3/+34
Closes #9987.
2014-10-20auto merge of #18108 : mahkoh/rust/buffered_reader, r=alexcrichtonbors-2/+11
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.
2014-10-20Optimize BufferedReader::read for large buffers.Julian Orth-2/+11
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.
2014-10-19auto merge of #18160 : koshlo/rust/to-source-fix, r=alexcrichtonbors-1/+10
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.
2014-10-19Ensure that the return type of a function is SizedAriel Ben-Yehuda-14/+52
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.
2014-10-19Remove a large amount of deprecated functionalityAlex Crichton-4266/+1352
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]
2014-10-19Remove a number of deprecated cratesAlex Crichton-8538/+0
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]
2014-10-19fix printing signed literal in print_literalAleksandr Koshlo-1/+10
2014-10-19auto merge of #18139 : JelteF/rust-1/patch-1, r=steveklabnikbors-2/+2
The explanation of fold talks about three elements that should be summed, but it uses different values in the provided code.
2014-10-19auto merge of #18138 : rclanan/rust/mark-lt-partialord-inline, r=sfacklerbors-0/+1
Fixes issue #18090
2014-10-19auto merge of #18136 : mprobinson/rust/example-warning, r=alexcrichtonbors-1/+1
let mut value = mutex.lock(); warning: variable does not need to be mutable
2014-10-19auto merge of #18135 : EduardoBautista/rust/fix-misaligned-carot, r=steveklabnikbors-1/+1
2014-10-19auto merge of #18124 : pnkfelix/rust/fsk-add-check-of-borrow-local-static, ↵bors-2/+16
r=thestinger Check for borrow of local variable introduced within static block. (Rather than ICE on it.) Fix #18118.
2014-10-19auto merge of #18123 : dotdash/rust/llvm_memcpy, r=alexcrichtonbors-0/+0