Björn Steinbrink [Thu, 15 Jan 2015 15:59:51 +0000 (16:59 +0100)]
Avoid unnecessary closures when deriving RustcDecodable
Currently, we build a closure that does nothing but pass its argument
through to another function, this is rather wasteful and creates lots of
unnecessary closures.
bors [Thu, 15 Jan 2015 09:12:47 +0000 (09:12 +0000)]
auto merge of #20990 : estsauver/rust/playpen_20732, r=alexcrichton
In #20732, that all links in some modules point to the same code
examples was reported. The ID's generated for documents in
librustdoc are not all unique, which means the code rendered as
text is not being properly selected.
This change makes the link to the code section that is next to
the current link.
bors [Thu, 15 Jan 2015 05:12:30 +0000 (05:12 +0000)]
auto merge of #20980 : richo/rust/final-power, r=alexcrichton
Originally, this was going to be discussed and revisted, however I've been working on this for months, and a rebase on top of master was about 1 flight's worth of work so I just went ahead and did it.
This gets you as far as being able to target powerpc with, eg:
bors [Thu, 15 Jan 2015 01:42:25 +0000 (01:42 +0000)]
auto merge of #20290 : jroesch/rust/generalize-impl-bounds, r=nikomatsakis
This should fix both #20020 and #20107. This moves out the code into its own file.
I have a couple concerns that can either be addressed in this PR or in a future one.
- The error reporting for the fulfillment context should be span aware because currently it is attached to the top
of the file which is less then desirable.
- There is a failure in the test file: run-pass/issue-2611-3.rs, this seems like it should be a failure to me, but I am not sure.
As a nit I'm not enthused about the file name, and am open to better suggestions.
Jared Roesch [Wed, 14 Jan 2015 21:43:17 +0000 (13:43 -0800)]
Refactor compare_impl_method to use all bounds
Refactor compare_impl_method into its own file. Modify the
code to stop comparing individual parameter bounds.
Instead we now use the predicates list attached to the trait
and implementation generics. This ensures consistency even
when bounds are declared in different places (i.e on
a parameter vs. in a where clause).
Niko Matsakis [Tue, 13 Jan 2015 19:01:27 +0000 (14:01 -0500)]
Fix Repr output so that it does not ICE when a self-type is
absent. This occurs while printing object type projections for
debugging (note that the `UserString` impl is much more careful about
this).
Toni Cárdenas [Wed, 14 Jan 2015 14:24:41 +0000 (15:24 +0100)]
TRPL: Anti-example failing for the wrong reason.
Really small correction.
This anti-example in the Closures section is supposed to fail because of a borrow, but it was failing at the type inference because of insufficient type information.
Kevin Yap [Wed, 14 Jan 2015 04:15:09 +0000 (20:15 -0800)]
Improve Rust Documentation & Reference on mobile
- Tables that are too wide for the screen scroll horizontally.
- Inline code that would force the page to become wider than the width
of the screen is broken in the middle of the word.
Earl St Sauver [Mon, 12 Jan 2015 09:37:01 +0000 (01:37 -0800)]
Fix playpen links to not all be the same
Fixes #20732, that all links in some modules point to the same code
examples was reported. The ID's generated for documents in
librustdoc are not all unique, which means the code rendered as
text is not being properly selected.
This change removes the unique id generation and instead changes the
frontend code to grab the correct code sample by it's relative
position in the dom.
Huon Wilson [Tue, 13 Jan 2015 23:49:17 +0000 (10:49 +1100)]
Implement suggestions for traits to import.
For a call like `foo.bar()` where the method `bar` can't be resolved,
the compiler will search for traits that have methods with name `bar` to
give a more informative error, providing a list of possibilities.
Björn Steinbrink [Tue, 13 Jan 2015 21:30:49 +0000 (22:30 +0100)]
Prefer GEP instructions over weird pointer casting
There are two places left where we used to only know the byte
size of/offset into an array and had to cast to i8 and back to get the
right addresses. But by now, we always know the sizes in terms of the
number of elements in the array. In fact we have to add an extra Mul
instruction so we can use the weird cast-to-u8 code. So we should really
just embrace our new knowledge and use simple GEPs to do the address
calculations.
Additionally, the pointer calculations in bind_subslice_pat don't handle
zero-sized types correctly, producing slices that point outside the
array that is being matched against. Using GEP fixes that as well.
bors [Tue, 13 Jan 2015 19:11:47 +0000 (19:11 +0000)]
auto merge of #20367 : retep998/rust/master, r=alexcrichton
Also adjusted some of the FFI definitions because apparently they don't use the long pointer prefix.
Gives a free performance boost because `SRWLock` is several times faster than `CriticalRegion` on every Windows system tested.
Fixes #19962
graphviz-flowgraph tests: use new `--xpretty flowgraph,unlabelled` option.
This makes the tests much easier to maintain; the particular details
of the labels attached to exiting scopes is not worth the effort
required to keep it up to date as things change in the compiler
internals.
Travis Watkins [Sat, 3 Jan 2015 08:49:42 +0000 (02:49 -0600)]
Return passed value from black_box
By returning the passed value black_box can be used on data being
passed to a function being benchmarked. This ensures the compiler
does not optimize the function for the input which could result in
the entire function being optimized away.
Kevin Yap [Sun, 11 Jan 2015 23:41:59 +0000 (15:41 -0800)]
Various changes to Rust Introduction
- Make punctuation/formatting consistent with the changes made to "The
Rust Programming Language" in #20782.
- Use title casing for "Safety and Speed" section.
- Reword some phrases to improve clarity.
bors [Mon, 12 Jan 2015 19:20:56 +0000 (19:20 +0000)]
auto merge of #20894 : swgillespie/rust/emacs-issue-20422, r=pnkfelix
rust-mode.el recently started highlighting keywords that were substrings of identifiers. Identifiers such as `xyz_type` would have `type` highlighted, which isn't normal. This patch re-introduces `_` as a word constituent, so that keywords following a `_` don't get syntax highlighted as keywords. Fixes issue #20422