Commit Graph

48031 Commits

Author SHA1 Message Date
Kyle Mayes
8c88308c68 libsyntax: Add more quasiquoting macros 2015-11-11 15:19:01 -05:00
Manish Goregaokar
98b5285703 Rollup merge of #29777 - Manishearth:const_irrefutable_diag, r=eddyb
None
2015-11-12 00:59:31 +05:30
Manish Goregaokar
3ef3fd96cf Rollup merge of #29775 - arcnmx:raw-c_char, r=alexcrichton
It's a bit strange to expect users of `libstd` to require the use of an external crates.io crate to work with standard types. This commit encourages the use `os::raw::c_char` instead, although users are certainly free to use `libc::c_char` if they wish; the test still exists to ensure the two types are identical (though the reported bug only exists on platforms that are not officially tested).

Fixes #29774
2015-11-12 00:59:30 +05:30
Manish Goregaokar
f51e030433 Rollup merge of #29772 - banyan:fix-doc, r=steveklabnik 2015-11-12 00:59:30 +05:30
Manish Goregaokar
eda26b32f4 Rollup merge of #29677 - GuillaumeGomez:patch-3, r=Manishearth
r? @Manishearth
cc @AlisdairO

Part of #24407
2015-11-12 00:59:30 +05:30
arcnmx
f9f734748c Cleaner c_char cfg logic 2015-11-11 14:25:18 -05:00
Manish Goregaokar
9be0ba5cc0 Add test for constant pattern diagnostics 2015-11-12 00:48:02 +05:30
Manish Goregaokar
d8062a9317 Add more comprehensive diagnostics for irrefutable pattern error with constants
Fixes #7526
2015-11-12 00:46:57 +05:30
arcnmx
fc60b2c73e Prefer raw::c_char or libc::c_char and fix arm 2015-11-11 12:02:55 -05:00
bors
f1f5c04c07 Auto merge of #29763 - nikomatsakis:mir-29227, r=nikomatsakis
The older algorithm was pretty inefficient for big matches. Fixes #29227. (On my computer, MIR construction on this test case goes from 9.9s to 0.025s.) Whereas before we had a loop like:

- for all outcomes of the test we are performing
    - for all candidates
        - check whether candidate is relevant to outcome

We now do:

- for all candidates
    - determine which outcomes the candidate is relevant to

Since the number of outcomes in this case is proportional to the number of candidates, the original algorithm turned out to be O(n^2), and the newer one is just O(n).

This PR also does some minor speedups by eagerly mirroring all patterns, so that we can just pass around `&Pattern<'tcx>`, which makes cloning cheaper. We could probably go a bit further in this direction.

r? @Aatch
2015-11-11 16:50:48 +00:00
Kohei Hasegawa
44fd0b91fb docs: Fix variable name 2015-11-12 00:47:42 +09:00
Oliver Middleton
4879078f2e Allow none Sized types in assert_eq!
format_args! doesn't support none Sized types so we should just pass it the references to left_val and right_val.

This fixes `assert_eq!([1, 2, 3][..], vec![1, 2, 3][..])` for example.
2015-11-11 14:25:08 +00:00
bors
8c743a95d7 Auto merge of #29650 - goyox86:goyox86/rustfmting-librustc_driverII, r=nikomatsakis
Hi Rustaceans!

This is the secong take on running latest rustfmt on librustc_driver!

All fixups made in https://github.com/rust-lang/rust/pull/29033 were done (also rustfmt got better).

//cc @nrc
2015-11-11 14:14:23 +00:00
Niko Matsakis
38cf175784 Ignore long lines on this test. 2015-11-11 09:02:24 -05:00
Niko Matsakis
3b903a7d10 Change from &mut Vec<Vec<_>> to &mut [Vec<_>], since the outer
`Vec` should not be resized.
2015-11-11 06:18:50 -05:00
bors
7d3477ce09 Auto merge of #29755 - mbrubeck:stat-doc, r=steveklabnik
Moved from #29753. r? @steveklabnik
2015-11-11 11:09:43 +00:00
bors
19bdf87e8c Auto merge of #29741 - Manishearth:fix-flowgraph, r=alexcrichton
None
2015-11-11 09:15:24 +00:00
bors
8fbd2923f1 Auto merge of #29752 - tamird:fix-compiletest-stage1, r=alexcrichton
Fixes #29751.
2015-11-11 07:29:54 +00:00
bors
b53020a5f4 Auto merge of #29744 - sanxiyn:modernize, r=nrc 2015-11-11 05:47:13 +00:00
bors
7e82b39768 Auto merge of #29738 - sanxiyn:suggest-mut, r=nrc
Fix #16410.
2015-11-11 04:04:31 +00:00
Niko Matsakis
f0276129c4 Add regression test for #29227. 2015-11-10 22:19:17 -05:00
Niko Matsakis
0471b3247d Reorganize match construction to be O(n) instead of O(n^2). Whereas
before we iterated over the test and each outcome thereof, and then
checked processed every candidate against this outcome, we now organize
the walk differently. Instead, we visit each candidate and say "Here is
the test being performed. Figure out the resulting candidates for each
possible outcome and add yourself into the appropriate places."
2015-11-10 22:18:06 -05:00
Niko Matsakis
61884e5543 Clone the candidates and match-pairs lazilly, instead of eagerly. 2015-11-10 22:18:06 -05:00
Niko Matsakis
87358728a4 Remove the mirroring for patterns and just convert them eagerly; then,
pass around references instead of boxed values to save on clone costs.
2015-11-10 22:18:06 -05:00
bors
dbb78549aa Auto merge of #29727 - alexcrichton:debug-unused-result, r=sfackler
This should help avoid triggering the unused_results lint which can frequently
be turned on.

Closes #29710
2015-11-11 02:08:08 +00:00
bors
ad3bd1b46d Auto merge of #29726 - petrochenkov:privsan, r=alexcrichton
- Check privacy sanity in all blocks, not only function bodies
- Check all fields, not only named
- Check all impl items, not only methods
- Check default impls
- Move the sanity check in the beginning of privacy checking, so others could rely on it

Technically it's a [breaking-change], but I expect no breakage because, well, it's *sane* privacy visitor, if code is broken it must be insane by definition!
2015-11-11 00:25:08 +00:00
bors
5f64201ee4 Auto merge of #29725 - aturon:lang-features, r=huonw
This commit adds issue numbers to the vast majority of active feature
gates. The few that are left without issues are rustc/runtime-internal
features that are essentially private APIs.

Closes #28244

r? @huonw
2015-11-10 22:41:49 +00:00
Simonas Kazlauskas
db89a75a80 use Constant for repetition count in mir::Repeat 2015-11-10 23:52:23 +02:00
bors
3519effc6e Auto merge of #29724 - alexcrichton:ip-endian, r=aturon
The comparison of IP addresses should happen not always in network endianness
but rather in the host endianness format, so be sure to convert to that before
comparing addresses.

There are still locations where the endianness will factor into visible
properties, such as the hash, but these are not important to be independent of
the endianness in play (as hash values are pretty undefined anyway.

Closes #29691
2015-11-10 20:58:51 +00:00
Jose Narvaez
4f050bf04a Manual fixups. 2015-11-10 20:49:12 +00:00
Jose Narvaez
4e64645228 Rustfmting librustc_driver. 2015-11-10 20:48:44 +00:00
Matt Brubeck
adbd38d85b [docs] Update references to renamed fs::stat function 2015-11-10 11:17:26 -08:00
bors
d668fab0ef Auto merge of #29714 - petrochenkov:strparse, r=nrc
In particular, attributes are now parsed on fields of tuple variants
2015-11-10 19:15:08 +00:00
bors
ea422eb4de Auto merge of #29749 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #29420, #29688, #29708, #29715, #29729, #29731
- Failed merges: #29544
2015-11-10 17:30:50 +00:00
Tamir Duberstein
f5e9a4ae15 compiletest/raise_fd_limit: use libc instead of custom impl
Fixes #29751.
2015-11-10 12:27:55 -05:00
Steve Klabnik
4b0503f10f Rollup merge of #29731 - steveklabnik:smallfix, r=alexcrichton
* wrap to 80 cols
* small grammar fix, missing 'the'
2015-11-10 10:51:48 -05:00
Steve Klabnik
af1cb3090d Rollup merge of #29729 - brson:readme2, r=steveklabnik
r? @steveklabnik

This completely abdicates any responsibility to explain what Rust is, instead linking to the website.

My main motivation is that I am still not happy with it, and every time I try to fix it I just write a slightly longer sales pitch than what's on the website.

One thing this paragraph could do is direct people to more information about what is in the repo, or more technical information about the implementation.
2015-11-10 10:51:48 -05:00
Steve Klabnik
d64195f365 Rollup merge of #29715 - defuz:patch-3, r=alexcrichton
r? @steveklabnik

See #27305
2015-11-10 10:51:48 -05:00
Steve Klabnik
a39daf95f3 Rollup merge of #29708 - Ryman:pathdoc, r=steveklabnik
r? @steveklabnik
2015-11-10 10:51:48 -05:00
Steve Klabnik
0d04a51517 Rollup merge of #29688 - stepancheg:vec-outdated, r=nikomatsakis
Since commit 46068c9da, call to `reserve()` on empty vec allocates
exactly requested capacity, so unroll of first iteration may help only
with branch prediction.
2015-11-10 10:51:47 -05:00
Steve Klabnik
fb2ae896bb Rollup merge of #29420 - efindlay:master, r=steveklabnik
r? @steveklabnik
2015-11-10 10:51:47 -05:00
bors
05b66b8a1c Auto merge of #29705 - Ryman:mismatched_typaram_counts, r=alexcrichton
…type-params for methods
2015-11-10 15:48:00 +00:00
Toby Scrace
5e68056b13 Add examples to methods on integer types 2015-11-10 13:19:52 +00:00
bors
e9aa32ac72 Auto merge of #29697 - dotdash:mir_trans_switchint, r=nikomatsakis 2015-11-10 13:17:15 +00:00
Seo Sanghyeon
dfc314d19b Use lifetime elision 2015-11-10 20:42:00 +09:00
bors
4afa9d9003 Auto merge of #29699 - tamird:valgrind-supp, r=alexcrichton
Quite a bit of cruft in the valgrind suppressions. I started from a clean slate and found a few unique failures; this commit also moves the tests "fixed" by these suppressions into run-pass-valgrind.
2015-11-10 11:34:13 +00:00
Seo Sanghyeon
791003ad3c Use deref coercions 2015-11-10 20:16:28 +09:00
Vadim Petrochenkov
41ccd44f76 Use exhaustive matching 2015-11-10 12:51:56 +03:00
Manish Goregaokar
0c327a7859 Fix help text for flowgraph debug options 2015-11-10 14:49:36 +05:30
bors
4b23a0962d Auto merge of #29647 - goyox86:goyox86/rustfmting-librustc_frontII, r=nrc
Hi Rustaceans!

This is the second take  on running latest rustfmt on librustc_front!

This is the same in https://github.com/rust-lang/rust/pull/29075 but cleaned. All fixups have been applied.

//cc @nrc
2015-11-10 08:38:52 +00:00