]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #57685 - pthariensflame:enhancement/pin-impl-applicability, r=without...
Mazdak Farrokhzad [Fri, 18 Jan 2019 17:06:38 +0000 (18:06 +0100)]
Rollup merge of #57685 - pthariensflame:enhancement/pin-impl-applicability, r=withoutboats

Enhance `Pin` impl applicability for `PartialEq` and `PartialOrd`.

This allows for comparing for equality or ordering a `Pin<P>` and a `Pin<Q>` as long as `P` and `Q` are correspondingly comparable themselves *even when `P` and `Q` are different types*.
An example might be comparing a `Pin<&mut OsString>` to a `Pin<&mut PathBuf>`, which might arise from pin projections from a pair of larger contexts that aren't `Unpin`.

5 years agoRollup merge of #57683 - xfix:patch-15, r=QuietMisdreavus
Mazdak Farrokhzad [Fri, 18 Jan 2019 17:06:37 +0000 (18:06 +0100)]
Rollup merge of #57683 - xfix:patch-15, r=QuietMisdreavus

Document Unpin in std::prelude documentation

5 years agoRollup merge of #57654 - ehuss:fs-links, r=alexcrichton
Mazdak Farrokhzad [Fri, 18 Jan 2019 17:06:36 +0000 (18:06 +0100)]
Rollup merge of #57654 - ehuss:fs-links, r=alexcrichton

Add some links in std::fs.

A few items were referenced, but did not have links.

5 years agoRollup merge of #57646 - GuillaumeGomez:fix-css, r=QuietMisdreavus
Mazdak Farrokhzad [Fri, 18 Jan 2019 17:06:34 +0000 (18:06 +0100)]
Rollup merge of #57646 - GuillaumeGomez:fix-css, r=QuietMisdreavus

Fixes text becoming invisible when element targetted

Fixes #57628.

r? @QuietMisdreavus

5 years agoRollup merge of #57636 - GuillaumeGomez:fix-sources-sidebar, r=QuietMisdreavus
Mazdak Farrokhzad [Fri, 18 Jan 2019 17:06:33 +0000 (18:06 +0100)]
Rollup merge of #57636 - GuillaumeGomez:fix-sources-sidebar, r=QuietMisdreavus

Fix sources sidebar not showing up

Fixes #57601.

The order of imports made it so that the sidebar creation was called before the sidebar sources were created. Like this, when the sources are loaded, they create the sidebar as expected.

r? @QuietMisdreavus

5 years agoRollup merge of #57551 - petrochenkov:regrtest, r=nikomatsakis
Mazdak Farrokhzad [Fri, 18 Jan 2019 17:06:32 +0000 (18:06 +0100)]
Rollup merge of #57551 - petrochenkov:regrtest, r=nikomatsakis

resolve: Add a test for issue #57539

Add a test for the bugfix regression reported in https://github.com/rust-lang/rust/issues/57539

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

5 years agoRollup merge of #57357 - frewsxcv:frewsxcv-partial-eq, r=QuietMisdreavus
Mazdak Farrokhzad [Fri, 18 Jan 2019 17:06:30 +0000 (18:06 +0100)]
Rollup merge of #57357 - frewsxcv:frewsxcv-partial-eq, r=QuietMisdreavus

Cleanup PartialEq docs.

- Cleanup the `impl PartialEq<BookFormat> for Book` implementation
- Implement `impl PartialEq<Book> for BookFormat` so it’s symmetric
  - Fixes https://github.com/rust-lang/rust/issues/53844.
- Removes the last example since it appears to be redundant with the
  previous two examples.

5 years agoRollup merge of #57340 - eqrion:doc/c_variadic, r=Mark-Simulacrum
Mazdak Farrokhzad [Fri, 18 Jan 2019 17:06:29 +0000 (18:06 +0100)]
Rollup merge of #57340 - eqrion:doc/c_variadic, r=Mark-Simulacrum

Use correct tracking issue for c_variadic

Fixes #57306

5 years agoRollup merge of #56594 - sdroege:c_void-is-not-never, r=TimNN
Mazdak Farrokhzad [Fri, 18 Jan 2019 17:06:26 +0000 (18:06 +0100)]
Rollup merge of #56594 - sdroege:c_void-is-not-never, r=TimNN

Remove confusing comment about ideally using `!` for `c_void`

Using `!` for `c_void` would have the problem that pointers and
potentially references to an uninhabited type would be created, and at
least for references this is UB.

In addition document that newtype wrappers around `c_void` can be used
safely in place of `extern type` until the latter is stabilized.

----

I'm not 100% sure about the usage for opaque types as the [nomicon](https://doc.rust-lang.org/nomicon/ffi.html#representing-opaque-structs) still recommends using `#[repr(C)] pub struct Foo { _private: [u8; 0] }` but it seems like these two should be equivalent in the end? Also the `#[repr(C)]` (in both cases) should be unneeded because such types never being passed by value, never being dereferenced but only passed around as pointer or reference, so the representation of (*values* of) the type itself should not matter at all?

Also in context of `c_void` and `!` the second unresolved question in the [`extern type`](https://github.com/rust-lang/rust/issues/43467) stabilization ticket seems relevant

> In [std's](https://github.com/rust-lang/rust/blob/164619a8cfe6d376d25bd3a6a9a5f2856c8de64d/src/libstd/os/raw.rs#L59-L64) source, it is mentioned that LLVM expects i8* for C's void*.
> We'd need to continue to hack this for the two c_voids in std and libc.
> But perhaps this should be done across-the-board for all extern types?
> Somebody should check what Clang does.

Please correct me if my understanding is wrong and everything's actually fine as is.

5 years agoAuto merge of #57065 - Zoxc:graph-tweaks, r=michaelwoerister
bors [Fri, 18 Jan 2019 11:34:11 +0000 (11:34 +0000)]
Auto merge of #57065 - Zoxc:graph-tweaks, r=michaelwoerister

Optimize try_mark_green and eliminate the lock on dep node colors

Blocked on https://github.com/rust-lang/rust/pull/56614

r? @michaelwoerister

5 years agoAuto merge of #56996 - clarcharr:spin_loop_hint, r=KodrAus
bors [Fri, 18 Jan 2019 07:36:13 +0000 (07:36 +0000)]
Auto merge of #56996 - clarcharr:spin_loop_hint, r=KodrAus

Move spin_loop_hint to core::hint module

As mentioned in #55002. The new name is kept unstable to decide whether the function should have `_hint` in its name.

5 years agoAuto merge of #57694 - pietroalbini:revert-beta-on-master, r=pietroalbini
bors [Thu, 17 Jan 2019 10:15:57 +0000 (10:15 +0000)]
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

5 years agoRevert "Auto merge of #57670 - rust-lang:beta-next, r=Mark-Simulacrum"
Pietro Albini [Thu, 17 Jan 2019 09:48:10 +0000 (10:48 +0100)]
Revert "Auto merge of #57670 - rust-lang:beta-next, r=Mark-Simulacrum"

This reverts commit 722b4d695964906807b12379577bce5ee3d23e08, reversing
changes made to 956dba47d33fc8b2bdabcd50e5bfed264b570382.

5 years agoAuto merge of #57520 - alexreg:tidy-copyright-lint, r=Mark-Simulacrum
bors [Thu, 17 Jan 2019 07:36:37 +0000 (07:36 +0000)]
Auto merge of #57520 - alexreg:tidy-copyright-lint, r=Mark-Simulacrum

Add lint for copyright headers to 'tidy' tool

r? @Mark-Simulacrum

CC @centril

5 years agoFix tidy errors.
Alexander Ronald Altman [Thu, 17 Jan 2019 05:03:29 +0000 (23:03 -0600)]
Fix tidy errors.

5 years agoAuto merge of #57670 - rust-lang:beta-next, r=Mark-Simulacrum
bors [Thu, 17 Jan 2019 05:00:14 +0000 (05:00 +0000)]
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

5 years agoAuto merge of #56869 - GuillaumeGomez:index-size-reduction, r=QuietMisdreavus
bors [Thu, 17 Jan 2019 02:12:17 +0000 (02:12 +0000)]
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

5 years agoEnhance `Pin` impl applicability for `PartialEq` and `PartialOrd`.
Alexander Ronald Altman [Thu, 17 Jan 2019 02:10:18 +0000 (20:10 -0600)]
Enhance `Pin` impl applicability for `PartialEq` and `PartialOrd`.

5 years agoEnd fixing search index minification
Guillaume Gomez [Sun, 13 Jan 2019 23:46:11 +0000 (00:46 +0100)]
End fixing search index minification

5 years agoMinify search-index in one pass
Guillaume Gomez [Thu, 10 Jan 2019 20:26:41 +0000 (21:26 +0100)]
Minify search-index in one pass

5 years agoReduce search-index.js size
Guillaume Gomez [Sun, 16 Dec 2018 01:35:39 +0000 (02:35 +0100)]
Reduce search-index.js size

5 years agoDocument Unpin in std::prelude documentation
Konrad Borowski [Wed, 16 Jan 2019 23:39:15 +0000 (00:39 +0100)]
Document Unpin in std::prelude documentation

5 years agoAuto merge of #57392 - Xanewok:always-calc-glob-map, r=petrochenkov
bors [Wed, 16 Jan 2019 23:25:41 +0000 (23:25 +0000)]
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.

5 years agoallow unused warnings related to rustc_layout_scalar_valid_range_start
Pietro Albini [Wed, 16 Jan 2019 16:55:23 +0000 (17:55 +0100)]
allow unused warnings related to rustc_layout_scalar_valid_range_start

5 years agoprepare beta 1.33.0
Pietro Albini [Wed, 16 Jan 2019 16:18:44 +0000 (17:18 +0100)]
prepare beta 1.33.0

5 years agoAuto merge of #57321 - petrochenkov:atokens, r=nikomatsakis
bors [Wed, 16 Jan 2019 15:01:20 +0000 (15:01 +0000)]
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.

5 years agoAuto merge of #57416 - alexcrichton:remove-platform-intrinsics, r=nagisa
bors [Wed, 16 Jan 2019 12:15:10 +0000 (12:15 +0000)]
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!

5 years agoUpdated Book and Reference submodules.
Alexander Regueiro [Sun, 13 Jan 2019 15:43:09 +0000 (15:43 +0000)]
Updated Book and Reference submodules.

5 years agoAdd some links in std::fs.
Eric Huss [Wed, 16 Jan 2019 02:46:09 +0000 (18:46 -0800)]
Add some links in std::fs.

A few items were referenced, but did not have links.

5 years agodemonstrate symmetry
Corey Farwell [Wed, 16 Jan 2019 02:21:24 +0000 (21:21 -0500)]
demonstrate symmetry

5 years agoFixes text becoming invisible when element targetted
Guillaume Gomez [Tue, 15 Jan 2019 22:21:10 +0000 (23:21 +0100)]
Fixes text becoming invisible when element targetted

5 years agoMove spin_loop_hint to core::hint module
Clar Fon [Wed, 19 Dec 2018 21:43:29 +0000 (16:43 -0500)]
Move spin_loop_hint to core::hint module

5 years agoAuto merge of #57629 - matthiaskrgr:clippy_submodule_upd, r=oli-obk
bors [Tue, 15 Jan 2019 18:41:42 +0000 (18:41 +0000)]
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
````

5 years agoFix sources sidebar not showing up
Guillaume Gomez [Tue, 15 Jan 2019 16:57:06 +0000 (17:57 +0100)]
Fix sources sidebar not showing up

5 years agoAuto merge of #57630 - Centril:rollup, r=Centril
bors [Tue, 15 Jan 2019 13:56:16 +0000 (13:56 +0000)]
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

5 years agoRollup merge of #57614 - GuillaumeGomez:fix-crate-filtering, r=QuietMisdreavus
Mazdak Farrokhzad [Tue, 15 Jan 2019 11:42:14 +0000 (12:42 +0100)]
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

5 years agoRollup merge of #57608 - timvisee:master, r=frewsxcv
Mazdak Farrokhzad [Tue, 15 Jan 2019 11:42:13 +0000 (12:42 +0100)]
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.

5 years agoRollup merge of #57587 - Aaron1011:fix/const-pat-ice, r=alexcrichton
Mazdak Farrokhzad [Tue, 15 Jan 2019 11:42:12 +0000 (12:42 +0100)]
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.

5 years agoRollup merge of #57579 - stjepang:once-with, r=SimonSapin
Mazdak Farrokhzad [Tue, 15 Jan 2019 11:42:10 +0000 (12:42 +0100)]
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.

5 years agoRollup merge of #57467 - JohnTitor:implement-the-check-attribute-1, r=oli-obk
Mazdak Farrokhzad [Tue, 15 Jan 2019 11:42:08 +0000 (12:42 +0100)]
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

5 years agoRollup merge of #57456 - fintelia:patch-4, r=dtolnay
Mazdak Farrokhzad [Tue, 15 Jan 2019 11:42:07 +0000 (12:42 +0100)]
Rollup merge of #57456 - fintelia:patch-4, r=dtolnay

RawVec doesn't always abort on allocation errors

5 years agoRollup merge of #57352 - arielb1:no-manual-markers, r=nikomatsakis
Mazdak Farrokhzad [Tue, 15 Jan 2019 11:42:06 +0000 (12:42 +0100)]
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

5 years agoRollup merge of #56044 - matthewjasper:function-param-drop-order, r=cramertj
Mazdak Farrokhzad [Tue, 15 Jan 2019 11:42:04 +0000 (12:42 +0100)]
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.

5 years agoAuto merge of #57625 - drrlvn:patch-1, r=Centril
bors [Tue, 15 Jan 2019 11:18:24 +0000 (11:18 +0000)]
Auto merge of #57625 - drrlvn:patch-1, r=Centril

Stabilize FileExt::read_exact_at/write_all_at

r? alexcrichton

Closes #51984.

5 years agosubmodules: update clippy from c63b6349 to 1b89724b
Matthias Krüger [Tue, 15 Jan 2019 09:40:11 +0000 (10:40 +0100)]
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
````

5 years agoAddress comments
John Kåre Alsaker [Tue, 15 Jan 2019 09:39:35 +0000 (10:39 +0100)]
Address comments

5 years agoOptimize try_mark_green and eliminate the lock on dep node colors
John Kåre Alsaker [Sat, 22 Dec 2018 17:03:40 +0000 (18:03 +0100)]
Optimize try_mark_green and eliminate the lock on dep node colors

5 years agoFix tests
Yuki Okushi [Tue, 15 Jan 2019 09:02:46 +0000 (18:02 +0900)]
Fix tests

5 years agoChange from _ to None
Yuki Okushi [Tue, 15 Jan 2019 09:02:22 +0000 (18:02 +0900)]
Change from _ to None

5 years agoRestore error message
Yuki Okushi [Tue, 15 Jan 2019 09:01:38 +0000 (18:01 +0900)]
Restore error message

5 years agoStabilize FileExt::read_exact_at/write_all_at
Dror Levin [Tue, 15 Jan 2019 08:33:39 +0000 (10:33 +0200)]
Stabilize FileExt::read_exact_at/write_all_at

Closes #51984.

5 years agoAuto merge of #57130 - VardhanThigle:Vardhan/x86_64-fortanix-unknown-sgx-tier2_suppor...
bors [Tue, 15 Jan 2019 04:06:25 +0000 (04:06 +0000)]
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

5 years agoFix crates filtering box not being filled
Guillaume Gomez [Mon, 14 Jan 2019 23:41:41 +0000 (00:41 +0100)]
Fix crates filtering box not being filled

5 years agoAuto merge of #57607 - Centril:rollup, r=Centril
bors [Mon, 14 Jan 2019 23:00:50 +0000 (23:00 +0000)]
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

5 years agofix test output changing in rebase
Ariel Ben-Yehuda [Mon, 14 Jan 2019 22:26:50 +0000 (00:26 +0200)]
fix test output changing in rebase

5 years agoAdd error check
Yuki Okushi [Mon, 14 Jan 2019 21:56:21 +0000 (06:56 +0900)]
Add error check

5 years agoAdd test
Yuki Okushi [Mon, 14 Jan 2019 21:55:17 +0000 (06:55 +0900)]
Add test

5 years agoMake UnsafeCode EarlyLintPass
Yuki Okushi [Mon, 14 Jan 2019 21:54:28 +0000 (06:54 +0900)]
Make UnsafeCode EarlyLintPass

5 years agoRun lint for unsafe on the ast
Yuki Okushi [Mon, 14 Jan 2019 20:42:09 +0000 (05:42 +0900)]
Run lint for unsafe on the ast

5 years agoAdd PartialEq
Yuki Okushi [Mon, 14 Jan 2019 20:36:46 +0000 (05:36 +0900)]
Add PartialEq

5 years agoSimplify 'product' factorial example
timvisee [Mon, 14 Jan 2019 20:20:01 +0000 (21:20 +0100)]
Simplify 'product' factorial example

5 years agoRollup merge of #57589 - scottmcm:vec-set_len-debug_assert, r=alexcrichton
Mazdak Farrokhzad [Mon, 14 Jan 2019 19:31:59 +0000 (20:31 +0100)]
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.)

5 years agoRollup merge of #57585 - estebank:trailing-semicolon, r=petrochenkov
Mazdak Farrokhzad [Mon, 14 Jan 2019 19:31:58 +0000 (20:31 +0100)]
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

5 years agoRollup merge of #57572 - Centril:unaccept-extern-in-path, r=petrochenkov
Mazdak Farrokhzad [Mon, 14 Jan 2019 19:31:57 +0000 (20:31 +0100)]
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 https://github.com/rust-lang/rust/commit/32db83b16e06cb5cca72d0e6a648a8008eda0fac.

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

r? @petrochenkov

5 years agoRollup merge of #57570 - Xanewok:querify-some, r=Zoxc
Mazdak Farrokhzad [Mon, 14 Jan 2019 19:31:56 +0000 (20:31 +0100)]
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

5 years agoRollup merge of #57540 - estebank:eval-more, r=petrochenkov
Mazdak Farrokhzad [Mon, 14 Jan 2019 19:31:55 +0000 (20:31 +0100)]
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.

5 years agoRollup merge of #57481 - euclio:bool-cast-suggestion, r=estebank
Mazdak Farrokhzad [Mon, 14 Jan 2019 19:31:53 +0000 (20:31 +0100)]
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.

5 years agoRollup merge of #57480 - Zoxc:query-fix, r=michaelwoerister
Mazdak Farrokhzad [Mon, 14 Jan 2019 19:31:52 +0000 (20:31 +0100)]
Rollup merge of #57480 - Zoxc:query-fix, r=michaelwoerister

Clean up and fix a bug in query plumbing

r? @michaelwoerister

5 years agoRollup merge of #57043 - ssomers:master, r=alexcrichton
Mazdak Farrokhzad [Mon, 14 Jan 2019 19:31:51 +0000 (20:31 +0100)]
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.

5 years agoAuto merge of #57559 - ehuss:update-cargo, r=alexcrichton
bors [Mon, 14 Jan 2019 18:25:46 +0000 (18:25 +0000)]
Auto merge of #57559 - ehuss:update-cargo, r=alexcrichton

Update cargo

13 commits in 34320d212dca8cd27d06ce93c16c6151f46fcf2e..2b4a5f1f0bb6e13759e88ea9512527b0beba154f
2019-01-03 19:12:38 +0000 to 2019-01-12 04:13:12 +0000
- Add test for publish with [patch] + cleanup. (rust-lang/cargo#6544)
- Fix clippy warning (rust-lang/cargo#6546)
- Revert "Workaround by using yesterday's nightly" (rust-lang/cargo#6540)
- Adding feature-flags to `cargo publish` and `cargo package` (rust-lang/cargo#6453)
- Fix the Travis CI badge (rust-lang/cargo#6530)
- Add helpful text for Windows exceptions like Unix (rust-lang/cargo#6532)
- Report fix bugs to Rust instead of Cargo (rust-lang/cargo#6531)
- --{example,bin,bench,test} with no argument now lists all available targets (rust-lang/cargo#6505)
- Rebuild on mid build file modification (rust-lang/cargo#6484)
- Derive Clone for TomlDependency (rust-lang/cargo#6527)
- publish: rework the crates.io detection logic. (rust-lang/cargo#6525)
- avoid duplicates in ignore files (rust-lang/cargo#6521)
- Rustflags in metadata (rust-lang/cargo#6503)

r? @alexcrichton

5 years agorustc: Remove platform intrinsics crate
Alex Crichton [Mon, 7 Jan 2019 16:18:32 +0000 (08:18 -0800)]
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!

5 years agoAdd another feature(iter_once_with)
Stjepan Glavina [Mon, 14 Jan 2019 16:36:34 +0000 (17:36 +0100)]
Add another feature(iter_once_with)

5 years agoAdd feature(iter_once_with)
Stjepan Glavina [Mon, 14 Jan 2019 16:20:41 +0000 (17:20 +0100)]
Add feature(iter_once_with)

5 years agoAuto merge of #57592 - Centril:rollup, r=Centril
bors [Mon, 14 Jan 2019 13:03:24 +0000 (13:03 +0000)]
Auto merge of #57592 - Centril:rollup, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #57232 (Parallelize and optimize parts of HIR map creation)
 - #57418 (MetadataOnlyCodegenBackend: run the collector only once)
 - #57465 (Stabilize cfg_target_vendor)
 - #57477 (clarify resolve typo suggestion)
 - #57556 (privacy: Fix private-in-public check for existential types)
 - #57584 (Remove the `connect_timeout_unroutable` test.)

Failed merges:

r? @ghost

5 years agoRemove unnecessary mut
Stjepan Glavina [Mon, 14 Jan 2019 11:23:50 +0000 (12:23 +0100)]
Remove unnecessary mut

5 years agoRollup merge of #57584 - nnethercote:rm-connect_timeout_unroutable, r=sfackler
Mazdak Farrokhzad [Mon, 14 Jan 2019 10:31:55 +0000 (11:31 +0100)]
Rollup merge of #57584 - nnethercote:rm-connect_timeout_unroutable, r=sfackler

Remove the `connect_timeout_unroutable` test.

It requires an unreachable IP address, but there is no such thing, and
this has caused it to fail for multiple people.

Fixes #44698, fixes #50065.

r? @sfackler

5 years agoRollup merge of #57556 - petrochenkov:privexist, r=arielb1
Mazdak Farrokhzad [Mon, 14 Jan 2019 10:31:54 +0000 (11:31 +0100)]
Rollup merge of #57556 - petrochenkov:privexist, r=arielb1

privacy: Fix private-in-public check for existential types

Fixes https://github.com/rust-lang/rust/issues/53546 (regression from https://github.com/rust-lang/rust/pull/56878)

r? @arielb1

5 years agoRollup merge of #57477 - euclio:clarify-lev-suggestion, r=zackmdavis
Mazdak Farrokhzad [Mon, 14 Jan 2019 10:31:53 +0000 (11:31 +0100)]
Rollup merge of #57477 - euclio:clarify-lev-suggestion, r=zackmdavis

clarify resolve typo suggestion

Include the kind of the binding that we're suggesting, and use a
structured suggestion.

Fixes #53445.

5 years agoRollup merge of #57465 - jethrogb:jb/stablize-cfg-target-vendor, r=joshtriplett,Centril
Mazdak Farrokhzad [Mon, 14 Jan 2019 10:31:52 +0000 (11:31 +0100)]
Rollup merge of #57465 - jethrogb:jb/stablize-cfg-target-vendor, r=joshtriplett,Centril

Stabilize cfg_target_vendor

This stabilizes the use of `cfg(target_vendor = "...")` and removes the corresponding `cfg_target_vendor` feature. Other unstable cfgs remain behind their existing feature gates.

This functionality was added back in 2015 in #28612 to complete the coverage of target tuples (`<arch><sub>-<vendor>-<os>-<env>`). [RFC 131](https://github.com/rust-lang/rfcs/blob/master/text/0131-target-specification.md) governs the target specification, not including `target_vendor` seems to have just been an oversight. `target_os`, `target_family`, and `target_arch` are stable as of 1.0.0. `target_env` was also not mentioned in RFC 131, was added in #24777, never behind a feature_gate, and insta-stable at 1.1.0.

The functionality is tested in [test/run-pass/cfg/cfg-target-vendor.rs](https://github.com/rust-lang/rust/blob/master/src/test/run-pass/cfg/cfg-target-vendor.rs).

Closes #29718

5 years agoRollup merge of #57418 - lqd:collector_query, r=michaelwoerister
Mazdak Farrokhzad [Mon, 14 Jan 2019 10:31:50 +0000 (11:31 +0100)]
Rollup merge of #57418 - lqd:collector_query, r=michaelwoerister

MetadataOnlyCodegenBackend: run the collector only once

Use the `collect_and_partition_mono_items` query to avoid calling the collector directly twice.

Fixes #57406.

5 years agoRollup merge of #57232 - Zoxc:par-collector-misc, r=michaelwoerister
Mazdak Farrokhzad [Mon, 14 Jan 2019 10:31:49 +0000 (11:31 +0100)]
Rollup merge of #57232 - Zoxc:par-collector-misc, r=michaelwoerister

Parallelize and optimize parts of HIR map creation

r? @michaelwoerister

5 years agoAuto merge of #57322 - Centril:stabilize-identity, r=SimonSapin
bors [Mon, 14 Jan 2019 10:22:22 +0000 (10:22 +0000)]
Auto merge of #57322 - Centril:stabilize-identity, r=SimonSapin

Stabilize core::convert::identity

r? @SimonSapin

fixes https://github.com/rust-lang/rust/issues/53500

This is waiting for FCP to complete but in the interim it would be good to review.

5 years agoStabilize `cfg_target_vendor`, #29718
Jethro Beekman [Wed, 9 Jan 2019 08:00:34 +0000 (13:30 +0530)]
Stabilize `cfg_target_vendor`, #29718

5 years agoAdd additional human-readable cfg strings to rustdoc
Jethro Beekman [Wed, 9 Jan 2019 07:59:45 +0000 (13:29 +0530)]
Add additional human-readable cfg strings to rustdoc

5 years agoAdd a debug_assert to Vec::set_len
Scott McMurray [Sat, 15 Dec 2018 05:41:18 +0000 (21:41 -0800)]
Add a debug_assert to Vec::set_len

5 years agoAuto merge of #57387 - euclio:nonstandard-style-suggestions, r=oli-obk
bors [Mon, 14 Jan 2019 06:35:51 +0000 (06:35 +0000)]
Auto merge of #57387 - euclio:nonstandard-style-suggestions, r=oli-obk

Use structured suggestions for nonstandard style lints

This PR modifies the lints in the nonstandard_style group to use structured suggestions. Note that there's a bit of tricky span calculation going on for the `crate_name` attribute. It also simplifies the code a bit: I don't think the "fallback" suggestions for these lints can actually be triggered.

Fixes #48103.
Fixes #52414.

5 years agoAdd 'rustc-env:RUST_BACKTRACE=0' to const-pat-ice test
Aaron Hill [Mon, 14 Jan 2019 06:16:27 +0000 (01:16 -0500)]
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.

5 years agoAuto merge of #57381 - estebank:if-else-308, r=nikomatsakis
bors [Mon, 14 Jan 2019 03:49:25 +0000 (03:49 +0000)]
Auto merge of #57381 - estebank:if-else-308, r=nikomatsakis

Tweak output of type mismatch between "then" and `else` `if` arms

```
error[E0308]: if and else have incompatible types
  --> $DIR/if-else-type-mismatch.rs:5:9
   |
LL |       let _ = if true {
   |  _____________-
LL | |         42i32
   | |         ----- expected because of this
LL | |     } else {
LL | |         42u32
   | |         ^^^^^ expected i32, found u32
LL | |     };
   | |_____- if and else have incompatible types
   |
   = note: expected type `i32`
              found type `u32`

error[E0308]: if and else have incompatible types
  --> file.rs:2:38
   |
LL |     let _ = if false { 3u8; } else { 3u8 };
   |                        ----          ^^^ expected (), found u8
   |                        |  |
   |                        |  help: consider removing this semicolon
   |                        expected because of this
   |
   = note: expected type `()`
              found type `u8`

error[E0308]: if and else have incompatible types
  --> file.rs:3:37
   |
LL |     let _ = if false { 3u8 } else { 3u8; };
   |                        ---          ^^^-
   |                        |            |  |
   |                        |            |  help: consider removing this semicolon
   |                        |            expected u8, found ()
   |                        expected because of this
   |
   = note: expected type `u8`
              found type `()`

error[E0308]: if and else have incompatible types
  --> file.rs:4:37
   |
LL |     let _ = if false { 3i8 } else { 3u8 };
   |                        ---          ^^^ expected i8, found u8
   |                        |
   |                        expected because of this
   |
   = note: expected type `i8`
              found type `u8`
```

Fix #57348.

5 years agoParallelize and optimize parts of HIR map creation
John Kåre Alsaker [Wed, 6 Jun 2018 20:13:52 +0000 (22:13 +0200)]
Parallelize and optimize parts of HIR map creation

5 years agoSuggest removal of semicolon when appropriate
Esteban Küber [Mon, 7 Jan 2019 01:21:43 +0000 (17:21 -0800)]
Suggest removal of semicolon when appropriate

5 years agoTweak output of type mismatch between "then" and `else` `if` arms
Esteban Küber [Sun, 6 Jan 2019 21:37:03 +0000 (13:37 -0800)]
Tweak output of type mismatch between "then" and `else` `if` arms

5 years agoRecover from item trailing semicolon
Esteban Küber [Mon, 14 Jan 2019 01:29:32 +0000 (17:29 -0800)]
Recover from item trailing semicolon

5 years agoAuto merge of #56954 - hug-dev:armv8m-main-ci, r=alexcrichton
bors [Mon, 14 Jan 2019 00:59:54 +0000 (00:59 +0000)]
Auto merge of #56954 - hug-dev:armv8m-main-ci, r=alexcrichton

Add dist builder for Armv8-M Mainline

This commit adds the Armv8-M Mainline target in the list of targets that
get their dist components built. It also update the build-manifest so
that this target gets also its dist components uploaded.

I took example on other pull requests doing the same thing for another target to make the changes. Please feel free to comment if things needs to be added or removed.

Doing `./x.py dist --target thumbv8m.main-none-eabi` worked locally so I assume that this will also work on the CI.
It will (I think) however need a new release of alexcrichton/cc-rs to include the pull request alexcrichton/cc-rs#363 @alexcrichton

I hope to do the HardFloat version (`thumbv8m.main-none-eabihf`) and Baseline (`thumbv8m.base-none-eabi`) later, as fixes need to be done on compiler-builtins first to support those.

5 years agoFix failing test
Stjepan Glavina [Sun, 13 Jan 2019 23:45:57 +0000 (00:45 +0100)]
Fix failing test

5 years agoRetain original pass order
Igor Matuszewski [Sun, 13 Jan 2019 22:55:47 +0000 (23:55 +0100)]
Retain original pass order

It shouldn't matter, but hey - better safe than sorry!

5 years agoQuerify local plugin_registrar_fn
Igor Matuszewski [Sun, 13 Jan 2019 00:06:50 +0000 (01:06 +0100)]
Querify local plugin_registrar_fn

5 years agoQuerify local proc_macro_decls_static
Igor Matuszewski [Sat, 12 Jan 2019 20:49:18 +0000 (21:49 +0100)]
Querify local proc_macro_decls_static

5 years agoRemove the `connect_timeout_unroutable` test.
Nicholas Nethercote [Sun, 13 Jan 2019 22:24:52 +0000 (09:24 +1100)]
Remove the `connect_timeout_unroutable` test.

It requires an unreachable IP address, but there is no such thing, and
this has caused it to fail for multiple people.

Fixes #44698, fixes #50065.

5 years agoAuto merge of #57580 - Centril:rollup, r=Centril
bors [Sun, 13 Jan 2019 22:20:43 +0000 (22:20 +0000)]
Auto merge of #57580 - Centril:rollup, r=Centril

Rollup of 4 pull requests

Successful merges:

 - #56874 (Simplify foreign type rendering.)
 - #57113 (Move diagnostics out from QueryJob and optimize for the case with no diagnostics)
 - #57366 (Point at match discriminant on type error in match arm pattern)
 - #57538 (librustc_mir: Fix ICE with slice patterns)

Failed merges:

 - #57381 (Tweak output of type mismatch between "then" and `else` `if` arms)

r? @ghost

5 years agoFix intradoc link and update issue number
Stjepan Glavina [Sun, 13 Jan 2019 20:24:15 +0000 (21:24 +0100)]
Fix intradoc link and update issue number