Commit Graph

63625 Commits

Author SHA1 Message Date
bors
7627e3d31d Auto merge of #40409 - mbrubeck:calloc, r=sfackler
Specialize Vec::from_elem to use calloc

Fixes #38723.  This specializes the implementation for `u8` only, but it could be extended to other zeroable types if desired.

I haven't tested this extensively, but I did verify that it gives the expected performance boost for large `vec![0; n]` allocations with both alloc_system and jemalloc, on Linux.  (I have not tested or even built the Windows code.)
2017-04-16 19:13:52 +00:00
bors
9af79f52d0 Auto merge of #41329 - nagisa:bitflags-repr-options, r=eddyb
Compress ReprOptions a little bit

r? @eddyb
2017-04-16 16:47:18 +00:00
Jeremy Soller
1bc9e5da23 Fix stdio descriptors in exec by removing cloexec if present. Use dup2 instead of dup 2017-04-16 09:33:32 -06:00
bors
fef1026bae Auto merge of #41308 - eddyb:order-must-be-preserved, r=nagisa
[rustbuild] Side-step HashMap iteration to preserve command-line step order.

The new `HashMap` was introduced by #41227 and it accidentally randomized step order.

r? @alexcrichton
2017-04-16 13:44:22 +00:00
Simonas Kazlauskas
fcbd898502 Compress ReprOptions a little bit 2017-04-16 16:17:13 +03:00
Eduard-Mihai Burtescu
cd64ff9438 rustc_typeck: fix binops needing more type informations to coerce. 2017-04-16 06:25:18 +03:00
Eduard-Mihai Burtescu
6dc21b71cf rustc: use monomorphic const_eval for cross-crate enum discriminants. 2017-04-16 01:31:37 +03:00
Eduard-Mihai Burtescu
63064ec190 rustc: expose monomorphic const_eval through on-demand. 2017-04-16 01:31:06 +03:00
Eduard-Mihai Burtescu
8854164d0c rustc_const_eval: move ConstEvalErr to the rustc crate. 2017-04-16 01:31:06 +03:00
bors
13fd5e93de Auto merge of #41320 - Mark-Simulacrum:cleanup-methodmatch, r=arielb1
Remove MethodMatchResult and MethodMatchedData.

These two enums were unused.

Fixes #41318.

r? @nikomatsakis
2017-04-15 22:15:53 +00:00
lukaramu
1afe77fb5f Cleaned up throughout std::path's docs
Part of #29368.
* added missing links
* updated method summaries to use 3rd person style
* added missing periods in `Component`'s variant summaries
* use standard iterator boilerplate in `Components`' and `Iter`'s docs
* added example to `Iter::as_path`, adapted from `Components::as_path`'s
  example
* consolidated examples for `Path::file_name`
* some other small fixes
2017-04-15 23:55:59 +02:00
Alex Burka
cfa51f226f satisfy completely useless tidy check 2017-04-15 21:39:19 +00:00
Eduard-Mihai Burtescu
3725cab5ac rustc_typeck: return InferOk from lookup_method_in_trait_adjusted. 2017-04-15 23:59:25 +03:00
Eduard-Mihai Burtescu
516570f2d6 rustc_typeck: move some obligation methods to Inherited. 2017-04-15 23:58:50 +03:00
Eduard-Mihai Burtescu
2ad196444b rustc_typeck: Autoderef::finalize is always called with one &hir::Expr. 2017-04-15 23:56:40 +03:00
Eduard-Mihai Burtescu
e56b119bac rustc_typeck: keep register_infer_ok_obligations calls out of snapshots. 2017-04-15 23:55:10 +03:00
Eduard-Mihai Burtescu
99f5c8593b rustc: ban registering obligations during InferCtxt snapshots. 2017-04-15 23:51:58 +03:00
bors
d5cf1cb64c Auto merge of #41319 - eddyb:demand-adt-sized-constraint, r=arielb1
rustc: provide adt_sized_constraint as an on-demand query.

By using `queries::adt_sized_constraint::try_get`, we can detect cycles without a separate stack.
r? @nikomatsakis
2017-04-15 19:44:17 +00:00
Alex Burka
51c8af5093 reduce macro rule duplication in test 2017-04-15 19:06:58 +00:00
Alex Burka
e0cd76674d feature gate :vis matcher 2017-04-15 19:06:58 +00:00
Alex Burka
1d46805057 document :vis in unstable book 2017-04-15 19:06:19 +00:00
Alex Burka
37459e13fc widen :vis follow set 2017-04-15 19:06:19 +00:00
Alex Burka
06d32335e8 move NtVis enum variant to stave off comment rot 2017-04-15 19:06:19 +00:00
Alex Burka
16010c2f50 parse interpolated visibility tokens 2017-04-15 19:06:19 +00:00
Alex Burka
06411c4769 update print_visibility for new pub(restricted) syntax 2017-04-15 19:06:19 +00:00
Alex Burka
d53e413e04 update :vis implementation to current rust 2017-04-15 19:06:19 +00:00
Daniel Keep
a2489495d9 Implementation of the vis macro matcher. 2017-04-15 19:06:19 +00:00
bors
516ca2598c Auto merge of #39881 - king6cong:sys, r=japaric
code format
2017-04-15 17:17:17 +00:00
Matt Brubeck
aad2062073 Specialize Vec::from_elem for other numeric types 2017-04-15 09:01:56 -07:00
Matt Brubeck
675475c4d3 Specialize Vec::from_elem<u8> to use calloc or memset
Fixes #38723.
2017-04-15 09:01:56 -07:00
bors
ae23e65eb8 Auto merge of #41321 - frewsxcv:rollup, r=frewsxcv
Rollup of 2 pull requests

- Successful merges: #41306, #41311
- Failed merges:
2017-04-15 14:42:22 +00:00
Corey Farwell
591f62e8ce Rollup merge of #41311 - tedsta:fuchsia_error_codes, r=eddyb
Update magenta error codes

Update magenta error codes to match recent changes here: https://github.com/fuchsia-mirror/magenta/blob/master/system/public/magenta/errors.h
2017-04-15 10:41:51 -04:00
Corey Farwell
e9bc2b2942 Rollup merge of #41306 - nateozem:support/docs-mir, r=frewsxcv
add 'mir' to rustc help menu and man doc

add 'mir' to '--emit' flag list for 'rustc'.
This is added because 'rustc' can now generate MIR (referencing to
"Teach rustc --emit=mir #39891").
2017-04-15 10:41:50 -04:00
Mark Simulacrum
f8f5282e5c Remove MethodMatchResult and MethodMatchedData.
These two enums were unused.
2017-04-15 07:23:56 -06:00
Eduard-Mihai Burtescu
2a17b84cbc rustc: provide adt_sized_constraint as an on-demand query. 2017-04-15 15:40:38 +03:00
bors
c67cf5fddc Auto merge of #41316 - suchithjn225:issue-41272, r=eddyb
Do not desugar if-let-else to match arm guards

Fixes #41272
Changed the desugaring code

**Before**
```rust
match <sub_expr> {
     <pat> => <body>,
     [_ if <else_opt_if_cond> => <else_opt_if_body>,]
     _ => [<else_opt> | ()]
}
```

**After**
```rust
match <sub_expr> {
    <pat> => <body>,
     _       => [<else_opt> | ()]
}
```
With this fix, it doesn't cause E0301
2017-04-15 12:13:27 +00:00
Suchith J N
5649b3796f Aesthetic issue. Corrected indentation 2017-04-15 17:40:54 +05:30
Suchith J N
6fc7d45d64 Fixed aesthetics of if let block 2017-04-15 17:35:30 +05:30
Suchith J N
65b04fa068 Fixed aesthetics and test 2017-04-15 17:21:53 +05:30
Suchith J N
4ac11becc2 [41272] - Fixed to conform to rust project style 2017-04-15 12:17:25 +05:30
bors
5f13a3b540 Auto merge of #41286 - lukaramu:std-collections-docs, r=frewsxcv
Various improvements in std::collections docs

The meat of this PR are:
* changes to (almost all?) iterator struct docs in std::collections such that they use the standard iterator boilerplate and state where they are created
* a bunch of added links (at least as much as possible given std::collections mostly being a facade and whatnot 😅)
* an example for `Bound`
* changed phrasing for some summary sentences to be less redundant as well as more consistant with others in the module

There also are various other fixes, e.g. removing parens from method names in the module docs, changing some imperatives to 3rd person, etc.

r? @steveklabnik
2017-04-15 04:46:27 +00:00
Suchith J N
65fafd9414 [41272] - code for desugaring iflet changed 2017-04-15 10:14:09 +05:30
king6cong
7c8ca80c81 code format 2017-04-15 11:43:35 +08:00
bors
be1a74e4d3 Auto merge of #41312 - frewsxcv:rollup, r=frewsxcv
Rollup of 2 pull requests

- Successful merges: #41125, #41309
- Failed merges:
2017-04-15 02:06:20 +00:00
Corey Farwell
3adcd1c37e Rollup merge of #41309 - frewsxcv:sg-implement-rfc-1268, r=nikomatsakis
Implement RFC 1268.

Rebased version of https://github.com/rust-lang/rust/pull/40097.

Tracking issue: https://github.com/rust-lang/rust/issues/29864.
2017-04-14 22:05:42 -04:00
Corey Farwell
3f79bdc0a9 Rollup merge of #41125 - lukaramu:std-hash-docs, r=frewsxcv
Improve std::hash docs

Fixes #29357.

For details on what exactly I've done, see the commit descriptions.

There are some things I'm not sure about, but would like to address before merging this so the issue can be closed; any feedback on these points would really be appriciated:
* [x] ~I didn't touch the module level docs at all. On the one hand, I think they could use a short overview over the module; on the other hand, the module really isn't that big and I don't know if I could really do anything beyond just duplicating the type's summaries...~
* [x] ~I feel like the module-level examples are quite long-winded and not to the point, but I couldn't really think of anything better. Any ideas?~
* [x] ~Should `Hasher` get an example for implementing it? There is one in the module documentation, but it only "implements" it via `unimplemented!` and I'm not sure what the value of that is.~
* [x] ~Should `Hasher`'s `write_{int}` methods get examples?~

If there's anything else you'd like to see in std::hash's docs, please let me know!

r? @rust-lang/docs
2017-04-14 22:05:41 -04:00
Corey Farwell
ae9f571cd1 Add Unstable Book entry for 'overlapping-marker-traits'. 2017-04-14 22:05:11 -04:00
Niko Matsakis
805704c346 update tests slightly 2017-04-14 22:05:11 -04:00
Sean Griffin
5a9c25b91e Name files what tidy wants them to be namd 2017-04-14 22:05:11 -04:00
Sean Griffin
adcdd605be Put overlapping impls behind feature gate, add tests
I've added some explicit tests that negative impls are allowed to
overlap, and also to make sure that the feature doesn't interfere with
specialization. I've not added an explicit test for positive overlapping
with negative, as that's already tested elsewhere.
2017-04-14 22:05:11 -04:00