]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #57163 - JohnHeitmann:chevron-fix, r=estebank
kennytm [Sat, 29 Dec 2018 10:50:28 +0000 (18:50 +0800)]
Rollup merge of #57163 - JohnHeitmann:chevron-fix, r=estebank

Give the crate select chevron room to breathe.

Before:
![screen shot 2018-12-27 at 10 26 10 pm](https://user-images.githubusercontent.com/4282480/50505100-9ff24300-0a26-11e9-9b74-37bdee6faf83.png)

After:
![screen shot 2018-12-27 at 10 25 57 pm](https://user-images.githubusercontent.com/4282480/50505110-a54f8d80-0a26-11e9-9fa2-7fed21773207.png)

5 years agoRollup merge of #57159 - ids1024:closed-issue, r=Centril
kennytm [Sat, 29 Dec 2018 10:50:27 +0000 (18:50 +0800)]
Rollup merge of #57159 - ids1024:closed-issue, r=Centril

Update references to closed issue

Issue #28979 was closed with a link to #55467.

5 years agoRollup merge of #57153 - estebank:doc, r=cramertj
kennytm [Sat, 29 Dec 2018 10:50:26 +0000 (18:50 +0800)]
Rollup merge of #57153 - estebank:doc, r=cramertj

Small: Fix span in char documentation

5 years agoRollup merge of #57149 - rust-lang:sgrif-patch-1, r=rkruppe
kennytm [Sat, 29 Dec 2018 10:50:24 +0000 (18:50 +0800)]
Rollup merge of #57149 - rust-lang:sgrif-patch-1, r=rkruppe

Fix typo in pin documentation

Affect is a verb, effect is a noun

5 years agoAuto merge of #57140 - estebank:str-err, r=varkor
bors [Sat, 29 Dec 2018 07:28:15 +0000 (07:28 +0000)]
Auto merge of #57140 - estebank:str-err, r=varkor

Tweaks to format string diagnostics

Add label spans and fix incorrect spans.

Fix #55155, fix #55350.

5 years agoAuto merge of #57006 - GuillaumeGomez:no-crate-filter, r=QuietMisdreavus
bors [Sat, 29 Dec 2018 01:22:04 +0000 (01:22 +0000)]
Auto merge of #57006 - GuillaumeGomez:no-crate-filter, r=QuietMisdreavus

Add no-crate filter option on rustdoc

@onur asked me about it so here it is!

r? @QuietMisdreavus

5 years agoAuto merge of #57138 - matthiaskrgr:clippy, r=oli-obk
bors [Fri, 28 Dec 2018 22:41:04 +0000 (22:41 +0000)]
Auto merge of #57138 - matthiaskrgr:clippy, r=oli-obk

submodules: update clippy from fc24fce7 to 721f688e

Fixes clippy toolstate.

Changes:
````
rustup https://github.com/rust-lang/rust/pull/57069
Rustfmt.
fix breakage from rust-lang/rust#57088
fix a couple of ftrivial typos (NFC).
update CARGO_CLIPPY_HELP string to suggest tool lints.
rustc_tools_util: add readme
rustc_tool_utils: expand Cargo.toml with a few keywords in preparation for crates.io release
Fix macro detection in `empty_loop`.
Changed `macro_backtrace()` to `in_macro()`.
Fix lint detection on macro expansion.
````

r? @oli-obk

5 years agoAuto merge of #57118 - Zoxc:query-stats, r=wesleywiser
bors [Fri, 28 Dec 2018 20:02:23 +0000 (20:02 +0000)]
Auto merge of #57118 - Zoxc:query-stats, r=wesleywiser

Add a command line flag to print some query stats

r? @michaelwoerister

5 years agosubmodules: update clippy from fc24fce7 to f7bdf500
Matthias Krüger [Thu, 27 Dec 2018 16:34:48 +0000 (17:34 +0100)]
submodules: update clippy from  fc24fce7 to f7bdf500

Fixes clippy toolstate

Changes:
````
Match on ast/hir::ExprKind::Err
Update *.stderr files
Use -Zui-testing flag
Mention S-inactive-closed PRs in the CONTRIBUTING.md
tests: fix formatting and update test output
base tests: make sure to fail CI if tests need formatting
base tests: switch to nightly toolchain before checking formatting of tests with rustfmt
rustup https://github.com/rust-lang/rust/pull/57069
Rustfmt.
fix breakage from rust-lang/rust#57088
fix a couple of ftrivial typos (NFC).
update CARGO_CLIPPY_HELP string to suggest tool lints.
rustc_tools_util: add readme
rustc_tool_utils: expand Cargo.toml with a few keywords in preparation for crates.io release
Fix macro detection in `empty_loop`.
Changed `macro_backtrace()` to `in_macro()`.
Fix lint detection on macro expansion.
````

5 years agoAuto merge of #57167 - Dylan-DPC:feature/non-zero-getters, r=SimonSapin
bors [Fri, 28 Dec 2018 15:10:17 +0000 (15:10 +0000)]
Auto merge of #57167 - Dylan-DPC:feature/non-zero-getters, r=SimonSapin

Make the getter for NonZero types into a const fn

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

Rework of #56739

cc @Lokathor

r? @oli-obk

5 years agoUpdate src/test/ui/consts/const-nonzero.rs
Oliver Scherer [Fri, 28 Dec 2018 12:15:49 +0000 (17:45 +0530)]
Update src/test/ui/consts/const-nonzero.rs

Co-Authored-By: Dylan-DPC <dylan.dpc@gmail.com>
5 years agoMake the getter for NonZero types into a const fn
dylan_DPC [Fri, 28 Dec 2018 11:28:55 +0000 (16:58 +0530)]
Make the getter for NonZero types into a const fn

5 years agoAuto merge of #57137 - cramertj:unpin-prelude, r=SimonSapin
bors [Fri, 28 Dec 2018 10:54:16 +0000 (10:54 +0000)]
Auto merge of #57137 - cramertj:unpin-prelude, r=SimonSapin

Add Unpin to std prelude, not just core

r? @alexcrichton

5 years agoAuto merge of #55519 - fhartwig:hashmap-index-example, r=Centril
bors [Fri, 28 Dec 2018 06:52:15 +0000 (06:52 +0000)]
Auto merge of #55519 - fhartwig:hashmap-index-example, r=Centril

Add example of using the indexing operator to HashMap docs

Fixes #52575

5 years agoGive the crate select chevron room to breathe.
John Heitmann [Fri, 28 Dec 2018 06:26:54 +0000 (22:26 -0800)]
Give the crate select chevron room to breathe.

5 years agoAuto merge of #57155 - petrochenkov:dcrate3, r=dtolnay
bors [Fri, 28 Dec 2018 02:54:14 +0000 (02:54 +0000)]
Auto merge of #57155 - petrochenkov:dcrate3, r=dtolnay

Resolve `$crate`s for pretty-printing at more appropriate time

Doing it in `BuildReducedGraphVisitor` wasn't a good idea, identifiers wasn't actually visited half of the time.
As a result some `$crate`s weren't resolved and were therefore pretty-printed as `$crate` literally, which turns into two tokens during re-parsing of the pretty-printed text.

Now we are visiting and resolving `$crate` identifiers in an item right before sending that item to a proc macro attribute or derive.

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

5 years agoUpdate references to closed issue
Ian Douglas Scott [Fri, 28 Dec 2018 00:49:12 +0000 (16:49 -0800)]
Update references to closed issue

Issue #28979 was closed with a link to #55467.

5 years agoAuto merge of #56999 - petrochenkov:macrecov2, r=estebank
bors [Thu, 27 Dec 2018 22:27:27 +0000 (22:27 +0000)]
Auto merge of #56999 - petrochenkov:macrecov2, r=estebank

AST/HIR: Introduce `ExprKind::Err` for better error recovery in the front-end

This way we can avoid aborting compilation if expansion produces errors and generate `ExprKind::Err`s instead.

5 years agoResolve `$crate`s for pretty-printing at more appropriate time
Vadim Petrochenkov [Thu, 27 Dec 2018 21:31:28 +0000 (00:31 +0300)]
Resolve `$crate`s for pretty-printing at more appropriate time

5 years agoAdd test demonstrating disintegration of `$crate` into `$` and `crate`
Vadim Petrochenkov [Thu, 27 Dec 2018 18:13:49 +0000 (21:13 +0300)]
Add test demonstrating disintegration of `$crate` into `$` and `crate`

5 years agoAuto merge of #56384 - scalexm:chalk, r=nikomatsakis
bors [Thu, 27 Dec 2018 19:47:56 +0000 (19:47 +0000)]
Auto merge of #56384 - scalexm:chalk, r=nikomatsakis

Implement the new-style trait solver

Final PR of what I believe to be a minimally working implementation of the new-style trait solver.

The new trait solver can be used by providing the `-Z chalk` command line flag. It is currently used everywhere in `rustc_typeck`, and for everything relying on `rustc::infer::canonical::query_response::enter_canonical_trait_query`.

The trait solver is invoked in rustc by using the `evaluate_goal` canonical query. This is not optimal because each call to `evaluate_goal` creates a new `chalk_engine::Forest`, hence rustc cannot use answers to intermediate goals produced by the root goal. We'll need to change that but I guess that's ok for now.

Some next steps, I think, are:
* handle region constraints: region constraints are computed but are completely ignored for now, I think we may need additional support from `chalk_engine` (as a side effect, types or trait references with outlive requirements cannot be proved well-formed)
* deactivate eager normalization in the presence of `-Z chalk` in order to leverage the lazy normalization strategy of the new-style trait solver
* add the remaining built-in impls (only `Sized` is supported currently)
* transition the compiler to using generic goals instead of predicates that still refer to named type parameters etc

I added a few very simple tests to check that the new solver has the right behavior, they won't be needed anymore once it is mature enough. Additionally it shows off that we get [implied bounds](https://github.com/rust-lang/rust/issues/44491) for free.

r? @nikomatsakis

5 years agoFix span in char documentation
Esteban Küber [Thu, 27 Dec 2018 19:36:05 +0000 (11:36 -0800)]
Fix span in char documentation

5 years agoSet a `def_id` in `ParamEnv` only with `-Z chalk`
scalexm [Thu, 20 Dec 2018 18:54:11 +0000 (19:54 +0100)]
Set a `def_id` in `ParamEnv` only with `-Z chalk`

5 years agoAdd tests
scalexm [Fri, 30 Nov 2018 14:07:38 +0000 (15:07 +0100)]
Add tests

5 years agoFix `tcx.environment` for inherent impls
scalexm [Fri, 30 Nov 2018 14:06:49 +0000 (15:06 +0100)]
Fix `tcx.environment` for inherent impls

5 years agoAdd `wf_clause_for_fn_def`
scalexm [Wed, 28 Nov 2018 22:29:26 +0000 (23:29 +0100)]
Add `wf_clause_for_fn_def`

5 years agoUse `TraitEngine` in `enter_canonical_trait_query`
scalexm [Wed, 28 Nov 2018 22:29:01 +0000 (23:29 +0100)]
Use `TraitEngine` in `enter_canonical_trait_query`

5 years agoHandle sub-typing in chalk-engine
scalexm [Wed, 28 Nov 2018 21:11:00 +0000 (22:11 +0100)]
Handle sub-typing in chalk-engine

5 years agoIntegrate chalk engine
scalexm [Sat, 24 Nov 2018 19:18:16 +0000 (20:18 +0100)]
Integrate chalk engine

5 years agoFix binding levels in implied bounds rules
scalexm [Sat, 24 Nov 2018 19:17:42 +0000 (20:17 +0100)]
Fix binding levels in implied bounds rules

5 years agoFix replacement of escaping bound types
scalexm [Sat, 24 Nov 2018 16:13:54 +0000 (17:13 +0100)]
Fix replacement of escaping bound types

Multiple references to the same `BoundTy` were not using the same
result.

5 years agoFix `Sized` requirement for empty tuples in `program_clauses`
scalexm [Fri, 23 Nov 2018 20:06:55 +0000 (21:06 +0100)]
Fix `Sized` requirement for empty tuples in `program_clauses`

5 years agoAdd builtin impls for `Sized` in `chalk_context::program_clauses`
scalexm [Fri, 23 Nov 2018 21:48:33 +0000 (22:48 +0100)]
Add builtin impls for `Sized` in `chalk_context::program_clauses`

5 years agoRename functions giving WF clauses for builtin types
scalexm [Fri, 23 Nov 2018 21:47:00 +0000 (22:47 +0100)]
Rename functions giving WF clauses for builtin types

5 years agoAdd utilities for creating generic types
scalexm [Fri, 23 Nov 2018 21:43:59 +0000 (22:43 +0100)]
Add utilities for creating generic types

5 years agoReturn an instantiated environment instead of a generic one
scalexm [Fri, 23 Nov 2018 20:03:27 +0000 (21:03 +0100)]
Return an instantiated environment instead of a generic one

5 years agoCorrectly lift empty lists of clauses and goals
scalexm [Fri, 23 Nov 2018 18:47:22 +0000 (19:47 +0100)]
Correctly lift empty lists of clauses and goals

5 years agoFix `visit_ex_clause_with`
scalexm [Fri, 23 Nov 2018 18:45:39 +0000 (19:45 +0100)]
Fix `visit_ex_clause_with`

The sub-visits were incorrectly combined with an `&&` instead of
an `||`.

5 years agoAdd a def-id in `ty::ParamEnv`
scalexm [Sat, 17 Nov 2018 17:56:14 +0000 (18:56 +0100)]
Add a def-id in `ty::ParamEnv`

5 years agoImplement "lifetime juggling" methods from chalk integration trait
scalexm [Fri, 23 Nov 2018 18:42:14 +0000 (19:42 +0100)]
Implement "lifetime juggling" methods from chalk integration trait

Fixes #55097.

5 years agoImplement `is_coinductive`
scalexm [Fri, 23 Nov 2018 18:16:02 +0000 (19:16 +0100)]
Implement `is_coinductive`

Fixes #55096.

5 years agoAuto merge of #56852 - kennytm:test-publish-toolstate-in-ci, r=Mark-Simulacrum
bors [Thu, 27 Dec 2018 17:16:59 +0000 (17:16 +0000)]
Auto merge of #56852 - kennytm:test-publish-toolstate-in-ci, r=Mark-Simulacrum

Added a job to dry-run the publish_toolstate.py once

Closes #56848.

Requires #56847 to be merged first.

5 years agoFix typo in pin documentation
Sean Griffin [Thu, 27 Dec 2018 15:53:43 +0000 (08:53 -0700)]
Fix typo in pin documentation

Affect is a verb, effect is a noun

5 years agoAuto merge of #56838 - Aaron1011:fix/rustdoc-infer-unify, r=nikomatsakis
bors [Thu, 27 Dec 2018 14:35:58 +0000 (14:35 +0000)]
Auto merge of #56838 - Aaron1011:fix/rustdoc-infer-unify, r=nikomatsakis

Call poly_project_and_unify_type on types that contain inference types

Commit f57247c48cb59 (Ensure that Rusdoc discovers all necessary auto
trait bounds) added a check to ensure that we only attempt to unify a
projection predicatre with inference variables. However, the check it
added was too strict - instead of checking that a type *contains* an
inference variable (e.g. '&_', 'MyType<_>'), it required the type to
*be* an inference variable (i.e. only '_' would match).

This commit relaxes the check to use 'ty.has_infer_types', ensuring that
we perform unification wherever possible.

Fixes #56822

5 years agoFix rebase and more CI failures
Vadim Petrochenkov [Thu, 27 Dec 2018 00:07:00 +0000 (03:07 +0300)]
Fix rebase and more CI failures

5 years agoAddress review comments and CI failures
Vadim Petrochenkov [Thu, 20 Dec 2018 23:58:55 +0000 (02:58 +0300)]
Address review comments and CI failures

5 years agoMake sure feature gate errors are recoverable
Vadim Petrochenkov [Thu, 20 Dec 2018 22:47:03 +0000 (01:47 +0300)]
Make sure feature gate errors are recoverable

5 years agoFix `trace_macros` and `log_syntax`
Vadim Petrochenkov [Thu, 20 Dec 2018 00:57:48 +0000 (03:57 +0300)]
Fix `trace_macros` and `log_syntax`

5 years agoGet rid of `Block::recovered`
Vadim Petrochenkov [Wed, 19 Dec 2018 23:33:56 +0000 (02:33 +0300)]
Get rid of `Block::recovered`

5 years agoDo not abort compilation if expansion produces errors
Vadim Petrochenkov [Sun, 16 Dec 2018 17:23:27 +0000 (20:23 +0300)]
Do not abort compilation if expansion produces errors

Fix a number of uncovered deficiencies in diagnostics

5 years agoAST/HIR: Introduce `ExprKind::Err` for better error recovery in the front-end
Vadim Petrochenkov [Mon, 17 Dec 2018 01:57:32 +0000 (04:57 +0300)]
AST/HIR: Introduce `ExprKind::Err` for better error recovery in the front-end

5 years agoAuto merge of #57133 - SimonSapin:zero, r=oli-obk
bors [Thu, 27 Dec 2018 12:01:08 +0000 (12:01 +0000)]
Auto merge of #57133 - SimonSapin:zero, r=oli-obk

Remove the private generic NonZero<T> wrapper type

Instead, use `#[rustc_layout_scalar_valid_range_start(1)]` directly on relevant libcore types.

5 years agoAuto merge of #57119 - jethrogb:jb/sgx-os-mod2, r=joshtriplett
bors [Thu, 27 Dec 2018 09:21:06 +0000 (09:21 +0000)]
Auto merge of #57119 - jethrogb:jb/sgx-os-mod2, r=joshtriplett

Add `io` and `arch` modules to `std::os::fortanix_sgx`

This PR adds two more (unstable) modules to `std::os::fortanix_sgx` for the `x86_64-fortanix-unknown-sgx` target.

### io
`io` allows conversion between raw file descriptors and Rust types, similar to `std::os::unix::io`.

### arch
`arch` exposes the `ENCLU[EREPORT]` and `ENCLU[EGETKEY]` instructions. The current functions are very likely not going to be the final form of these functions (see also https://github.com/fortanix/rust-sgx/issues/15), but this should be sufficient to enable experimentation in libraries. I tried using the actual types (from the [`sgx-isa` crate](https://crates.io/crates/sgx-isa)) instead of byte arrays, but that would make `std` dependent on the `bitflags` crate which I didn't want to do at this time.

5 years agoAuto merge of #57129 - RalfJung:check-bounds, r=oli-obk
bors [Thu, 27 Dec 2018 06:48:18 +0000 (06:48 +0000)]
Auto merge of #57129 - RalfJung:check-bounds, r=oli-obk

make Alloc::check_bounds_ptr private; you should use Memory::check_bounds_ptr instead

r? @oli-obk

5 years agoAdded a job to dry-run the publish_toolstate.py once
kennytm [Sat, 15 Dec 2018 15:44:46 +0000 (23:44 +0800)]
Added a job to dry-run the publish_toolstate.py once

5 years agoAdd span label to unused string formatting argument
Esteban Küber [Thu, 27 Dec 2018 04:18:41 +0000 (20:18 -0800)]
Add span label to unused string formatting argument

Fix #55350.

5 years agoPoint at correct span for arguments in format strings
Esteban Küber [Thu, 27 Dec 2018 04:05:56 +0000 (20:05 -0800)]
Point at correct span for arguments in format strings

When a format string has escaped whitespace characters format
arguments were shifted by one per each escaped character. Account
for these escaped characters when synthesizing the spans.

Fix #55155.

5 years agoAuto merge of #57069 - estebank:str-err, r=@cramertj
bors [Thu, 27 Dec 2018 02:00:17 +0000 (02:00 +0000)]
Auto merge of #57069 - estebank:str-err, r=@cramertj

Various changes to string format diagnostics

- Point at opening mismatched formatting brace
- Account for differences between raw and regular strings
- Account for differences between the code snippet and `InternedString`
- Add more tests

```
error: invalid format string: expected `'}'`, found `'t'`
  --> $DIR/ifmt-bad-arg.rs:85:1
   |
LL | ninth number: {
   |               - because of this opening brace
LL | tenth number: {}",
   | ^ expected `}` in format string
   |
   = note: if you intended to print `{`, you can escape it using `{{`
```

Fix #53837.

5 years agoVarious changes to string format diagnostics
Esteban Küber [Fri, 21 Dec 2018 06:33:16 +0000 (22:33 -0800)]
Various changes to string format diagnostics

- Point at opening mismatched formatting brace
- Account for differences between raw and regular strings
- Account for differences between the code snippet and `InternedString`
- Add more tests

5 years agoAuto merge of #57124 - sunjay:stable_duration_as_u128, r=Centril
bors [Wed, 26 Dec 2018 22:19:40 +0000 (22:19 +0000)]
Auto merge of #57124 - sunjay:stable_duration_as_u128, r=Centril

Stabilize Duration::{as_millis, as_micros, as_nanos}

Fixes #50202. :tada:

This is the stabilization PR for the `duration_as_u128` feature. I have never made one of these before so please let me know if I missed a step. I followed the [guide in the Rust Forge](https://forge.rust-lang.org/stabilization-guide.html) and also found some old stabilization PRs ([1](https://github.com/rust-lang/rust/pull/57002), [2](https://github.com/rust-lang/rust/pull/56207)) for similar features to base my work on.

5 years agoAdd Unpin to std prelude, not just core
Taylor Cramer [Wed, 26 Dec 2018 20:20:38 +0000 (12:20 -0800)]
Add Unpin to std prelude, not just core

5 years agoRemove the private generic NonZero<T> wrapper type.
Simon Sapin [Wed, 26 Dec 2018 17:27:30 +0000 (18:27 +0100)]
Remove the private generic NonZero<T> wrapper type.

Instead, use `#[rustc_layout_scalar_valid_range_start(1)]` directly
on relevant libcore types.

5 years agoAuto merge of #56534 - xfix:copied, r=@SimonSapin
bors [Wed, 26 Dec 2018 19:39:19 +0000 (19:39 +0000)]
Auto merge of #56534 - xfix:copied, r=@SimonSapin

Add unstable Iterator::copied()

Initially suggested at https://github.com/bluss/rust-itertools/pull/289, however the maintainers of itertools suggested this may be better of in a standard library.

The intent of `copied` is to avoid accidentally cloning iterator elements after doing a code refactoring which causes a structure to be no longer `Copy`. This is a relatively common pattern, as it can be seen by calling `rg --pcre2 '[.]map[(][|](?:(\w+)[|] [*]\1|&(\w+)[|] \2)[)]'` on Rust main repository. Additionally, many uses of `cloned` actually want to simply `Copy`, and changing something to be no longer copyable may introduce unnoticeable performance penalty.

Also, this makes sense because the standard library includes `[T].copy_from_slice` to pair with `[T].clone_from_slice`.

This also adds `Option::copied`, because it makes sense to pair it with `Iterator::copied`. I don't think this feature is particularly important, but it makes sense to update `Option` along with `Iterator` for consistency.

5 years agoStabilize duration_as_u128
Sunjay Varma [Tue, 25 Dec 2018 21:23:48 +0000 (14:23 -0700)]
Stabilize duration_as_u128

5 years agoAuto merge of #57108 - Mark-Simulacrum:license-remove, r=pietroalbini
bors [Wed, 26 Dec 2018 16:16:02 +0000 (16:16 +0000)]
Auto merge of #57108 - Mark-Simulacrum:license-remove, r=pietroalbini

Remove header licenses across the project

This pull request removes the header licenses from files across the Rust repository.

I've attempted to check for any remaining headers and removed all of them -- any we've missed can be removed in the future; there's nothing blocking that.

Unfortunately, not all of the changes are as basic as "removing a header" because some of them required test file updates or otherwise. However, I am fairly confident that the changes in this pull request, while wide-sweeping, are unlikely to actually make any tests fail to properly test the code; any non-script based changes were manual and carefully verified.

r? @pietroalbini cc @rust-lang/infra

5 years agoAccount for no newline before test annotations
Mark Rousskov [Wed, 26 Dec 2018 16:00:55 +0000 (09:00 -0700)]
Account for no newline before test annotations

Previously the license comment would always provide that newline but
since that's been removed this change is needed.

5 years agomake Alloc::check_bounds_ptr private; you should use Memory::check_bounds_ptr instead
Ralf Jung [Wed, 26 Dec 2018 12:18:24 +0000 (13:18 +0100)]
make Alloc::check_bounds_ptr private; you should use Memory::check_bounds_ptr instead

5 years agoAdd a tracking issue for Iterator::copied
Konrad Borowski [Wed, 26 Dec 2018 09:13:44 +0000 (10:13 +0100)]
Add a tracking issue for Iterator::copied

5 years agoAdd a tracking issue for Option::copied
Konrad Borowski [Wed, 26 Dec 2018 09:13:02 +0000 (10:13 +0100)]
Add a tracking issue for Option::copied

5 years agoRemove licenses
Mark Rousskov [Tue, 25 Dec 2018 15:56:47 +0000 (08:56 -0700)]
Remove licenses

5 years agoAuto merge of #57088 - euclio:non-camel-case-early-lint, r=estebank
bors [Tue, 25 Dec 2018 16:12:24 +0000 (16:12 +0000)]
Auto merge of #57088 - euclio:non-camel-case-early-lint, r=estebank

make non_camel_case_types an early lint

This allows us to catch these kinds of style violations much earlier, as evidenced by the large number of tests that had to be updated for this change.

5 years agoAuto merge of #56962 - nivkner:fixme_fixup4, r=pnkfelix
bors [Tue, 25 Dec 2018 13:32:31 +0000 (13:32 +0000)]
Auto merge of #56962 - nivkner:fixme_fixup4, r=pnkfelix

address some FIXME whose associated issues were marked as closed

part of #44366

5 years agoAuto merge of #56983 - ljedrz:parallel_query_tweaks, r=Zoxc
bors [Tue, 25 Dec 2018 10:52:13 +0000 (10:52 +0000)]
Auto merge of #56983 - ljedrz:parallel_query_tweaks, r=Zoxc

Parallel query tweaks

- faster stack reversal in `remove_cycle`
- insert visited queries more eagerly
- simplify stack trimming in `cycle_check`
- minor refactoring in 2 spots

5 years agoAuto merge of #57116 - kennytm:revert-56944, r=alexcrichton
bors [Tue, 25 Dec 2018 08:08:10 +0000 (08:08 +0000)]
Auto merge of #57116 - kennytm:revert-56944, r=alexcrichton

Revert #56944.

This should fix #57111, since #56944 is the only PR involving LLVM.

#57111 is caused by both the rustc and rust-std tarballs providing libLLVM.

r? @alexcrichton

5 years agoAdd `io` and `arch` modules to `std::os::fortanix_sgx`
Jethro Beekman [Tue, 25 Dec 2018 07:41:04 +0000 (13:11 +0530)]
Add `io` and `arch` modules to `std::os::fortanix_sgx`

5 years agoFix build on latest git master
Jethro Beekman [Tue, 25 Dec 2018 07:40:16 +0000 (13:10 +0530)]
Fix build on latest git master

5 years agoAdd a command line flag to print some query stats
John Kåre Alsaker [Mon, 24 Dec 2018 05:18:39 +0000 (06:18 +0100)]
Add a command line flag to print some query stats

5 years agoRevert "Rollup merge of #56944 - alexcrichton:less-thin2, r=michaelwoerister"
kennytm [Tue, 25 Dec 2018 05:25:57 +0000 (13:25 +0800)]
Revert "Rollup merge of #56944 - alexcrichton:less-thin2, r=michaelwoerister"

This reverts commit f1051b574c26e20608ff26415a3dddd13f140925, reversing
changes made to 833e0b3b8a9f1487a61152ca76f7f74a6b32cc0c.

5 years agoAuto merge of #56926 - alexcrichton:update-stdsimd, r=TimNN
bors [Tue, 25 Dec 2018 03:04:14 +0000 (03:04 +0000)]
Auto merge of #56926 - alexcrichton:update-stdsimd, r=TimNN

Update the stdsimd submodule

This brings in a few updates:

* Update wasm intrinsic naming for atomics
* Update and reimplement most simd128 wasm intrinsics
* Other misc improvements here and there, including a small start to
  AVX-512 intrinsics

5 years agoAuto merge of #56836 - alexcrichton:std-backtrace-sys, r=Mark-Simulacrum
bors [Mon, 24 Dec 2018 23:28:04 +0000 (23:28 +0000)]
Auto merge of #56836 - alexcrichton:std-backtrace-sys, r=Mark-Simulacrum

std: Use backtrace-sys from crates.io

This commit switches the standard library to using the `backtrace-sys`
crate from crates.io instead of duplicating the logic here in the Rust
repositor with the `backtrace-sys`'s crate's logic.

Eventually this will hopefully be a good step towards using the
`backtrace` crate directly from crates.io itself, but we're not quite
there yet! Hopefully this is a small incremental first step we can take.

5 years agoAuto merge of #57082 - matthiaskrgr:revert_56933, r=pietroalbini
bors [Mon, 24 Dec 2018 20:46:10 +0000 (20:46 +0000)]
Auto merge of #57082 - matthiaskrgr:revert_56933, r=pietroalbini

x.py: fixup 6130fc884bc1dff9bb835894a7bb2042c110b011, fix submodule handling

./x.py used to automatically check out the right commit when a submodule was outdated and ./x.py build was run
and submodules handling was enabled in config.toml (submodules = true).

But it threw an error:
[...]
failed to run: git submodule -q sync --progress src/tools/clippy

The commit removes the --progress from git submodule call.

Fixes #57080

5 years agox.py: fixup 6130fc884bc1dff9bb835894a7bb2042c110b011
Matthias Krüger [Mon, 24 Dec 2018 19:19:49 +0000 (20:19 +0100)]
x.py: fixup 6130fc884bc1dff9bb835894a7bb2042c110b011

./x.py used to automatically check out the right commit when a submodule was outdated and ./x.py build was run
and submodules handling was enabled in config.toml (submodules = true).

But it threw an error:
[...]
failed to run: git submodule -q sync --progress src/tools/clippy

The commit removes the --progress from git submodule call.

Fixes #57080

5 years agomake non_camel_case_types an early lint
Andy Russell [Mon, 17 Dec 2018 03:21:47 +0000 (22:21 -0500)]
make non_camel_case_types an early lint

5 years agoAdd no-crate filter option on rustdoc
Guillaume Gomez [Thu, 20 Dec 2018 12:28:55 +0000 (13:28 +0100)]
Add no-crate filter option on rustdoc

5 years agostd: Use backtrace-sys from crates.io
Alex Crichton [Sat, 15 Dec 2018 00:47:18 +0000 (16:47 -0800)]
std: Use backtrace-sys from crates.io

This commit switches the standard library to using the `backtrace-sys`
crate from crates.io instead of duplicating the logic here in the Rust
repositor with the `backtrace-sys`'s crate's logic.

Eventually this will hopefully be a good step towards using the
`backtrace` crate directly from crates.io itself, but we're not quite
there yet! Hopefully this is a small incremental first step we can take.

5 years agoAuto merge of #56770 - satyarohith:patch-1, r=Centril
bors [Mon, 24 Dec 2018 16:16:07 +0000 (16:16 +0000)]
Auto merge of #56770 - satyarohith:patch-1, r=Centril

docs(rustc): make hello() public

Running the example code [here](https://doc.rust-lang.org/rustc/what-is-rustc.html#basic-usage) throws error:
```
error[E0603]: function `hello` is private
 --> src/main.rs:4:10
  |
4 |     foo::hello();
  |          ^^^^^
```
Making  `hello()` public fixes the problem.

5 years agoAuto merge of #57094 - Centril:rollup, r=Centril
bors [Mon, 24 Dec 2018 12:31:41 +0000 (12:31 +0000)]
Auto merge of #57094 - Centril:rollup, r=Centril

Rollup of 10 pull requests

Successful merges:

 - #55470 (box: Add documentation for `From` impls)
 - #56242 (Add missing link in docs)
 - #56944 (bootstrap: Link LLVM as a dylib with ThinLTO)
 - #56978 (Add `std::os::fortanix_sgx` module)
 - #56985 (Allow testing pointers for inboundedness while forbidding dangling pointers)
 - #56986 (rustc: Move jemalloc from rustc_driver to rustc)
 - #57010 (Actually run compiletest tests on CI)
 - #57021 (Enable emission of alignment attrs for pointer params)
 - #57074 (Fix recursion limits)
 - #57085 (librustc_codegen_llvm: Don't eliminate empty structs in C ABI on linux-sparc64)

Failed merges:

r? @ghost

5 years agoRollup merge of #57085 - glaubitz:sparc64-abi-fix, r=nagisa
Mazdak Farrokhzad [Mon, 24 Dec 2018 12:29:37 +0000 (13:29 +0100)]
Rollup merge of #57085 - glaubitz:sparc64-abi-fix, r=nagisa

librustc_codegen_llvm: Don't eliminate empty structs in C ABI on linux-sparc64

This is in accordance with the SPARC Compliance Definition 2.4.1,
Page 3P-12. It says that structs of up to 8 bytes (which applies
to empty structs as well) are to be passed in one register.

5 years agoRollup merge of #57074 - Zoxc:pq-rec-limits, r=oli-obk
Mazdak Farrokhzad [Mon, 24 Dec 2018 12:29:36 +0000 (13:29 +0100)]
Rollup merge of #57074 - Zoxc:pq-rec-limits, r=oli-obk

Fix recursion limits

r? @michaelwoerister

5 years agoRollup merge of #57021 - nikic:arg-pointer-align, r=nagisa
Mazdak Farrokhzad [Mon, 24 Dec 2018 12:29:35 +0000 (13:29 +0100)]
Rollup merge of #57021 - nikic:arg-pointer-align, r=nagisa

Enable emission of alignment attrs for pointer params

Instead disable creation of assumptions during inlining using an LLVM opt flag. For non-inlined functions, this gives us alignment information, while not inserting any assumes that kill other optimizations.

The `-Z arg-align-attributes` option which previously controlled this behavior is removed.

Fixes #54982.

r? @nagisa

cc @eddyb who added the current behavior, and @scottmcm, who added the `-Z arg-align-attributes` flag.

5 years agoRollup merge of #57010 - phansch:run_compiletest_tests_on_ci, r=kennytm
Mazdak Farrokhzad [Mon, 24 Dec 2018 12:29:33 +0000 (13:29 +0100)]
Rollup merge of #57010 - phansch:run_compiletest_tests_on_ci, r=kennytm

Actually run compiletest tests on CI

I was assuming that https://github.com/rust-lang/rust/pull/56792 would
have resulted in compiletest tests being executed on CI. However, I
couldn't find any mentions of the unit test names in any CI logs.

This adds the compiletest test execution to the checktools.sh script.

5 years agoRollup merge of #56986 - alexcrichton:move-jemalloc, r=Mark-Simulacrum
Mazdak Farrokhzad [Mon, 24 Dec 2018 12:29:32 +0000 (13:29 +0100)]
Rollup merge of #56986 - alexcrichton:move-jemalloc, r=Mark-Simulacrum

rustc: Move jemalloc from rustc_driver to rustc

This commit moves jemalloc to just the rustc binary rather than the
rustc_driver shared library, enusring that it's only used for binaries
that opt-in to it like rustc rather than other binaries using
librustc_driver like rustdoc/rls/etc. This will hopefully address #56980

5 years agoRollup merge of #56985 - oli-obk:const_check_bounds, r=RalfJung
Mazdak Farrokhzad [Mon, 24 Dec 2018 12:29:31 +0000 (13:29 +0100)]
Rollup merge of #56985 - oli-obk:const_check_bounds, r=RalfJung

Allow testing pointers for inboundedness while forbidding dangling pointers

r? @RalfJung

5 years agoRollup merge of #56978 - jethrogb:jb/sgx-os-mod, r=joshtriplett
Mazdak Farrokhzad [Mon, 24 Dec 2018 12:29:30 +0000 (13:29 +0100)]
Rollup merge of #56978 - jethrogb:jb/sgx-os-mod, r=joshtriplett

Add `std::os::fortanix_sgx` module

This PR adds the `std::os::sgx` module to expose platform-specific APIs behind the `sgx_platform` feature gate.

Depends on https://github.com/rust-lang/rust/pull/56972 to be able to meaningfully build `std::os` documentation for non-standard targets.

Tracking issue: https://github.com/rust-lang/rust/issues/56975

5 years agoRollup merge of #56944 - alexcrichton:less-thin2, r=michaelwoerister
Mazdak Farrokhzad [Mon, 24 Dec 2018 12:29:28 +0000 (13:29 +0100)]
Rollup merge of #56944 - alexcrichton:less-thin2, r=michaelwoerister

bootstrap: Link LLVM as a dylib with ThinLTO

When building a distributed compiler on Linux where we use ThinLTO to
create the LLVM shared object this commit switches the compiler to
dynamically linking that LLVM artifact instead of statically linking to
LLVM. The primary goal here is to reduce CI compile times, avoiding two+
ThinLTO builds of all of LLVM. By linking dynamically to LLVM we'll
reuse the one ThinLTO step done by LLVM's build itself.

Lots of discussion about this change can be found [here] and down. A
perf run will show whether this is worth it or not!

[here]: https://github.com/rust-lang/rust/pull/53245#issuecomment-417015334

5 years agoRollup merge of #56242 - GuillaumeGomez:iterator-missing-link, r=Centril
Mazdak Farrokhzad [Mon, 24 Dec 2018 12:29:27 +0000 (13:29 +0100)]
Rollup merge of #56242 - GuillaumeGomez:iterator-missing-link, r=Centril

Add missing link in docs

r? @steveklabnik

5 years agoRollup merge of #55470 - daniellimws:box-from-docs, r=Centril
Mazdak Farrokhzad [Mon, 24 Dec 2018 12:29:26 +0000 (13:29 +0100)]
Rollup merge of #55470 - daniellimws:box-from-docs, r=Centril

box: Add documentation for `From` impls

This is a part of #51430. A brief description of the behaviour and examples are added to the documentation.

I am not sure what sort of examples to put for the `From` for `Pin` as my [code](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2015&gist=97c908f44e41c9faeffec5b61d72a03e) doesn't even manage to compile using the nightly build.

Somehow I feel that I missed out something so do let me know if more information is needed in the documentation or any of the examples require change.

5 years agoAuto merge of #57087 - Centril:rollup, r=Centril
bors [Mon, 24 Dec 2018 07:26:19 +0000 (07:26 +0000)]
Auto merge of #57087 - Centril:rollup, r=Centril

Rollup of 14 pull requests

Successful merges:

 - #56188 (enum type instead of variant suggestion unification )
 - #56342 (Improve docs for collecting into `Option`s)
 - #56916 (Fix mutable references in `static mut`)
 - #56917 (Simplify MIR generation for logical operations)
 - #56939 (Pin stabilization)
 - #56953 (Mark tuple structs as live if their constructors are used)
 - #56964 (Remove `TokenStream::JointTree`.)
 - #56966 (Correct strings for raw pointer deref and array access suggestions)
 - #57020 (Point to cause of `fn` expected return type)
 - #57032 (fix deprecation warnings in liballoc benches)
 - #57053 (Fix alignment for array indexing)
 - #57062 (Fix a comment)
 - #57067 (Stabilize min_const_unsafe_fn in 1.33)
 - #57078 (Ignore two tests on s390x)

Failed merges:

r? @ghost

5 years agoAuto merge of #57079 - matthiaskrgr:clippy, r=oli-obk
bors [Mon, 24 Dec 2018 03:41:25 +0000 (03:41 +0000)]
Auto merge of #57079 - matthiaskrgr:clippy, r=oli-obk

submodules: update clippy from a416c5e0 to fc24fce7

Fixes clippy tool state

Changes:
````
FIXME > TODO
rustup https://github.com/rust-lang/rust/pull/56992
Document map_clone known problems #498
Remove header link
test: panic at map_unit_fn.rs:202 for map() without args
rm unused file map_unit_fn.stderr
panic at map_unit_fn.rs:202 for map() without args
Change contrib.md hierarchy, link to it from readme
Workaround rust-lang/rust#43081
Teach `suspicious_else_formatting` about `if .. {..} {..}`
Link to `rustc_driver` crate in plugin
mutex_atomic: Correct location of AtomicBool and friends
Update README local run command to specify syspath
Do not mark as_ref as useless if it's followed by a method call
Changes lint sugg to bitwise and operator `&`
Run update_lints after renaming
Rename lint to MODULE_NAME_REPETITIONS
Add renaming tests
Move renaming to the right place
Implements lint for order comparisons against bool
fix(module_name_repeat): Try to register renamed lint, not valid yet
Fix an endless loop in the tests.
Fix `implicit_return` false positives.
chore(moduel_name_repeat): Rename stutter lint to module_name_repeat to avoid ableist language
Make integration tests fail on 'E0463'
base tests: make sure cargo-clippy binary can be called directly
Revert "Merge pull request #3257 from o01eg/remove-sysroot"
````

r? @oli-obk

5 years agolibrustc_codegen_llvm: Don't eliminate empty structs in C ABI on linux-sparc64
Michael Karcher [Sun, 23 Dec 2018 19:33:52 +0000 (20:33 +0100)]
librustc_codegen_llvm: Don't eliminate empty structs in C ABI on linux-sparc64

This is in accordance with the SPARC Compliance Definition 2.4.1,
Page 3P-12. It says that structs of up to 8 bytes (which applies
to empty structs as well) are to be passed in one register.