Commit Graph

88497 Commits

Author SHA1 Message Date
Wesley Norris
a3f7f97205 Fix tidy error. 2019-01-17 17:26:00 -05:00
Wesley Norris
1318e53ea8 Persist doc test executables to given path. 2019-01-17 17:26:00 -05:00
bors
daa53a52a2 Auto merge of #57694 - pietroalbini:revert-beta-on-master, r=pietroalbini
Revert "Auto merge of #57670 - rust-lang:beta-next, r=Mark-Simulacrum"

For whatever reason bors merged this in master `:/`

r? @ghost
2019-01-17 10:15:57 +00:00
Pietro Albini
d158ef64e8
Revert "Auto merge of #57670 - rust-lang:beta-next, r=Mark-Simulacrum"
This reverts commit 722b4d6959, reversing
changes made to 956dba47d3.
2019-01-17 10:48:10 +01:00
bors
6599946272 Auto merge of #57520 - alexreg:tidy-copyright-lint, r=Mark-Simulacrum
Add lint for copyright headers to 'tidy' tool

r? @Mark-Simulacrum

CC @centril
2019-01-17 07:36:37 +00:00
bors
722b4d6959 Auto merge of #57670 - rust-lang:beta-next, r=Mark-Simulacrum
Prepare beta 1.33.0

This PR includes the usual changes for a new beta, and suppresses a few lints on libcore: those lints are false positives caused by an internal attribute (`rustc_layout_scalar_valid_range_start`) and only happen on stage0.

r? @Mark-Simulacrum
2019-01-17 05:00:14 +00:00
bors
956dba47d3 Auto merge of #56869 - GuillaumeGomez:index-size-reduction, r=QuietMisdreavus
Reduce search-index.js size

Coming from:

```
1735683 Dec 16 01:35 build/x86_64-apple-darwin/doc/search-index.js
```

to:

```
727755 Dec 16 01:51 build/x86_64-apple-darwin/doc/search-index.js
```

r? @QuietMisdreavus
2019-01-17 02:12:17 +00:00
Guillaume Gomez
d405606c3b End fixing search index minification 2019-01-17 01:41:01 +01:00
Guillaume Gomez
2e8fd44598 Minify search-index in one pass 2019-01-17 01:41:01 +01:00
Guillaume Gomez
f42407f114 Reduce search-index.js size 2019-01-17 01:41:01 +01:00
bors
c40b97796e Auto merge of #57392 - Xanewok:always-calc-glob-map, r=petrochenkov
Always calculate glob map but only for glob uses

Previously calculating glob map was *opt-in*, however it did record node id -> ident use for every use directive. This aims to see if we can unconditionally calculate the glob map and not regress performance.

Main motivation is to get rid of some of the moving pieces and simplify the compilation interface - this would allow us to entirely remove `CrateAnalysis`. Later, we could easily expose a relevant query, similar to the likes of `maybe_unused_trait_import` (so using precomputed data from the resolver, but which could be rewritten to be on-demand).

r? @nikomatsakis

Local perf run showed mostly noise (except `ctfe-stress-*`) but I'd appreciate if we could do a perf run run here and double-check that this won't regress performance.
2019-01-16 23:25:41 +00:00
Pietro Albini
b54a00accd
allow unused warnings related to rustc_layout_scalar_valid_range_start 2019-01-16 18:20:08 +01:00
Pietro Albini
dc25c80571
prepare beta 1.33.0 2019-01-16 17:22:51 +01:00
bors
ceb2512144 Auto merge of #57321 - petrochenkov:atokens, r=nikomatsakis
Implement basic input validation for built-in attributes

Correct top-level shape (`#[attr]` vs `#[attr(...)]` vs `#[attr = ...]`) is enforced for built-in attributes, built-in attributes must also fit into the "meta-item" syntax (aka the "classic attribute syntax").

For some subset of attributes (found by crater run), errors are lowered to deprecation warnings.

NOTE: This PR previously included https://github.com/rust-lang/rust/pull/57367 as well.
2019-01-16 15:01:20 +00:00
bors
cccaf9a8c6 Auto merge of #57416 - alexcrichton:remove-platform-intrinsics, r=nagisa
rustc: Remove platform intrinsics crate

This was originally attempted in #57048 but it was realized that we
could fully remove the crate via the `"unadjusted"` ABI on intrinsics.
This means that all intrinsics in stdsimd are implemented directly
against LLVM rather than using the abstraction layer provided here. That
ends up meaning that this crate is no longer used at all.

This crate developed long ago to implement the SIMD intrinsics, but we
didn't end up using it in the long run. In that case let's remove it!
2019-01-16 12:15:10 +00:00
Alexander Regueiro
4d1802308b Updated Book and Reference submodules. 2019-01-16 03:59:06 +00:00
bors
e2f221c759 Auto merge of #57629 - matthiaskrgr:clippy_submodule_upd, r=oli-obk
submodules: update clippy from c63b6349 to 1b89724b

Changes:
````
Really fix issue number in `map_clone` test
Fix issue number in `map_clone` test
Remove `map_clone` fixed known problem
Fix `map_clone` bad suggestion
Add run-rustfix to unnecessary_fold
Add run-rustfix to unit_arg test
Add run-rustfix for types test
Add run-rustfix to starts_ends_with
Add run-rustfix to replace_const test
Add run-rustfix to redundant_field_names
Missing docs: don't require documenting Global Asm items.
Add run-rustfix for precedence test
Add run-rustfix to mem_replace test
Add run-rustfix to map_clone test
Add run-rustfix to large_digit_groups
Add run-rustfix to into_iter_on_ref
Add run-rustfix to infallible_destructuring_match
Add rustfix to inconsistent_digit_grouping test
Add run-rustfix to explicit_write test
Add run-rustfix to excessive_precision test
Add run-rustfix to duration_subsec test
Disable deprecated_cfg_attr lint for inner attributes
Add run-rustfix to collapsible_if test
Update Readme
Update Readme for (arguably) better readability
rustup: the features if_while_or_patterns has been stabilized
Fix comments in clippy_lints/src/len_zero.rs
readme: update travis badge to reflect migration from travis-ci.org to travis-ci.com
Remove all copyright license headers
Move cast_ref_to_mut list to correctness group
Rustftmt
Don't import ty::Ref in cast_ref_to_mut lint
Move a hint to an error message in cast_ref_to_mut lint
Add a note to cast_ref_to_mut lint
Use ty::Ref instead of ty::TyKind::Ref
cast_ref_to_mut lint
Add missing ` in default lint
Improve tests and exclude nested impls
Update `unwrap_get` code review suggestions
Update known problems
Restrict use_self on nested items
Improve `get_unwrap` suggestion
````
2019-01-15 18:41:42 +00:00
bors
14ea6e50c1 Auto merge of #57630 - Centril:rollup, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #56044 (Drop partially bound function parameters in the expected order)
 - #57352 (forbid manually impl'ing one of an object type's marker traits)
 - #57456 (RawVec doesn't always abort on allocation errors)
 - #57467 (Implement `check_attribute` to forbid `#[allow_internal_unsafe]`)
 - #57579 (Add core::iter::once_with())
 - #57587 (Add 'rustc-env:RUST_BACKTRACE=0' to const-pat-ice test)
 - #57608 (Simplify 'product' factorial example)
 - #57614 ([rustdoc] Fix crates filtering box not being filled)

Failed merges:

r? @ghost
2019-01-15 13:56:16 +00:00
Mazdak Farrokhzad
9947b3060c
Rollup merge of #57614 - GuillaumeGomez:fix-crate-filtering, r=QuietMisdreavus
[rustdoc] Fix crates filtering box not being filled

Currently, the filter crate box (at the left of the search input) is always empty. To get the number of keys of dictionary in JS, you need to call `Object.keys()` on it.

r? @QuietMisdreavus
2019-01-15 12:42:14 +01:00
Mazdak Farrokhzad
a52ec3c9ee
Rollup merge of #57608 - timvisee:master, r=frewsxcv
Simplify 'product' factorial example

This simplifies the [`factorial(n: 32)`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#examples-46) implementation as example for the `Iterator::product()` function.
It currently uses unnecessary additional complexity.

Although very minimal, I do not want to include it in some other irrelevant PR.
2019-01-15 12:42:13 +01:00
Mazdak Farrokhzad
cf436832f8
Rollup merge of #57587 - Aaron1011:fix/const-pat-ice, r=alexcrichton
Add 'rustc-env:RUST_BACKTRACE=0' to const-pat-ice test

This ensures that the test passes, regardless of what the user has set
RUST_BACKTRACE to.
2019-01-15 12:42:12 +01:00
Mazdak Farrokhzad
ae1ab8afa9
Rollup merge of #57579 - stjepang:once-with, r=SimonSapin
Add core::iter::once_with()

Functions `iter::once()` and `iter::repeat()` construct iterators from values. The latter has the lazy variant `iter::repeat_with()`, but the former doesn't. This PR therefore adds `iter::once_with()`.

Another way to think of `iter::once_with()` is that it's a function that converts `FnOnce() -> T` into `Iterator<Item = T>`.

If this seems like a reasonable addition, I'll open a tracking issue and update the `#[feature(...)]` attributes.
2019-01-15 12:42:10 +01:00
Mazdak Farrokhzad
e8cfae4140
Rollup merge of #57467 - JohnTitor:implement-the-check-attribute-1, r=oli-obk
Implement `check_attribute` to forbid `#[allow_internal_unsafe]`

Fixes #56768.

r? @oli-obk
2019-01-15 12:42:08 +01:00
Mazdak Farrokhzad
77727feb18
Rollup merge of #57456 - fintelia:patch-4, r=dtolnay
RawVec doesn't always abort on allocation errors
2019-01-15 12:42:07 +01:00
Mazdak Farrokhzad
5fa44c4b5a
Rollup merge of #57352 - arielb1:no-manual-markers, r=nikomatsakis
forbid manually impl'ing one of an object type's marker traits

This shouldn't break compatibility for crates that do not use
`feature(optin_builtin_traits)`, because as the test shows, it is
only possible to impl a marker trait for a trait object in the crate the
marker trait is defined in, which must define
`feature(optin_builtin_traits)`.

Fixes #56934.

r? @nikomatsakis
2019-01-15 12:42:06 +01:00
Mazdak Farrokhzad
c4b8735872
Rollup merge of #56044 - matthewjasper:function-param-drop-order, r=cramertj
Drop partially bound function parameters in the expected order

Given the function

```rust
fn foo((_x, _): (LogDrop, LogDrop), (_, _y): (LogDrop, LogDrop)) {}
```

Prior to 1.12.0 we dropped both `_x` and `_y` before the rest of their
respective parameters, since then we dropped `_x` and `_y` after. The
original order appears to be the correct order, as the value created
later is dropped first, so we revert to that order and add a test for
it.

While this is technically a breaking change, I can't work out how
anyone could be relying on this without making their code very
brittle. If this is considered to be too likely to break real world code
then I can revert the change and change the test to check for the
current order.
2019-01-15 12:42:04 +01:00
bors
920192490f Auto merge of #57625 - drrlvn:patch-1, r=Centril
Stabilize FileExt::read_exact_at/write_all_at

r? alexcrichton

Closes #51984.
2019-01-15 11:18:24 +00:00
Matthias Krüger
16c9d8d576 submodules: update clippy from c63b6349 to 1b89724b
Changes:
````
Really fix issue number in `map_clone` test
Fix issue number in `map_clone` test
Remove `map_clone` fixed known problem
Fix `map_clone` bad suggestion
Add run-rustfix to unnecessary_fold
Add run-rustfix to unit_arg test
Add run-rustfix for types test
Add run-rustfix to starts_ends_with
Add run-rustfix to replace_const test
Add run-rustfix to redundant_field_names
Missing docs: don't require documenting Global Asm items.
Add run-rustfix for precedence test
Add run-rustfix to mem_replace test
Add run-rustfix to map_clone test
Add run-rustfix to large_digit_groups
Add run-rustfix to into_iter_on_ref
Add run-rustfix to infallible_destructuring_match
Add rustfix to inconsistent_digit_grouping test
Add run-rustfix to explicit_write test
Add run-rustfix to excessive_precision test
Add run-rustfix to duration_subsec test
Disable deprecated_cfg_attr lint for inner attributes
Add run-rustfix to collapsible_if test
Update Readme
Update Readme for (arguably) better readability
rustup: the features if_while_or_patterns has been stabilized
Fix comments in clippy_lints/src/len_zero.rs
readme: update travis badge to reflect migration from travis-ci.org to travis-ci.com
Remove all copyright license headers
Move cast_ref_to_mut list to correctness group
Rustftmt
Don't import ty::Ref in cast_ref_to_mut lint
Move a hint to an error message in cast_ref_to_mut lint
Add a note to cast_ref_to_mut lint
Use ty::Ref instead of ty::TyKind::Ref
cast_ref_to_mut lint
Add missing ` in default lint
Improve tests and exclude nested impls
Update `unwrap_get` code review suggestions
Update known problems
Restrict use_self on nested items
Improve `get_unwrap` suggestion
````
2019-01-15 10:40:11 +01:00
Yuki Okushi
bd1551e46e Fix tests 2019-01-15 18:02:46 +09:00
Yuki Okushi
b39e9e2d07 Change from _ to None 2019-01-15 18:02:22 +09:00
Yuki Okushi
d04f756027 Restore error message 2019-01-15 18:01:38 +09:00
Dror Levin
33ac583fea
Stabilize FileExt::read_exact_at/write_all_at
Closes #51984.
2019-01-15 10:33:39 +02:00
bors
33e6df4b62 Auto merge of #57130 - VardhanThigle:Vardhan/x86_64-fortanix-unknown-sgx-tier2_support, r=alexcrichton
Upgrade x86_64-fortanix-unknown-sgx platform support to tier 2

## Overview
1. This PR upgrades x86_64-fortanix-unknown-sgx platform support to tier 2 (std only) by setting up build automation for this target.
1. For supporting unwinding, this target needs to link to a port of LLVM's libunwind (more details could be found in #56979), which will be distributed along with the Rust binaries (similar to the extra musl objects)

### Building and copying libunwind:
We have added a new build script  (`build-x86_64-fortanix-unknown-sgx-toolchain.sh`) that will run while the container is built. This will build `libunwind.a` from git source.
While the container is built, the persistent volumes where obj/ gets created aren't yet mapped. As a workaround, we copy the built `libunwind.a` to  `obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-fortanix-unknown-sgx/lib/` after x.py runs.
 If any reviewer knows of a better solution, please do tell.

r? @Mark-Simulacrum
2019-01-15 04:06:25 +00:00
Guillaume Gomez
0d695ff330 Fix crates filtering box not being filled 2019-01-15 00:41:41 +01:00
bors
aea9f0aa97 Auto merge of #57607 - Centril:rollup, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #57043 (Fix poor worst case performance of set intersection)
 - #57480 (Clean up and fix a bug in query plumbing)
 - #57481 (provide suggestion for invalid boolean cast)
 - #57540 (Modify some parser diagnostics to continue evaluating beyond the parser)
 - #57570 (Querify local `plugin_registrar_fn` and `proc_macro_decls_static`)
 - #57572 (Unaccept `extern_in_paths`)
 - #57585 (Recover from item trailing semicolon)
 - #57589 (Add a debug_assert to Vec::set_len)

Failed merges:

r? @ghost
2019-01-14 23:00:50 +00:00
Ariel Ben-Yehuda
d38a59f8b5 fix test output changing in rebase 2019-01-15 00:27:00 +02:00
Yuki Okushi
a7623e70d5 Add error check 2019-01-15 06:56:21 +09:00
Yuki Okushi
efd111e502 Add test 2019-01-15 06:55:17 +09:00
Yuki Okushi
60a68bed7b Make UnsafeCode EarlyLintPass 2019-01-15 06:54:28 +09:00
Yuki Okushi
f18ae26840 Run lint for unsafe on the ast 2019-01-15 05:42:09 +09:00
Yuki Okushi
ea5197c664 Add PartialEq 2019-01-15 05:36:46 +09:00
timvisee
d808f938bc
Simplify 'product' factorial example 2019-01-14 21:20:01 +01:00
Mazdak Farrokhzad
8a62e393b8
Rollup merge of #57589 - scottmcm:vec-set_len-debug_assert, r=alexcrichton
Add a debug_assert to Vec::set_len

Following the precedent of https://github.com/rust-lang/rust/pull/52972, which found https://github.com/llogiq/bytecount/pull/42.

(This may well make a test fail; let's see what Travis says.)
2019-01-14 20:31:59 +01:00
Mazdak Farrokhzad
b03d414e3c
Rollup merge of #57585 - estebank:trailing-semicolon, r=petrochenkov
Recover from item trailing semicolon

CC https://github.com/rust-lang/rfcs/pull/2479

r? @petrochenkov
2019-01-14 20:31:58 +01:00
Mazdak Farrokhzad
feb48f334d
Rollup merge of #57572 - Centril:unaccept-extern-in-path, r=petrochenkov
Unaccept `extern_in_paths`

Based on completed fcp-close in https://github.com/rust-lang/rust/issues/55600, this removes `extern_in_path` (e.g. `extern::foo::bar`) from the language. The changes are primarily reversing 32db83b16e.

Closes https://github.com/rust-lang/rust/issues/55600

r? @petrochenkov
2019-01-14 20:31:57 +01:00
Mazdak Farrokhzad
2e1094429d
Rollup merge of #57570 - Xanewok:querify-some, r=Zoxc
Querify local `plugin_registrar_fn` and `proc_macro_decls_static`

Instead of calculating them as part of the `Session`, we do that in the query system.
It's also nice that these queries are already defined for external crates - here, we provide the queries for the local crate.

r? @nikomatsakis
2019-01-14 20:31:56 +01:00
Mazdak Farrokhzad
2f7a226c4d
Rollup merge of #57540 - estebank:eval-more, r=petrochenkov
Modify some parser diagnostics to continue evaluating beyond the parser

Continue evaluating further errors after parser errors on:
 - trailing type argument attribute
 - lifetime in incorrect location
 - incorrect binary literal
 - missing `for` in `impl Trait for Foo`
 - type argument in `where` clause
 - incorrect float literal
 - incorrect `..` in pattern
 - associated types
 - incorrect discriminator value variant error

and others. All of these were found by making `continue-parse-after-error` `true` by default to identify errors that would need few changes. There are now only a handful of errors that have any change with `continue-parse-after-error` enabled.

These changes make it so `rust` _won't_ stop evaluation after finishing parsing, enabling type checking errors to be displayed on the existing code without having to fix the parse errors.

Each commit has an individual diagnostic change with their corresponding tests.

CC #48724.
2019-01-14 20:31:55 +01:00
Mazdak Farrokhzad
816e31b1c6
Rollup merge of #57481 - euclio:bool-cast-suggestion, r=estebank
provide suggestion for invalid boolean cast

Also, don't suggest comparing to zero for non-numeric expressions.
2019-01-14 20:31:53 +01:00
Mazdak Farrokhzad
8c001b12cc
Rollup merge of #57480 - Zoxc:query-fix, r=michaelwoerister
Clean up and fix a bug in query plumbing

r? @michaelwoerister
2019-01-14 20:31:52 +01:00
Mazdak Farrokhzad
5bc95de47d
Rollup merge of #57043 - ssomers:master, r=alexcrichton
Fix poor worst case performance of set intersection

Specifically, intersection of asymmetrically sized sets when the large set is on the left. See also the [latest answer on stackoverflow](https://stackoverflow.com/questions/35439376/python-set-intersection-is-faster-then-rust-hashset-intersection).

Also applied to the union member, where the effect is much less but still measurable.

Formatted the changed code only, does not increase the error count reported by tidy check, and tried to adhere to the spirit of the unit tests.
2019-01-14 20:31:51 +01:00