Commit Graph

32021 Commits

Author SHA1 Message Date
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
Tshepang Lekhonkhobe
3e94401a64 doc: move misplaced comma
Also:

* Remove unseeming repetition.
* By now, the reader has already heard that Rust is safe by default, so
reduce the overlong sentence, making it easier to read.
2014-08-24 04:24:25 +02:00
Tshepang Lekhonkhobe
6d2fe2e885 doc: add missing word 2014-08-24 04:03:51 +02: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
Björn Steinbrink
bbc66332fe Enable the MergeFunc pass
Fixes #9536
2014-08-24 01:08:58 +02: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
Vadim Chugunov
77e39b0560 Log linker stderr and stdout. 2014-08-23 14:38:41 -07: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
wickerwaka
c0e003d5ad extern crate foobar as foo;
Implements remaining part of RFC #47.
Addresses issue #16461.

Removed link_attrs from rust.md, they don't appear to be supported by
the parser.

Changed all the tests to use the new extern crate syntax

Change pretty printer to use 'as' syntax
2014-08-23 12:16:04 -07: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
Jimmie Elvenmark
673c555443 librustc: Don't ICE with type when name only contain underscores. 2014-08-23 16:03:28 +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
594371bb67 auto merge of #16658 : jauhien/rust/fix-llvm, r=thestinger
Upstream LLVM from VCS already has version 3.6,
configure fixed appropriately to allow building with it
2014-08-22 22:10:47 +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
P1start
fde41a3f70 Add support for trailing commas in more places
This lets the parser understand trailing commas in method calls, method
definitions, enum variants, and type parameters.

Closes #14240.
Closes #15887.
2014-08-23 07:23:51 +12: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
klutzy
a3d77e616b configure: Recognize i686 build on msys2 2014-08-23 01:47:37 +09: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