Commit Graph

49735 Commits

Author SHA1 Message Date
Tobias Bucher
a32244b3d9 Don't ignore errors of syscalls in std::sys::unix::fd
If any of these syscalls fail, it indicates a programmer error that
should not be silently ignored.
2016-06-23 13:57:55 +02:00
bors
bca68689bc Auto merge of #34364 - cynicaldevil:develop, r=GuillaumeGomez
Modified E0220 to show error messages for more general cases

This PR extends `E0220`'s description to explain more cases.
Refer to [#34342](https://github.com/rust-lang/rust/pull/34342) for more.
r? @GuillaumeGomez
2016-06-23 04:43:40 -07:00
Tobias Bucher
8ff5c4394c Use len instead of size_hint where appropiate
This makes it clearer that we're not just looking for a lower bound but
rather know that the iterator is an `ExactSizeIterator`.
2016-06-23 12:26:15 +02:00
bors
3908913db5 Auto merge of #34253 - jseyfried:improve_multi_modifiers, r=nrc
Allow `MultiItemModifier`s to expand into zero or many items

Fixes #34223.
r? @nrc
2016-06-23 01:04:47 -07:00
Aaronepower
703d7b519e Added Default trait for Cow 2016-06-23 07:05:16 +01:00
Liigo Zhuang
2d7bac7d86 Improve diagnostics E0425: use (public) items
E0425: unresolved name
2016-06-23 12:51:10 +08:00
bors
4960f2f907 Auto merge of #34374 - jseyfried:fix_hygiene_bug, r=nrc
Fix macro hygiene regression

The regression was caused by #32923, which is currently in beta.

The following is an example of regressed code:
```rust
fn main() {
    let x = 0;
    macro_rules! foo { () => {
        println!("{}", x); // prints `0` on stable and after this PR, prints `1` on beta and nightly
    } }

    let x = 1;
    foo!();
}
```

For code to regress, the following is necessary (but not sufficient):
 - There must be a local variable before a macro in a block, and the macro must use the variable.
 - There must be a second local variable with the same name after the macro.
 - The macro must be invoked in a statement position after the second local variable.

For example, if the `let x = 0;` from the breaking example were commented out, it would (correctly) not compile on beta/nightly. If the semicolon were removed from `foo!();`, it would (correctly) print `0` on beta and nightly.

r? @nrc
2016-06-22 21:11:27 -07:00
Jeffrey Seyfried
f6fe5b6a3e Cleanup comments 2016-06-23 01:05:32 +00:00
Eduard Burtescu
096ae80b33 Don't translate vtable methods with Self: Sized bounds. 2016-06-23 03:30:01 +03:00
Alex Burka
fc28ee256a upgrade thread_local! invocation syntax
Allows declaring multiple statics in one macro invocation, and supports attaching attributes to the generated items.
2016-06-22 20:29:37 -04:00
Jeffrey Seyfried
eef8485f5f More hygiene tests 2016-06-22 22:42:26 +00:00
Oliver Middleton
f1531254af Use the correct types in float examples 2016-06-22 23:33:07 +01:00
Alfie John
eb17527039 Switched tense to clarify what is happening in the example 2016-06-23 06:20:29 +10:00
Emilio Cobos Álvarez
b94b15852c
std: sync: Implement recv_timeout() 2016-06-22 20:48:55 +02:00
Fabian Vogt
03f9dd21d6 Fix typo in bootstrap README
"boostrap" instead of "bootstrap"
2016-06-22 15:09:11 +02:00
Corey Farwell
64137c485a Parameters in doc comment should be formatted code-like. 2016-06-22 08:24:16 -04:00
bors
e41cdabc3e Auto merge of #34408 - Manishearth:rollup, r=Manishearth
Rollup of 7 pull requests

- Successful merges: #34190, #34363, #34367, #34383, #34387, #34394, #34404
- Failed merges:
2016-06-22 04:21:59 -07:00
Manish Goregaokar
c749a3e4b5 Rollup merge of #34404 - ollie27:concat_idents, r=alexcrichton
Mark concat_idents! unstable

This is mostly just a documentation fix as I don't think stability
attributes have any effect on macros.

[before](https://doc.rust-lang.org/nightly/std/macro.concat_idents!.html) [after](https://ollie27.github.io/rust_doc_test/std/macro.concat_idents!.html)
2016-06-22 09:51:09 +01:00
Manish Goregaokar
c295a1c7c2 Rollup merge of #34394 - oli-obk:const_cast_false_positive, r=eddyb
don't warn on casting byte strs to slices

r? @durka
2016-06-22 09:51:08 +01:00
Manish Goregaokar
0c94e90233 Rollup merge of #34387 - ollie27:rustdoc_src_links, r=alexcrichton
rustdoc: Fix a couple of issues with src links to external crates

- src links/redirects to extern fn from another crate had an extra '/'.
- src links to `pub use` of a crate module had an extra '/'.
- src links to renamed reexports from another crate used the new name
  for the link but should use the original name.

Fixes: #34274
2016-06-22 09:51:08 +01:00
Manish Goregaokar
f753689115 Rollup merge of #34367 - Stebalien:issue-23281, r=sfackler
Add regression test for #23281

Closes #23281
2016-06-22 09:51:07 +01:00
Manish Goregaokar
2aaf6a0e5c Rollup merge of #34363 - GuillaumeGomez:sleep, r=alexcrichton
Fix overflow error in thread::sleep

Fixes #34330

I added a test to have a more clear error inside the function. Since `time_t` is `i64` and we expect `u64`, maybe we should changed the awaited type?
2016-06-22 09:51:07 +01:00
Manish Goregaokar
e4ff7f0107 Rollup merge of #34190 - ollie27:wrapping_fmt, r=alexcrichton
Implement Binary, Octal, LowerHex and UpperHex for Wrapping<T>

Fixes: #33659
2016-06-22 09:51:06 +01:00
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
Brian Anderson
59db95b499 Convert makefiles to build LLVM/compiler-rt with CMake 2016-06-21 19:54:28 -07:00
Oliver Middleton
1cc54d0327 Mark concat_idents! unstable
This is mostly just a documentation fix as I don't think stability
attributes have any effect on macros.
2016-06-21 23:30:15 +01: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
Guillaume Gomez
8f987ab3f2 Add error code flags 2016-06-21 23:52:30 +02:00
Nathan Moos
2a34a7b839 implemented peek_mut and unit tests 2016-06-21 12:10:38 -07:00
Nikhil Shagrithaya
09ffe475e7 Modified E0220 to show error messages for more general cases 2016-06-21 23:52:18 +05:30
cgswords
d59accfb06 Refactored tokentrees into their own files in preparation for tokenstreams. Modified tests to point to the new file now. 2016-06-21 11:12:36 -07:00
Guillaume Gomez
c02414e9bd Fix overflow error in thread::sleep 2016-06-21 15:50:27 +02: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
Oliver Schneider
0de72bba36
don't warn on casting byte strs to slices 2016-06-21 10:08:31 +02: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
Oliver Middleton
ebfdd110c3 rustdoc: Fix a couple of issues with src links to external crates
- src links/redirects to extern fn from another crate had an extra '/'.
- src links to `pub use` of a crate module had an extra '/'.
- src links to renamed reexports from another crate used the new name
  for the link but should use the original name.
2016-06-20 22:22:17 +01:00
Eduard Burtescu
7279af86c8 trans: generalize immediate temporaries to all MIR locals. 2016-06-20 23:55:14 +03:00
Vadim Petrochenkov
f903c97959 Merge PatKind::QPath into PatKind::Path in AST 2016-06-20 23:39:02 +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
Steven Allen
03d86ba2f5 Add regression test for #23281
Closes #23281
2016-06-20 14:23:43 -04:00
Guillaume Gomez
ddfaf10f6b Add error code flag 2016-06-20 19:38:26 +02:00
Jeffrey Seyfried
9a6864dcd2 Add more hygiene tests 2016-06-20 12:13:59 +00:00
Jeffrey Seyfried
d19ee0dcc0 Add regression test 2016-06-20 12:13:59 +00:00
Jeffrey Seyfried
a93455eb5d Remove unit tests 2016-06-20 12:13:57 +00:00
Jeffrey Seyfried
d7fa72abe2 Fix hygiene regression 2016-06-20 11:27:54 +00: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
Oliver Middleton
b8bddb00bd rustdoc: Add more types to the sidebar
They're displayed in the same order as they are on modules pages.
2016-06-19 23:19:57 +01: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
Jeffrey Seyfried
5033eca65f Generalize and abstract ThinAttributes 2016-06-19 00:01:55 +00: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
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
吴冉波
d0a0befb54 Traits where syntax's extra usage example more clearly
r? @steveklabnik
2016-06-17 22:54:06 +08:00
bors
c8eff682fd Auto merge of #33090 - bluss:special-zip-2, r=aturon
Specialize .zip() for efficient slice and slice iteration

The idea is to introduce a private trait TrustedRandomAccess and specialize .zip() for random access iterators into a counted loop.

The implementation in the PR is internal and has no visible effect in the API

Why a counted loop? To have each slice iterator compile to just a pointer, and both pointers are indexed with the same loop counter value in the generated code. When this succeeds, copying loops are readily recognized and replaced with memcpy and addition loops autovectorize well.

The TrustedRandomAccess approach works very well on the surface. Microbenchmarks optimize well, following the ideas above, and that is a dramatic improvement of .zip()'s codegen.

```rust
// old zip before this PR: bad, byte-for-byte loop
// with specialized zip: memcpy
pub fn copy_zip(xs: &[u8], ys: &mut [u8]) {
    for (a, b) in ys.iter_mut().zip(xs) {
        *a = *b;
    }
}

// old zip before this PR: single addition per iteration
// with specialized zip: vectorized
pub fn add_zip(xs: &[f32], ys: &mut [f32]) {
    for (a, b) in ys.iter_mut().zip(xs) { *a += *b; }
}

// old zip before this PR: single addition per iteration
// with specialized zip: vectorized (!!)
pub fn add_zip3(xs: &[f32], ys: &[f32], zs: &mut [f32]) {
    for ((a, b), c) in zs.iter_mut().zip(xs).zip(ys) { *a += *b * *c; }
}
```

Yet in more complex situations, the .zip() loop can still fall back to its old behavior where phantom null checks throw in fake premature end of the loop conditionals. Remember that a NULL inside
Option<(&T, &T)> makes it a `None` value and a premature (in this case)
end of the loop.

So even if we have 1) an explicit `Some` in the code and 2) the types of the pointers are `&T` or `&mut T` which are nonnull, we can still get a phantom null check at that point.

One example that illustrates the difference is `copy_zip` with slice versus Vec arguments. The involved iterator types are exactly the same, but the Vec version doesn't compile down to memcpy. Investigating into this, the function argument metadata emitted to llvm plays the biggest role. As eddyb summarized, we need nonnull for the loop to autovectorize and noalias for it to replace with memcpy.

There was an experiment to use `assume` to add a non-null assumption on each of the two elements in the specialized zip iterator, but this only helped in some of the test cases and regressed others. Instead I think the nonnull/noalias metadata issue is something we need to solve separately anyway.

These have conditionally implemented TrustedRandomAccess

- Enumerate
- Zip

These have not implemented it

- Map is sideeffectful. The forward case would be workable, but the double ended case is complicated.
- Chain, exact length semantics unclear
- Filter, FilterMap, FlatMap and many others don't offer random access and/or exact length
2016-06-17 03:36:32 -07:00
Guillaume Gomez
9ac3d9b63c Fix panic when using debug 2016-06-17 12:33:55 +02:00
Erick Tryzelaar
9de2de1d21 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-17 10:05:19 +01:00
Jeffrey Seyfried
f0b21c2d1e Rename ast::ExprKind::Again -> ast::ExprKind::Continue 2016-06-17 05:21:25 +00:00
Jeffrey Seyfried
962d5c16b5 Fix fallout 2016-06-17 05:21:23 +00:00
Jeffrey Seyfried
b5dbe01a2c Refactor away ast::Decl and refactor ast::Stmt 2016-06-17 05:04:40 +00:00
bors
be203ac258 Auto merge of #34306 - arielb1:mir-dump-fixes, r=eddyb
Fixes for `-Z dump-mir`

Do not overwrite the parent MIR when dumping promoted MIR.

r? @eddyb
2016-06-16 21:57:06 -07:00
bors
114be1e9f0 Auto merge of #34315 - Manishearth:rollup, r=Manishearth
Rollup of 4 pull requests

- Successful merges: #34298, #34302, #34307, #34312
- Failed merges:
2016-06-16 19:07:41 -07:00
Manish Goregaokar
019c594c6a Rollup merge of #34312 - erickt:add-try, r=nikomatsakis
Revert using ? for try! in the libsyntax pretty printer

The use of ...?instead of try!(...) in libsyntax makes extracting libsyntax into syntex quite painful since it's not stable yet. This makes backports take a much longer time and causes a lot of problems for the syntex dependencies. Even if it was, it'd take a few release cycles until syntex would be able to use it. Since it's not stable and that this feature is just syntax sugar, it would be most helpful if we could remove it.

cc #34311
2016-06-17 00:12:04 +01:00
Manish Goregaokar
5bac0c3985 Rollup merge of #34307 - nagisa:more-cache, r=arielb1
[MIR] Cache drops for early scope exits

Previously we would rebuild all drops on every early exit from a scope, which for code like:

```rust
match x {
    A => return 1,
    B => return 2,
    ...
    C => return 27
}
```

would produce 27 exactly same chains of drops for each return, basically a `O(n*m)` explosion. [This](https://cloud.githubusercontent.com/assets/679122/16125192/3355e32c-33fb-11e6-8564-c37cab2477a0.png) is such a case for a match on 80-variant enum with 3 droppable variables in scope.

For [`::core::iter::Iterator::partial_cmp`](6edea2cfda/src/libcore/iter/iterator.rs (L1909)) the CFG looked like [this](https://cloud.githubusercontent.com/assets/679122/16122708/ce0024d8-33f0-11e6-93c2-e1c44b910db2.png) (after initial SimplifyCfg). With this patch the CFG looks like [this](https://cloud.githubusercontent.com/assets/679122/16122806/294fb16e-33f1-11e6-95f6-16c5438231af.png) instead.

Some numbers (overall very small wins, however neither of the crates have many cases which abuse this corner case):

|                         | old time | old rss | new time | new rss  |
|-------------------------|----------|---------|----------|----------|
| core dump               | 0.879        |   224MB     |   0.871  |  223MB   |
| core MIR passes         | 0.759        | 224MB       | 0.718    | 223MB    |
| core MIR codegen passes | 1.762        | 230MB       | 1.442    | 228MB    |
| core trans              | 3.263        | 279MB       | 3.116    | 278MB    |
| core llvm passes        | 5.611        | 263MB       | 5.565    | 263MB    |
| std dump                | 0.487        |   190MB     |   0.475  |  192MB   |
| std MIR passes          | 0.311       | 190MB       | 0.288    | 192MB    |
| std MIR codegen passes  | 0.753        | 195MB       | 0.720    | 197MB    |
| std trans               | 2.589        | 287MB       | 2.523    | 287MB    |
| std llvm passes         | 7.268        | 245MB       | 7.447    | 246MB    |
2016-06-17 00:12:04 +01:00
Manish Goregaokar
51b20bcbf4 Rollup merge of #34302 - retep998:🐇-sanity-is-overrated-🐇, r=alexcrichton
Fix issue where rustbuild expected msvc to have ar

I made `cc2ar` return an `Option`.

r? @alexcrichton
2016-06-17 00:12:04 +01:00
Manish Goregaokar
986bb53a7b Rollup merge of #34298 - nrc:save-parent, r=eddyb
save-analysis: some tweaks
2016-06-17 00:12:04 +01:00
bors
f911d87b3b Auto merge of #34272 - jseyfried:simplify_gated_cfg_checking, r=nrc
Simplify gated cfg checking

r? @nrc
2016-06-16 16:09:45 -07:00
Tshepang Lekhonkhobe
1253e82b7f doc: fix mis-named binding & remove not needed mut 2016-06-16 23:20:58 +02:00
Simonas Kazlauskas
04d63ccf5a Cache drops for early scope exits
Previously we would rebuild all drops on every early exit from a scope, which for code like:

```rust
match x {
    a => return 1,
    b => return 2,
    ...
    z => return 27
}
```

would produce 27 exactly same chains of drops for each return, a O(n*m) explosion in drops.
2016-06-17 00:00:44 +03:00
Erick Tryzelaar
ba5cab1fe0 Revert using ? for try! in the libsyntax pretty printer
The use of ...?instead of try!(...) in libsyntax makes
extracting libsyntax into syntex quite painful since it's
not stable yet. This makes backports take a much longer time
and causes a lot of problems for the syntex dependencies. Even
if it was, it'd take a few release cycles until syntex would
be able to use it. Since it's not stable and that this feature
is just syntax sugar, it would be most helpful if we could remove
it.

cc #34311
2016-06-16 21:16:55 +01:00
Jeffrey Seyfried
2cd6ccf0b1 Simplify gated cfg checking 2016-06-16 19:24:44 +00:00
bors
18f28719ef Auto merge of #34187 - luser:extern-crate-abspaths, r=michaelwoerister
Add an abs_path member to FileMap, use it when writing debug info.

Fixes #34179.

When items are inlined from extern crates, the filename in the debug info
is taken from the FileMap that's serialized in the rlib metadata.
Currently this is just FileMap.name, which is whatever path is passed to rustc.
Since libcore and libstd are built by invoking rustc with relative paths,
they wind up with relative paths in the rlib, and when linked into a binary
the debug info uses relative paths for the names, but since the compilation
directory for the final binary, tools trying to read source filenames
will wind up with bad paths. We noticed this in Firefox with source
filenames from libcore/libstd having bad paths.

This change stores an absolute path in FileMap.abs_path, and uses that
if available for writing debug info. This is not going to magically make
debuggers able to find the source, but it will at least provide sensible
paths.
2016-06-16 12:13:25 -07:00
Ted Mielczarek
24e7491660 Add an abs_path member to FileMap, use it when writing debug info.
When items are inlined from extern crates, the filename in the debug info
is taken from the FileMap that's serialized in the rlib metadata.
Currently this is just FileMap.name, which is whatever path is passed to rustc.
Since libcore and libstd are built by invoking rustc with relative paths,
they wind up with relative paths in the rlib, and when linked into a binary
the debug info uses relative paths for the names, but since the compilation
directory for the final binary, tools trying to read source filenames
will wind up with bad paths. We noticed this in Firefox with source
filenames from libcore/libstd having bad paths.

This change stores an absolute path in FileMap.abs_path, and uses that
if available for writing debug info. This is not going to magically make
debuggers able to find the source, but it will at least provide sensible
paths.
2016-06-16 18:08:46 +01:00
bors
12b6345bc2 Auto merge of #34296 - dsprenkels:issue-23122-tests, r=alexcrichton
Add regression tests for #23122

This PR adds two regression tests for #23122.

Closes #23122.
2016-06-16 09:26:36 -07:00
Ariel Ben-Yehuda
a6d694ea00 fix MirSource::Promoted handling 2016-06-16 17:30:09 +03:00
Ariel Ben-Yehuda
5da8bf8402 stop having 'static in dump-mir names 2016-06-16 16:54:20 +03:00
Ariel Ben-Yehuda
63cdd7ab50 use a different filename for original and promoted MIRs 2016-06-16 16:54:20 +03:00
bors
7aba683c76 Auto merge of #34239 - jseyfried:fix_macro_use_scope_regression, r=nrc
Revert a change in the scope of macros imported from crates to fix a regression

Fixes #34212.
The regression was caused by #34032, which changed the scope of macros imported from extern crates to match the scope of macros imported from modules.
r? @nrc
2016-06-16 06:37:18 -07:00
Peter Atashian
e0992df35f
Fix issue where rustbuild expected msvc to have ar
Signed-off-by: Peter Atashian <retep998@gmail.com>
2016-06-16 08:38:06 -04:00
bors
6edea2cfda Auto merge of #34216 - jseyfried:nested_cfg_attr, r=nrc
Support nested `cfg_attr` attributes

Support arbitrarily deeply nested `cfg_attr` attributes (e.g. `#[cfg_attr(foo, cfg_attr(bar, baz))]`).
This makes configuration idempotent.

Currently, the nighties do not support any `cfg_attr` nesting. Stable and beta support just one level of `cfg_attr` nesting (expect for attributes on macro-expanded nodes, where no nesting is supported).

This is a [breaking-change]. For example, the following would break:
```rust
macro_rules! m { () => {
    #[cfg_attr(all(), cfg_attr(all(), cfg(foo)))]
    fn f() {}
} }
m!();

fn main() { f() } //~ ERROR unresolved name `f`
```
r? @nrc
2016-06-16 03:49:55 -07:00
Nick Cameron
a835d7487c save-analysis: add a decl_id for methods
This is non-null if the method is in a (non-inherent) impl and in that case will be the id for the method declaration in the implemented trait.
2016-06-16 11:28:39 +01:00
bors
a479a6a7a6 Auto merge of #34290 - arielb1:short-ladder, r=eddyb
don't generate drop ladder steps for fields that don't need dropping

cc @eddyb

This should help with #34166
2016-06-16 01:01:26 -07:00
Jeffrey Seyfried
c41cf30e9d Strip unconfigured nodes from decorator-generated AST 2016-06-16 07:58:43 +00:00
Daan Sprenkels
7ee3eaa79c Add regression tests for #23122 2016-06-16 09:46:25 +02:00
Jeffrey Seyfried
83d283b67b Avoid expanding decorator-generated items twice 2016-06-16 06:44:38 +00:00
Ariel Ben-Yehuda
68129a682a fix codegen-units fallout 2016-06-16 09:26:44 +03:00
bors
7339eca0cc Auto merge of #34000 - estebank:missingargs, r=jseyfried
Show types of all args when missing args

When there're missing arguments in a function call, present a list of
all the expected types:

```rust
fn main() {
    t("");
}

fn t(a: &str, x: String) {}
```

```bash
% rustc file.rs
file.rs:3:5: 2:8 error: this function takes 2 parameters but 0
parameters were supplied [E0061]
file.rs:3     t();
              ^~~
file.rs:3:5: 2:8 help: run `rustc --explain E0061` to see a detailed explanation
file.rs:3:5: 2:8 note: the following parameter types were expected: &str, std::string::String
error: aborting due to previous error
```

Fixes #33649
2016-06-15 22:12:26 -07:00
Jeffrey Seyfried
58372af058 Add test for MultiItemModifiers that add items 2016-06-16 03:55:57 +00:00
Jeffrey Seyfried
ac1a1d32f6 Allow MultiItemModifiers to expand into zero or many items 2016-06-16 03:55:55 +00:00
Jeffrey Seyfried
34191ed1c8 Refactor MultiModifier expansion 2016-06-16 03:55:53 +00:00
Jeffrey Seyfried
6ba7b7c22d Implement HasAttrs for Annotatable 2016-06-16 03:55:52 +00:00
Esteban Küber
1020e3036b Show types of all args when missing args
When there're missing arguments in a function call, present a list of
all the expected types:

```rust
fn main() {
    t("");
}

fn t(a: &str, x: String) {}
```

```bash
% rustc file.rs
file.rs:3:5: 2:8 error: this function takes 2 parameters but 0
parameters were supplied [E0061]
file.rs:3     t();
              ^~~
file.rs:3:5: 2:8 help: run `rustc --explain E0061` to see a detailed explanation
file.rs:3:5: 2:8 note: the following parameter types were expected: &str, std::string::String
error: aborting due to previous error
```

Fixes #33649
2016-06-15 18:40:11 -07:00
Manish Goregaokar
e3d6bb1f71 Rollup merge of #34270 - gkoz:error_file_exists, r=alexcrichton
Add ERROR_FILE_EXISTS to ErrorKind conversion on Windows

Bug report: https://users.rust-lang.org/t/detecting-error-kind-for-opening-file/6215
Reference: https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx#error_file_exists
2016-06-16 01:39:44 +01:00
Manish Goregaokar
2675a55a8f Rollup merge of #34268 - zackmdavis:if_let_over_none_unit_arm, r=jseyfried
prefer `if let` to match with `None => ()` arm in some places

Casual grepping revealed some places in the codebase (some of which
antedated `if let`'s December 2014 stabilization in c200ae5a) where we
were using a match with a `None => ()` arm where (in the present
author's opinion) an `if let` conditional would be more readable. (Other
places where matching to the unit value did seem to better express the
intent were left alone.)

It's likely that we don't care about making such trivial,
non-functional, sheerly æsthetic changes.

But if we do, this is a patch.
2016-06-16 01:39:44 +01:00
Manish Goregaokar
d84993b054 Rollup merge of #34207 - petrochenkov:nohyg, r=jseyfried
Remove last traces of identifier hygiene from HIR

e783a0a5e3 removed the [last](https://github.com/rust-lang/rust/pull/33654#discussion_r63415218) [use](https://github.com/rust-lang/rust/pull/33654#discussion_r63416284) of hygiene at post-resolve compilation stages, so we can avoid renaming during lowering to HIR and just keep original names.

r? @nrc
2016-06-16 01:39:43 +01:00
Oliver Middleton
195fc5a325 rustdoc: Add stability notices to impl items
Also fixes missing stability notices on methods with no docs.
2016-06-15 23:56:24 +01:00
Ariel Ben-Yehuda
2960bc8246 don't generate drop ladder steps for fields that don't need dropping 2016-06-16 00:48:02 +03:00
Alex Burka
b54afbee1f include list of characters 2016-06-15 16:42:36 -04:00
Alex Burka
523dbfc312 update reference for #29734 2016-06-15 16:35:03 -04:00
bors
bb4a79b087 Auto merge of #34220 - srinivasreddy:rf_cargotest, r=brson
run rustfmt on cargotest folder in src/tools/cargotest
2016-06-15 13:11:19 -07:00
bors
5755936a63 Auto merge of #34218 - srinivasreddy:rf_linkchecker, r=brson
run rustfmt on linkchecker folderin src/tools/linkchecker
2016-06-15 10:28:30 -07:00
Zack M. Davis
8531d58104 prefer if let to match with None => () arm in some places
Casual grepping revealed some places in the codebase (some of which
antedated `if let`'s December 2014 stabilization in c200ae5a) where we
were using a match with a `None => ()` arm where (in the present
author's opinion) an `if let` conditional would be more readable. (Other
places where matching to the unit value did seem to better express the
intent were left alone.)

It's likely that we don't care about making such trivial,
non-functional, sheerly æsthetic changes.

But if we do, this is a patch.
2016-06-15 08:13:10 -07:00
bors
9b06d2ad33 Auto merge of #33300 - seanmonstar:map-entry-take, r=alexcrichton
Map::Entry methods to recover key and value together

See https://github.com/rust-lang/rust/issues/32281#issuecomment-213066344
2016-06-15 07:37:27 -07:00
Sean McArthur
217a964027 Map::Entry::take() method to recover key and value together 2016-06-15 05:45:50 -07:00
bors
a94881563c Auto merge of #34180 - durka:patch-24, r=brson
derive Hash (and not Copy) for ranges

Fixes #34170.

Also, `RangeInclusive` was `Copy` by mistake -- fix that, which is a [breaking-change] to that unstable type.
2016-06-15 04:48:29 -07:00
Gleb Kozyrev
552afd30d0 Fix a docs typo 2016-06-15 13:06:48 +03:00
Gleb Kozyrev
1db97575cc Test ErrorKind::AlreadyExists for files 2016-06-15 13:05:43 +03:00
bors
c5f3706c0d Auto merge of #34263 - ollie27:docs_ip, r=alexcrichton
Improve IP reserved address docs

- Add links to all RFCs to make it clear these are not Rust RFCs.
- Correct RFC numbers to match the numbers in [RFC 6890](https://tools.ietf.org/html/rfc6890)
- Clean up formatting to show addresses and ranges in parentheses like (255.255.255.255)

r? @steveklabnik
2016-06-14 20:36:31 -07:00
bors
1a942f60f0 Auto merge of #34245 - ollie27:rustdoc_redirect_rename, r=alexcrichton
rustdoc: Fix redirect pages for renamed reexports

We need to use the name of the target not the name of the current item
when creating the link.

An example in `std` is [`std::sys::ext`](https://doc.rust-lang.org/nightly/std/sys/ext/index.html).
2016-06-14 17:11:05 -07:00
bors
6b4511755c Auto merge of #34221 - srinivasreddy:rm_redundant, r=alexcrichton
remove redundant test case in bitvector.rs

`bitvec_iter_works_2` does exactly same as `bitvec_iter_works_1`, so i removed it.
2016-06-14 13:42:28 -07:00
bors
be8bd82268 Auto merge of #34234 - GuillaumeGomez:bad_inlining, r=steveklabnik
Fix invalid inlining

r? @steveklabnik

So to put a context. @nox found an issue on the generated doc:

![screenshot from 2016-06-11 19-53-38](https://cloud.githubusercontent.com/assets/3050060/15987898/f7341de0-303b-11e6-9cd7-f2a6df423ee7.png)

So as you can see, the two variants are on the same where they shouldn't. I found out that the issue is also on structs:

![screenshot from 2016-06-11 19-53-31](https://cloud.githubusercontent.com/assets/3050060/15987900/0f66c5de-303c-11e6-90fc-5e49d11b6903.png)

And so such is the result of the PR:

![screenshot from 2016-06-12 01-15-21](https://cloud.githubusercontent.com/assets/3050060/15987904/19d9183c-303c-11e6-91c1-7c3f1163fbb0.png)
![screenshot from 2016-06-12 01-15-24](https://cloud.githubusercontent.com/assets/3050060/15987905/1b5d2db0-303c-11e6-8f43-9a8ad2371007.png)
2016-06-14 07:49:56 -07:00
Oliver Middleton
0c742d263c rustdoc: Fix redirect pages for renamed reexports
We need to use the name of the target not the name of the current item
when creating the link.
2016-06-14 15:24:06 +01:00
Ulrik Sverdrup
5df05c6e22 specialize zip: Use associated type for specialized zip struct data
The associated type must be 'static to avoid dropck related errors.
2016-06-14 15:51:49 +02:00
Ulrik Sverdrup
85cd49fc39 specialize zip: Add benchmarks 2016-06-14 15:51:49 +02:00
Ulrik Sverdrup
c2ef20fd38 specialize zip: Add codegen test 2016-06-14 15:51:49 +02:00
Ulrik Sverdrup
13f8f40961 specialize zip: TrustedRandomAccess for Enumerate 2016-06-14 15:51:49 +02:00
Ulrik Sverdrup
515c4d3c1e specialize zip: TrustedRandomAccess for Zip 2016-06-14 15:51:49 +02:00
Ulrik Sverdrup
a8f2e9b359 specialize zip: Specialize .zip() for TrustedRandomAccess iterators
This allows common iterator compositions like a.zip(b) where a, b
are slice::{Iter, IterMut} compile to *much* better code.
2016-06-14 15:51:49 +02:00
Ulrik Sverdrup
592eaa5bb3 specialize zip: Implement TrustedRandomAccess for slice iterators 2016-06-14 15:51:49 +02:00
Ulrik Sverdrup
f8d2fdf02b specialize zip: Introduce TrustedRandomAccess trait 2016-06-14 15:50:49 +02:00
bors
2940eb54bd Auto merge of #34232 - ollie27:rustdoc_inline, r=alexcrichton
rustdoc: Don't inline #[doc(hidden)] pub use

Currently if a `#[doc(hidden)] pub use` item is inlined the `hidden`
attribute is ignored so the item can appear in the docs. By never inlining
such imports, they can be stripped.

An example in `std` is [`__OsLocalKeyInner`](https://doc.rust-lang.org/nightly/std/thread/struct.__OsLocalKeyInner.html) which clearly should not be documented.
2016-06-14 05:04:38 -07:00
Gleb Kozyrev
5db9424de3 Add ERROR_FILE_EXISTS to ErrorKind conversion on Windows
Bug report:
https://users.rust-lang.org/t/detecting-error-kind-for-opening-file/6215
Reference:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx#error_file_exists
2016-06-14 12:10:42 +03:00
Jeffrey Seyfried
0644aba0b3 Remove the type parameter from syntax::visit::Visitor 2016-06-14 07:40:32 +00:00
Jeffrey Seyfried
683e480ffe Refactor away WithAttrs trait 2016-06-14 07:40:30 +00:00
Jeffrey Seyfried
5bf7970ac7 Change fold_tt and fold_tts to take token trees by value (instead of by reference) 2016-06-14 07:40:18 +00:00
Jeffrey Seyfried
febe6a46f6 Refactor away field ctxt of ast::Mac_ 2016-06-14 07:39:33 +00:00
Jeffrey Seyfried
01a0877a73 Remove inherent method attrs() on AST nodes. attrs() is now a method of trait HasAttrs. 2016-06-14 07:39:32 +00:00
bors
1af8f3e362 Auto merge of #34266 - liigo:patch-8, r=Manishearth
reference: link to proper ffi attributes
2016-06-14 00:24:33 -07:00
bors
bf84f4e171 Auto merge of #33749 - jseyfried:fix_call_site_span, r=nrc
Fix macro call site spans

Fix macro call site spans.
r? @nrc
2016-06-13 21:07:30 -07:00
Liigo Zhuang
4dcebd2fa9 reference: link to proper ffi attributes 2016-06-14 10:50:48 +08:00
bors
6551acc8e5 Auto merge of #34262 - dsprenkels:enum_pattern_resolve_ice, r=eddyb
Add regression test for #33293

This PR adds a regression test for #33293.

Closes #33293.
r? @eddyb
2016-06-13 18:26:30 -07:00
Jeffrey Seyfried
2477341d05 Replace println!(""); invocations with calls to a dummy function in debuginfo test 2016-06-13 22:57:08 +00:00
Oliver Middleton
61043fd3c1 Improve IP reserved address docs
- Add links to all RFCs to make it clear these are not Rust RFCs.
- Correct RFC numbers to match the numbers in [RFC 6890](https://tools.ietf.org/html/rfc6890)
- Clean up formatting to show addresses and ranges in parentheses like (255.255.255.255)
2016-06-13 23:49:04 +01:00
bors
ab0b87458f Auto merge of #34243 - c3st7n:add_test_issue_issue_23477, r=nagisa
Add test case for issue #23477

My first pull request, any feedback welcome.

Fixes #23477
2016-06-13 15:44:17 -07:00
Chris Tomlinson
d991b1f624 Correct broken test 2016-06-13 22:27:13 +01:00
Daan Sprenkels
297742e3b8 Add regression test for #33293 2016-06-13 23:24:29 +02:00
Joseph Dunne
dc3d878e0f Add support for macro expansion inside trait items 2016-06-13 21:46:43 +01:00
Florian Berger
4e0fd65d96 doc: Fix typo 2016-06-13 21:35:37 +03:00
bors
c0df44708e Auto merge of #34242 - zackmdavis:explain_E0453, r=GuillaumeGomez
add long explanation for E0453, lint attribute overruled by outer forbid

This is a subtask of #32777.

-----

r? @GuillaumeGomez
2016-06-13 07:38:40 -07:00
bors
5e3136def7 Auto merge of #34252 - dsprenkels:issue-32364-test, r=eddyb
Add regression test for #32364

This PR adds a regression test for #32364.

r? @eddyb
2016-06-13 02:31:29 -07:00
Zack M. Davis
e4c566ccef edit E0453 long explanation for style, clarity, and citizenship
It turns out that the subsequent lines of the error message comment
should be aligned like this.

The "turns the corresponding compiler warning" language may not be
strictly the most accurate—a lint check isn't the same as a compiler
warning; it emits a compiler warning if it's set to the `warn` level—
but it may be worth glossing over such distinctions in favor of simple,
familar phrasings for the sake of pedagogy; thanks to Guillaume Gomez
for the wording suggestion.

Let's also fix up the introductory clauses of the sentences about how to
fix the error to put a little more emphasis on the fact that the
`forbid` setting was probably there for a reason.
2016-06-12 21:14:30 -07:00
bors
6b40b74af5 Auto merge of #34226 - srinivasreddy:tuple_slice_cleanup, r=alexcrichton
Add additional test cases to test all arities of tuple; And remove type suffix - i32 on integers
2016-06-12 20:49:37 -07:00
Daan Sprenkels
df564451db Add regression test for #32364 2016-06-13 00:36:22 +02:00
bors
51d2d3da80 Auto merge of #34133 - m-decoster:master, r=GuillaumeGomez
Add explanations for E0503 and E0508.

(cannot use `..` because it was mutably borrowed, cannot move out of type `..`, a non-copy fixed-size array)

Part of #32777.
2016-06-12 15:35:32 -07:00
Chris Tomlinson
1bf4068805 Add test case for issue 23477 2016-06-12 22:20:54 +01:00
Zack M. Davis
c17f1a66f9 add long explanation for E0453, lint attribute overruled by outer forbid
This is a subtask of #32777.
2016-06-12 12:58:24 -07:00
bors
abc57aba05 Auto merge of #34241 - dsprenkels:issue-32031-test, r=eddyb
add a test case for issue #32031

I propose a test case to finish the fix for issue #32031. Please review this commit thoroughly, as I have never written a codegen test before.

r? @eddyb
2016-06-12 12:48:57 -07:00
Guillaume Gomez
7746d7c52f Add error codes block code flag 2016-06-12 18:40:40 +02:00
Daan Sprenkels
688840fdd6 add a test case for issue #32031 2016-06-12 18:09:38 +02:00
bors
a76698b5ee Auto merge of #34045 - ollie27:rustdoc_stripped, r=brson
rustdoc: Don't generate empty files for stripped items

We need to traverse stripped modules to generate redirect pages, but we shouldn't generate
anything else for them.

This now renders the file contents to a Vec before writing it to a file in one go. I think
that's probably a better strategy anyway.

Fixes: #34025
2016-06-12 06:05:55 -07:00
bors
b1b752655d Auto merge of #34161 - kennytm:fix-E0277-format, r=GuillaumeGomez
Fix markdown formatting error of E0277, E0310 and E0502.

Fix bad format we see in https://doc.rust-lang.org/nightly/error-index.html#E0277.
2016-06-12 03:11:36 -07:00
Mathieu De Coster
e06fbe159c Add explanation for E0503 2016-06-12 10:32:55 +02:00
Mathieu De Coster
81cd752264 Add explanation for E0508 2016-06-12 10:31:54 +02:00
kennytm
ae75593864
Fix markdown formatting error of E0277, E0284, E0310, E0502. 2016-06-12 16:09:44 +08:00
bors
5b09f2a1a6 Auto merge of #34238 - jpreiss:master, r=steveklabnik
fix typo in primitive-types section on slices
2016-06-12 00:05:47 -07:00
Jeffrey Seyfried
236b67af51 Add regression test 2016-06-12 06:28:37 +00:00
Jeffrey Seyfried
2d1f3009cc Load macros from #[macro_use] crates earlier in expansion 2016-06-12 05:56:52 +00:00
Jeffrey Seyfried
3b8e1f309e Implement Into<Vec<T>> for SmallVector<T> 2016-06-12 05:56:52 +00:00
Jeffrey Seyfried
8104df27ec Add method visit_with to MacroGenerable 2016-06-12 05:56:47 +00:00
James Alan Preiss
c0c43b1e27 typo fix in loops.md 2016-06-11 20:46:23 -07:00
James Alan Preiss
77aeb7b6f1 fix typo in primitive-types section on slices 2016-06-11 20:31:01 -07:00
bors
4c45d26a82 Auto merge of #34132 - AtheMathmo:no-stdlib, r=steveklabnik
Note warning of default features on libc

The default features of libc include libstd. This should be noted on this page.
2016-06-11 19:57:47 -07:00
Guillaume Gomez
7cd891280b Fix invalid inlining 2016-06-12 01:34:45 +02:00
Oliver Middleton
a7c467418f rustdoc: Don't inline #[doc(hidden)] pub use
Currently if a `#[doc(hidden)] pub use` item is inlined the `hidden`
attribute is ignored so the item can appear in the docs. By never inlining
such imports, they can be stripped.
2016-06-11 23:00:42 +01:00
Alex Burka
df924ca2a1 add fixme about duplicated errors 2016-06-11 15:51:04 -04:00
Srinivas Reddy Thatiparthy
fa91c14bc0 Add additional test cases to test all arities of tuple; And remove type suffix - i32 on integers 2016-06-11 22:31:24 +05:30
bors
35841eea8b Auto merge of #34153 - apasel422:btree, r=alexcrichton
Update tracking issue for `{BTreeMap, BTreeSet}::{append, split_off}`

r? @alexcrichton
2016-06-11 08:52:22 -07:00
Srinivas Reddy Thatiparthy
99e9f2ddc1 remove redundant test case 2016-06-11 20:59:58 +05:30