Commit Graph

28486 Commits

Author SHA1 Message Date
Tshepang Lekhonkhobe
2d723237db doc: use the more convenient 'cargo run' command
This lovely command has already been introduced, so let's take advantage
of it.
2014-08-24 12:21:41 +02:00
bors
16d538cba0 auto merge of #16706 : pnkfelix/rust/fsk-fix-nojem-realloc, r=thestinger
Copy only up to `min(new_size, old_size)` when doing reallocate.

This was a bug when running with jemalloc disabled.

Fix #16687
2014-08-24 07:45:59 +00:00
bors
c556ca9853 auto merge of #16703 : bluss/rust/assert-bloat, r=huonw
With no custom message, we should just use concat! + stringify! for
`assert!(expr)` to avoid the string formatting code path.

Inspired by issue #16625
2014-08-24 06:00:58 +00:00
bors
d0c314205c auto merge of #16698 : bluss/rust/slice-bloat, r=huonw
These are somewhat stop-gap solutions to address #16625 

core: Separate failure formatting in str methods slice, slice_to, slice_from

Use a separate inline-never function to format failure message for
str::slice() errors.

Using strcat's idea, this makes sure no formatting code from failure is
inlined when str::slice() is inlined. The number of `unreachable` being
inlined when usingi `.slice()` drops from 5 to just 1.



The testcase:

```
#![crate_type = "lib"]
pub fn slice(x: &str, a: uint, b: uint) -> &str {
    x.slice(a, b)
}
```

shrinks from 16.9 kB to 3.3 kB llvm IR, and the number of `unreachable` drops from 5 to 1.
2014-08-24 03:10:59 +00:00
bors
904d88c2be auto merge of #16697 : Sawyer47/rust/new-test, r=huonw
Closes #10618
Closes #16382
2014-08-24 01:25:57 +00:00
bors
36131f5be4 auto merge of #16691 : klutzy/rust/issue-15297, r=alexcrichton
First commit fixes issue regarding recognizing MSYS2 build.
Second commit fixes issue regarding MSYS/Windows paths.
2014-08-23 22:35:56 +00:00
bors
1153ad3239 auto merge of #16670 : Swatinem/rust/charascii, r=alexcrichton
I was doing a lot of parsing ascii strings, and the generic bsearch functions in `tables.rs` came up very high in the profile.
This should avoid calling those functions for simple ASCII range chars.
2014-08-23 20:50:57 +00:00
bors
03fd90be45 auto merge of #16612 : nham/rust/twoway_searcher_fix, r=alexcrichton
There is a check in TwoWaySearcher::new to determine whether the needle is periodic. This is needed because during searching when a match fails, we cannot advance the position by the entire length of the needle when it is periodic, but can only advance by the length of the period.

The reason "bananas".contains("nana") (and similar searches) were returning false was because the periodicity check was wrong.

Closes #16589

Also, thanks to @Gankro, who came up with many buggy examples.
2014-08-23 18:00:59 +00:00
Felix S. Klock II
b1f7d3aaa0 Copy only up to min(new_size, old_size) when doing reallocate.
Fix #16687
2014-08-23 19:23:02 +02:00
Felix S. Klock II
b0b48511da Test case to illustate/reproduce bug. 2014-08-23 19:23:02 +02:00
bors
3e3209ab4a auto merge of #16268 : cakebaker/rust/make_fn_add_three_times_four_public, r=steveklabnik
To avoid a compilation error when running the tests the function has to be public.
2014-08-23 16:15:58 +00:00
bors
6843d8ccd5 auto merge of #16693 : vadimcn/rust/rename--win32, r=pcwalton 2014-08-23 14:30:57 +00:00
root
262d5a4686 std: Use concat! and stringify! to simplify the most common assert! case.
With no custom message, we should just use concat! + stringify! for
`assert!(expr)`.

Inspired by issue #16625
2014-08-23 16:30:44 +02:00
Daniel Hofstetter
1777047a54 Guide: Make add_three_times_four() public 2014-08-23 15:06:29 +02:00
root
b3b7c2e97b core: Separate failure formatting in str methods slice, slice_to, slice_from
Use a separate inline-never function to format failure message for
str::slice() errors.

Using strcat's idea, this makes sure no formatting code from failure is
inlined when str::slice() is inlined. The number of `unreachable` being
inlined when usingi `.slice()` drops from 5 to just 1.
2014-08-23 13:49:19 +02:00
Arpad Borsos
cb29492e77 libunicode: optimize char functions for ascii characters 2014-08-23 13:22:26 +02:00
Piotr Jawniak
ed18baeb49 Add test for #10618 and #16382
Closes #10618
Closes #16382
2014-08-23 12:31:48 +02:00
bors
f66fd2eed1 auto merge of #16692 : vadimcn/rust/fix-win64, r=luqmana
This fixes fallout from 2dc2ac1e6b, which did not take into account win64.
2014-08-23 09:55:52 +00:00
Vadim Chugunov
68811817f7 Complete renaming of win32 to windows 2014-08-23 02:11:28 -07:00
Vadim Chugunov
8c994a1237 Remove stage0 attributes. 2014-08-23 02:11:07 -07:00
Vadim Chugunov
119f8b4694 Fix intptr_t on win64 2014-08-23 02:09:02 -07:00
bors
a284240783 auto merge of #16675 : luqmana/rust/pmu, r=alexcrichton
Fixes #16671.
2014-08-23 08:10:47 +00:00
Luqman Aden
f6dfff29ac Add tests. 2014-08-23 01:03:34 -07:00
klutzy
7eb35bc2a9 test: Convert Window path to MSYS path
When MSYS shell executes program, if its arguments look like MSYS paths,
MSYS automatically converts them into Windows paths.
For example, `/c/path:/d/path` becomes `C:\path;D:\path`.
However, if there is only one path e.g. `/c/path`, it becomes `C:/path`.

maketest.py reverts the behavior to reduce confusion between MSYS and
Windows, but it didn't handle the `/c/path` case. This patch fixes the
issue.

Fixes #15297
Fixes #15250
2014-08-23 16:19:07 +09:00
nham
9a43492f59 Improve TwoWaySearcher comments. 2014-08-22 22:34:14 -04:00
bors
2e5aea65cd auto merge of #16667 : retep998/rust/master, r=pcwalton 2014-08-23 01:40:48 +00:00
bors
75396b2a06 auto merge of #16663 : Gankro/rust/heapify, r=alexcrichton
Heapify is O(n), extend as currently implemented is O(nlogn). No brainer.

Currently investigating whether extend can just be implemented as a local heapify.
2014-08-22 23:55:50 +00:00
bors
d0104d04fd auto merge of #16659 : brson/rust/slowparse, r=alexcrichton
Note that this contains a 9.5MB test file, but it should compress thoroughly.
2014-08-22 20:25:49 +00:00
Luqman Aden
30ab05aeb5 librustc: Properly tag upvars in proc's to stop misleading unused_mut warnings. 2014-08-22 10:18:22 -07:00
bors
58bb603ea7 auto merge of #16651 : vks/rust/fix-bitv-bench, r=alexcrichton
Fixes #12118.

(I sneaked in an unrelated one-character whitespace fix I spotted while reviewing some benchmarks, if that is not okay, I can create a separate pull request for that.)
2014-08-22 17:05:48 +00:00
bors
36789fbbc5 auto merge of #16656 : luqmana/rust/ucmla, r=pcwalton
Gets rid of a FIXME in `base::get_fn_llvm_attributes`.

r? @pcwalton
2014-08-22 15:20:48 +00:00
bors
c9cf3b3cc4 auto merge of #16655 : pcwalton/rust/unboxed-closures-unboxing-shims, r=luqmana
Closes #16591.

r? @luqmana
2014-08-22 13:35:51 +00:00
bors
b9326ca91c auto merge of #16653 : steveklabnik/rust/module_wording, r=alexcrichton
@kimundi was a bit worried this was misleading.
2014-08-22 11:50:58 +00:00
bors
19a44c73c2 auto merge of #16647 : vhbit/rust/ios-build-fixes, r=alexcrichton 2014-08-22 09:05:53 +00:00
bors
5fe5e3947b auto merge of #16639 : pcwalton/rust/unboxed-closures-param-resolution, r=nick29581
Closes #16508.

r? @nick29581
2014-08-22 06:50:56 +00:00
Peter Atashian
be8bd24e31 win64: Add missing #[repr(C)]
Signed-off-by: Peter Atashian <retep998@gmail.com>
2014-08-22 00:53:11 -04:00
bors
47b9a6fb41 auto merge of #16616 : pcwalton/rust/unboxed-closure-where-clause, r=nikomatsakis
signatures.

Closes #16549.
Closes #16564.

r? @pnkfelix
2014-08-22 04:25:56 +00:00
bors
07d86b46a9 auto merge of #16509 : luqmana/rust/uw, r=alexcrichton
Fixes #15401.
2014-08-22 02:40:56 +00:00
Patrick Walton
24a2137269 librustc: Consider where clauses when traversing free regions in
signatures.

Closes #16549.
Closes #16564.
2014-08-21 19:33:29 -07:00
bors
711d710278 auto merge of #16512 : wickerwaka/rust/getopt-16348, r=brson
I don't know if anything else was relying on the old behavior, this seems more correct.

Fixes #16348

If '-F' is allowed to have an optional argument, with the previous version '-FF' would be translated to '-F -F'. In this new version '-FF' translates to '-F' with argument 'F'
2014-08-22 00:56:00 +00:00
Alexis Beingessner
b8dc103a95 make priorityqueue's from_iter use heapify 2014-08-21 20:17:45 -04:00
Brian Anderson
f59cfd9711 Use only 400000 characters to test slow string parsing. 2014-08-21 16:25:04 -07:00
Brian Anderson
a614f2820f syntax: Test parsing of long binary strings 2014-08-21 16:23:02 -07:00
bors
b43596b43e auto merge of #16637 : pcwalton/rust/unboxed-closures-expected-tuple, r=pnkfelix
code wasn't considering the zero-argument case.

Closes #16168.

r? @pnkfelix
2014-08-21 23:10:59 +00:00
Brian Anderson
bc7a85de29 syntax: Fix complexity of string parsing. Closes #16624. 2014-08-21 15:47:39 -07:00
bors
da796ededa auto merge of #16635 : steveklabnik/rust/ordering_comment, r=huonw
This way people won't try to copy/paste it in.

This is provided as an alternate solution to #16003. What do you think, @treeman?
2014-08-21 21:25:56 +00:00
bors
c509f79f05 auto merge of #16601 : cybergeek94/rust/master, r=alexcrichton
Previously, `PrettyEncoder` indented a magic constant of 2 spaces per level, which may be fine for most uses but in my use case I would like to allow the user to specify the indent step for the outputted JSON in my program.

This is small change that does not break any existing code whatsoever, and does not change the behavior of existing uses. `PrettyEncoder::new()` still uses the default of 2.

I couldn't think of any simple tests for this change. The obvious one would be to check the outputted JSON for the correct number of spaces per indent level, but I think that would be more complex than the actual change itself and test little besides correctness and consistency, which can be verified visually. There's already a test for correct parsing of pretty-printed JSON that should still pass with this change.
2014-08-21 19:40:57 +00:00
Luqman Aden
171c542965 librustc: Mark unboxed closure calls and definitions with appropriate llvm return/argument attributes. 2014-08-21 11:25:47 -07:00
Austin Bonander
1028120c40 Parameterize indent in PrettyEncoder 2014-08-21 11:04:03 -07:00
bors
f92015f71b auto merge of #16499 : cmr/rust/struct-undef-repr, r=pcwalton
r? @pcwalton
2014-08-21 17:30:57 +00:00