Commit Graph

54508 Commits

Author SHA1 Message Date
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
Alex Crichton
3c778953d5 configure: Remove clang version checks
We no C++ and an incredibly small amount of C code as part of the build, so
there's not really much need for us to strictly check the version of compilers
as we're not really stressing anything. LLVM is a pretty huge chunk of C++ but
it should be the responsibility of LLVM to ensure that it can build with a
particular clang/gcc version, not ours (as this logic changes over time).

These version checks seem to basically just by us a regular stream of PRs every
six weeks or so when a new version is releases, so they're not really buying us
much. As a result, remove them and we can add then back piecemeal perhaps as a
blacklist if we really need to.
2016-06-20 10:05:26 -07: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
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
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
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
吴冉波
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
Felix S. Klock II
272ce38476 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 12:07:48 +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