Commit Graph

54249 Commits

Author SHA1 Message Date
bors
3ee3267af3 Auto merge of #33976 - komamitsu:assert_eq_with_msg, r=alexcrichton
Add custom message parameter to `assert_eq!`

`assert!` macro accepts a custom message parameter and it's sometimes useful. But `assert_eq!` doesn't have it and users need to use `assert!` instead of `assert_eq!` when they want to output a custom message even if the assertion just compares two values. This pull request will resolve those cases.
2016-06-22 01:05:56 -07:00
bors
66b82beb60 Auto merge of #33830 - moosingin3space:feature/mutable-high-priority-binaryheap, r=alexcrichton
Mutable access to the top element of a BinaryHeap

An implementation of the library change discussed here: https://github.com/rust-lang/rfcs/issues/1626
2016-06-21 20:52:23 -07:00
bors
b8deebe3d6 Auto merge of #34402 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 7 pull requests

- Successful merges: #34356, #34360, #34369, #34371, #34378, #34380, #34391
- Failed merges:
2016-06-21 16:14:38 -07:00
Guillaume Gomez
0db65750bc Rollup merge of #34391 - pyjarrett:master, r=jseyfried
Improves organization of driver includes.

Minor reordering of use's in librustc_driver/driver.rs

- puts her::lower::lower_create with it's siblings
- groups link and write of rustc_trans::back
2016-06-21 23:54:29 +02:00
Guillaume Gomez
e20f49b528 Rollup merge of #34380 - sanxiyn:travis-gdb, r=alexcrichton
Run debuginfo tests on Travis
2016-06-21 23:54:29 +02:00
Guillaume Gomez
f39c4930b3 Rollup merge of #34378 - liigo:patch-10, r=Manishearth
diagnostics comes from different places now
2016-06-21 23:54:29 +02:00
Guillaume Gomez
592c314baf Rollup merge of #34371 - frewsxcv:thread-name, r=steveklabnik
Add examples for `std:🧵:Thread::name`.

None
2016-06-21 23:54:28 +02:00
Guillaume Gomez
0b566f6bec Rollup merge of #34369 - astocko:fix_doc_urls, r=steveklabnik
book: Fixed links in book/compiler-plugins.md

Updated the links referring to roman_numerals.rs and lint_plugin_test.rs. Went from src/test/auxiliary/ to src/test/run-pass-fulldeps/auxiliary/.
2016-06-21 23:54:28 +02:00
Guillaume Gomez
469d17c2a8 Rollup merge of #34360 - dsprenkels:ops-doc, r=apasel422
Markdown formatting fix

This pull request fixes some bad markdown formatting in the[ `std::ops::RangeTo` documentation](https://doc.rust-lang.org/std/ops/struct.RangeTo.html):

![screenshot from 2016-06-19 14 29 21](https://cloud.githubusercontent.com/assets/439973/16177354/5439a9bc-362a-11e6-97e5-374fd0bcf5a2.png)
2016-06-21 23:54:28 +02:00
Guillaume Gomez
3f43b01681 Rollup merge of #34356 - matklad:cstr-docs, r=GuillaumeGomez
Document `CStr::as_ptr` dangers.

r? @steveklabnik

Hi! I've tried to document `CString::new("hello").unwrap().as_ptr()` footgun. Related [RFC] and the original [discussion].

[RFC]: https://github.com/rust-lang/rfcs/pull/1642
[discussion]: https://users.rust-lang.org/t/you-should-stop-telling-people-that-safe-rust-is-always-safe/6094
2016-06-21 23:54:28 +02:00
Nathan Moos
2a34a7b839 implemented peek_mut and unit tests 2016-06-21 12:10:38 -07:00
bors
fe96928d7d Auto merge of #34155 - ollie27:unzip, r=alexcrichton
Remove unzip() SizeHint hack

This was using an invalid iterator so is likely to end with buggy
behaviour.

It also doesn't even benefit many type in std including Vec so removing it
shouldn't cause any problems.

Fixes: #33468
2016-06-21 02:18:42 -07:00
Mitsunori Komatsu
45a63d3ff6 Add message argument to assert_eq macro 2016-06-21 15:14:15 +09:00
bors
45cde975cb Auto merge of #34189 - eddyb:mir-trans-imm, r=nagisa
trans: generalize immediate temporaries to all MIR locals.

Added `Mir::local_index` which gives you an unified index for `Arg`, `Var`, `Temp` and `ReturnPointer`.
Also available is `Mir::count_locals` which returns the total number of the above locals.
This simplifies a lot of the code which can treat all of the local lvalues in the same manner.
If we had `-> impl Iterator`, I could have added a bunch of useful `Ty` or `Lvalue` iterators for all locals.
We could of course manually write such iterators as they are needed.

The only place which currently takes advantage of unified locals is trans' alloca elision.
Currently it's not as good as it could be, due to our usage of `llvm.dbg.declare` in debug mode.
But passing some arguments and variables as immediates has some effect on release-mode `libsyntax`:

Old trans:
```
time: 11.500; rss: 710MB        translation
time: 0.002; rss: 710MB assert dep graph
time: 0.000; rss: 710MB serialize dep graph
  time: 4.410; rss: 628MB       llvm function passes [0]
  time: 84.485; rss: 633MB      llvm module passes [0]
  time: 23.898; rss: 634MB      codegen passes [0]
  time: 0.002; rss: 634MB       codegen passes [0]
time: 113.408; rss: 634MB       LLVM passes
```
`-Z orbit`, previously:
```
time: 12.588; rss: 723MB        translation
time: 0.002; rss: 723MB assert dep graph
time: 0.000; rss: 723MB serialize dep graph
  time: 4.597; rss: 642MB       llvm function passes [0]
  time: 77.347; rss: 646MB      llvm module passes [0]
  time: 24.703; rss: 648MB      codegen passes [0]
  time: 0.002; rss: 615MB       codegen passes [0]
time: 107.233; rss: 615MB       LLVM passes
```
`-Z orbit`, after this PR:
```
time: 13.820; rss: 672MB        translation
time: 0.002; rss: 672MB assert dep graph
time: 0.000; rss: 672MB serialize dep graph
  time: 3.969; rss: 591MB       llvm function passes [0]
  time: 72.294; rss: 595MB      llvm module passes [0]
  time: 24.610; rss: 597MB      codegen passes [0]
  time: 0.002; rss: 597MB       codegen passes [0]
time: 101.439; rss: 597MB       LLVM passes
```
2016-06-20 21:04:48 -07:00
Paul Jarrett
bd477503e2 Improves organization of driver includes. 2016-06-20 22:11:45 -04:00
bors
4ba60aba38 Auto merge of #34186 - GuillaumeGomez:err-code-check, r=alexcrichton
Implementation of #34168

r? @brson

cc @alexcrichton
cc @steveklabnik
cc @jonathandturner

I only updated `librustc_privacy/diagnostics.rs`, and I already found a case where the code doesn't throw the expected error code (E0448).

Fixes #34168.
2016-06-20 15:54:17 -07:00
Eduard Burtescu
7279af86c8 trans: generalize immediate temporaries to all MIR locals. 2016-06-20 23:55:14 +03:00
Eduard Burtescu
bec32eb4ff trans: noop drops don't need their lvalue in an alloca. 2016-06-20 23:18:21 +03:00
Eduard Burtescu
eb9cb4dbca trans: derefs don't need the pointer in an alloca. 2016-06-20 23:18:21 +03:00
Eduard Burtescu
93c32b55e2 trans: split trans_consume off from trans_operand. 2016-06-20 23:18:21 +03:00
Guillaume Gomez
ddfaf10f6b Add error code flag 2016-06-20 19:38:26 +02:00
Seo Sanghyeon
9d03128f58 Run debuginfo tests on Travis 2016-06-20 19:31:07 +09:00
bors
5522e678bc Auto merge of #33950 - srinivasreddy:rtstartup_rustfmt, r=Manishearth
run rustfmt on rtstartup folder
2016-06-20 02:32:07 -07:00
Liigo Zhuang
7f4b75e173 diagnostics comes from different places now 2016-06-20 16:05:30 +08:00
bors
25f349db3e Auto merge of #34348 - dsprenkels:issue-34194-test, r=alexcrichton
Add regression test for #34194

This pull request adds a regression test for #34194.

Closes #34194.
2016-06-19 22:18:52 -07:00
bors
fa4cf7b260 Auto merge of #34340 - marudor:master, r=japaric
fix build for clang 8.0

With 10.12 and XCode 8-beta we got clang 8.
Simple addition as clang 8 will build as well.
2016-06-19 17:22:54 -07:00
Corey Farwell
d5a27594a3 Add examples for std:🧵:Thread::name. 2016-06-19 17:55:57 -04:00
Alexander Stocko
e79b672a88 Fixed links in book/compiler-plugins.md 2016-06-19 16:11:43 -04:00
bors
8d8a88f4a5 Auto merge of #34335 - ollie27:docs_collections_mods, r=GuillaumeGomez
Add short summaries to btree modules

Also improve hash_map and hash_set module short summaries.

These are missing from [here](https://doc.rust-lang.org/nightly/std/collections/#modules).

r? @steveklabnik
2016-06-19 12:56:13 -07:00
Daan Sprenkels
223cd21023 doc: std::ops md formatting fix 2016-06-19 14:25:15 +02:00
Aleksey Kladov
677aa47d68 Document CStr::as_ptr dangers. 2016-06-19 15:14:51 +03:00
bors
d06f1dcd7d Auto merge of #34313 - frewsxcv:panicking-example, r=steveklabnik
Add example in docs for `std:🧵:panicking`.

None
2016-06-19 02:24:15 -07:00
bors
3313e50594 Auto merge of #34351 - Stebalien:issue-22434, r=sfackler
Add test case for #22434

Closes #22434
2016-06-18 23:18:14 -07:00
bors
b1ae194fa6 Auto merge of #34295 - jseyfried:cfg_decoration, r=eddyb
Perform `cfg` attribute processing on decorator-generated items

Fixes https://users.rust-lang.org/t/unused-attribute-warning-for-custom-derive-attribute/6180.
r? @nrc
2016-06-18 20:12:09 -07:00
bors
9a68124737 Auto merge of #34350 - Stebalien:test-30276, r=eddyb
Add test case for #30276

Make sure that treating a DST tuple constructor as a function doesn't ICE.

Closes #30276
2016-06-18 17:07:15 -07:00
Steven Allen
7c452b1f0a Add test case for #22434
Closes #22434
2016-06-18 18:43:44 -04:00
Steven Allen
0e55c04940 Add test case for #30276
Make sure that treating a DST tuple constructor as a function doesn't ICE.

Closes #30276
2016-06-18 18:29:52 -04:00
bors
35784cbe0d Auto merge of #34310 - erickt:tuple-struct-attrs, r=nrc
Pretty-print attributes on tuple structs and add tests

This adds support to the pretty printer to print attributes added to tuple struct elements.  Furthermore, it adds a test that makes sure we will print attributes on all variant data types.
2016-06-18 14:02:32 -07:00
Daan Sprenkels
317ed84184 Add regression test for #34194 2016-06-18 20:05:44 +02:00
bors
11d4708f3a Auto merge of #34342 - GuillaumeGomez:E0406, r=eddyb
Removed unused E0406 and unused functions

Fixes #34301.

It removes the unused E0406 and also unused functions.

cc @eddyb
2016-06-18 10:58:25 -07:00
Guillaume Gomez
8637b4b034 Remove unused functions calls and unused E0406 2016-06-18 17:02:41 +02:00
bors
f4d03da825 Auto merge of #34336 - petrochenkov:icemctuple, r=arielb1
Fix ICE in memory categorization of tuple patterns

Fixes https://github.com/rust-lang/rust/issues/34334

It seems to be ok for `pat_ty` to return `Err` even if type checking is done, because it uses `infcx.node_ty` which is supposed to return `Err` for all kinds of erroneous types so its callers could quickly bail out with `?`.

r? @arielb1
2016-06-18 07:20:12 -07:00
bors
8545424b96 Auto merge of #34314 - tshepang:misnamed, r=steveklabnik
doc: fix mis-named binding & remove not needed `mut`
2016-06-18 01:58:28 -07:00
marudor
7508de57b0 fix build for clang 8.0 2016-06-18 10:38:11 +02:00
Vadim Petrochenkov
8c0fef80d7 Fix ICE in memory categorization of tuple patterns 2016-06-18 03:15:07 +03:00
Oliver Middleton
fdeda33a9a Add short summaries to btree modules
Also improve hash_map and hash_set module short summaries.
2016-06-17 23:50:34 +01:00
bors
646015cae4 Auto merge of #34323 - GuillaumeGomez:unreachable_not_unreachable, r=pnkfelix
Fix panic when using debug in rustc

When I was using `println!("{:?}")` [here](https://github.com/rust-lang/rust/blob/master/src/librustc_resolve/lib.rs#L1610) and [here](https://github.com/rust-lang/rust/blob/master/src/librustc_typeck/collect.rs#L836), I was able to get into this `unreachache`.
2016-06-17 15:33:00 -07:00
Corey Farwell
9944b223a2 Add example in docs for std:🧵:panicking. 2016-06-18 00:17:36 +02:00
bors
1f9423a87a Auto merge of #34292 - ollie27:rustdoc_depr_impl, r=GuillaumeGomez
rustdoc: Add stability notices to impl items

Also fixes missing stability notices on methods with no docs.

For example [`f64::is_positive`](https://doc.rust-lang.org/nightly/std/primitive.f64.html#method.is_positive) is missing its deprecation message.
2016-06-17 11:12:00 -07:00
bors
222e337ac1 Auto merge of #34322 - pnkfelix:fix-rustc-ctags, r=alexcrichton
Fixed the `TAGS.rustc.emacs` and `TAGS.rustc.vi` make targets.

(They were added to `ctags.mk` in PR #33256, but I guess I must have
 only tested running `make TAGS.emacs TAGS.rustc.emacs` and not `make
 TAGS.rustc.emacs` on its own.)
2016-06-17 07:58:33 -07:00