]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #67148 - Centril:ty-polish, r=estebank
Mazdak Farrokhzad [Sun, 22 Dec 2019 01:40:00 +0000 (02:40 +0100)]
Rollup merge of #67148 - Centril:ty-polish, r=estebank

 Refactor type & bounds parsing thoroughly

PR is based on https://github.com/rust-lang/rust/pull/67131 with first one from this PR being ` extract parse_ty_tuple_or_parens`.

Also fixes #67146.

r? @estebank

4 years agoWarn against relying on ?Sized being last
Mark Rousskov [Sun, 22 Dec 2019 01:35:41 +0000 (20:35 -0500)]
Warn against relying on ?Sized being last

4 years agoImplement rustfmt running manually using ignore crate
Mark Rousskov [Wed, 18 Dec 2019 15:52:10 +0000 (10:52 -0500)]
Implement rustfmt running manually using ignore crate

This replaces cargo-fmt with rustfmt with --skip-children which should
allow us to format code without running into rust-lang/rustfmt#3930.

This also bumps up the version of rustfmt used to a more recent one.

4 years agoInclude formatting check in the test step for tidy.
Adam Perry [Thu, 31 Oct 2019 02:23:50 +0000 (19:23 -0700)]
Include formatting check in the test step for tidy.

4 years agoFormat src/librustc_fs_util.
Adam Perry [Mon, 4 Nov 2019 16:28:40 +0000 (08:28 -0800)]
Format src/librustc_fs_util.

In total it's about 100 lines of code and has received less than 5 commits in 2019 -- a good starting point.

4 years agoImplement `./x.py fmt [--check]`.
Adam Perry [Wed, 30 Oct 2019 23:56:27 +0000 (16:56 -0700)]
Implement `./x.py fmt [--check]`.

4 years agobootstrap.py fetches rustfmt.
Adam Perry [Wed, 30 Oct 2019 02:43:37 +0000 (19:43 -0700)]
bootstrap.py fetches rustfmt.

Co-Authored-By: Mark Rousskov <mark.simulacrum@gmail.com>
4 years agoAdd individual crates to rustfmt ignore list.
Adam Perry [Tue, 29 Oct 2019 15:33:11 +0000 (08:33 -0700)]
Add individual crates to rustfmt ignore list.

Co-Authored-By: Mark Rousskov <mark.simulacrum@gmail.com>
4 years agoAuto merge of #66932 - rust-lang:pass-check-runfail, r=petrochenkov
bors [Sun, 22 Dec 2019 00:10:13 +0000 (00:10 +0000)]
Auto merge of #66932 - rust-lang:pass-check-runfail, r=petrochenkov

Revamp `// run-fail` wrt. `--pass` & support `// build-fail` & `// check-fail`

Revamp how `// run-fail` tests work internally by having a separate `FailMode` that does not interfere with `PassMode`. In particular, `--pass check` will now have no effect on `// *-fail` tests. Moreover, new test annotations `// check-fail` (the default) and `// build-fail` are added. The latter is useful to distinguish post-monomorphization failures from pre-monomorphization failures as seen throughout the PR. Finally, ensure that non-`Ui` tests do not listen to `--pass check` such that the flag can be used with e.g. `./x.py test --pass check` directly.

Fixes #66929.
Fixes #67128.

r? @petrochenkov
cc @RalfJung @ninjasource

4 years agoTweak non_shorthand_field_patterns' suggestion
Yuki Okushi [Sat, 21 Dec 2019 22:59:38 +0000 (07:59 +0900)]
Tweak non_shorthand_field_patterns' suggestion

4 years agoNits.
Camille GILLOT [Sun, 1 Dec 2019 16:33:31 +0000 (17:33 +0100)]
Nits.

4 years agoTidy.
Camille GILLOT [Sun, 1 Dec 2019 11:49:54 +0000 (12:49 +0100)]
Tidy.

4 years agoUse Arena inside hir::Body.
Camille GILLOT [Fri, 29 Nov 2019 10:09:23 +0000 (11:09 +0100)]
Use Arena inside hir::Body.

4 years agoUse Arena inside hir::Mod.
Camille GILLOT [Fri, 29 Nov 2019 09:24:47 +0000 (10:24 +0100)]
Use Arena inside hir::Mod.

4 years agoUse Arena inside hir::StructField.
Camille GILLOT [Fri, 29 Nov 2019 08:40:33 +0000 (09:40 +0100)]
Use Arena inside hir::StructField.

4 years agoUse Arena inside hir::EnumDef.
Camille GILLOT [Fri, 29 Nov 2019 08:26:18 +0000 (09:26 +0100)]
Use Arena inside hir::EnumDef.

4 years agoUse Arena inside hir::ImplItem.
Camille GILLOT [Thu, 28 Nov 2019 21:16:44 +0000 (22:16 +0100)]
Use Arena inside hir::ImplItem.

4 years agoUse Arena inside hir::TraitItem.
Camille GILLOT [Thu, 28 Nov 2019 20:47:10 +0000 (21:47 +0100)]
Use Arena inside hir::TraitItem.

4 years agoUse Arena inside hir::ForeignItem.
Camille GILLOT [Thu, 28 Nov 2019 19:18:29 +0000 (20:18 +0100)]
Use Arena inside hir::ForeignItem.

4 years agoHandle Attributes in arena.
Camille GILLOT [Thu, 28 Nov 2019 22:50:47 +0000 (23:50 +0100)]
Handle Attributes in arena.

4 years agoUse Arena inside hir::Item.
Camille GILLOT [Thu, 28 Nov 2019 18:28:50 +0000 (19:28 +0100)]
Use Arena inside hir::Item.

4 years agoAdd simpler entry points to const eval for common usages.
Ben Lewis [Fri, 29 Nov 2019 19:42:56 +0000 (08:42 +1300)]
Add simpler entry points to const eval for common usages.

4 years agoUse Arena inside hir::Crate.
Camille GILLOT [Thu, 28 Nov 2019 10:49:29 +0000 (11:49 +0100)]
Use Arena inside hir::Crate.

4 years agoadd build-fail to 32-bit tests
Mazdak Farrokhzad [Sat, 21 Dec 2019 21:33:36 +0000 (22:33 +0100)]
add build-fail to 32-bit tests

4 years agofix rebase fallout
Mazdak Farrokhzad [Sun, 15 Dec 2019 04:45:34 +0000 (05:45 +0100)]
fix rebase fallout

4 years agorefactor & address review comments
Mazdak Farrokhzad [Sat, 14 Dec 2019 14:33:05 +0000 (15:33 +0100)]
refactor & address review comments

4 years agorework run-fail and support check,build-fail
Mazdak Farrokhzad [Sat, 14 Dec 2019 03:28:32 +0000 (04:28 +0100)]
rework run-fail and support check,build-fail

4 years agomake `--pass check` work with `// run-fail` tests
Mazdak Farrokhzad [Sun, 1 Dec 2019 12:31:50 +0000 (13:31 +0100)]
make `--pass check` work with `// run-fail` tests

4 years agosimplify MIR building with cfg.goto(...)
Mazdak Farrokhzad [Fri, 20 Dec 2019 17:27:05 +0000 (18:27 +0100)]
simplify MIR building with cfg.goto(...)

4 years agomisc cleanup in match MIR building
Mazdak Farrokhzad [Fri, 20 Dec 2019 17:05:45 +0000 (18:05 +0100)]
misc cleanup in match MIR building

4 years agoAuto merge of #67495 - Centril:rollup-6aer3xg, r=Centril
bors [Sat, 21 Dec 2019 20:59:22 +0000 (20:59 +0000)]
Auto merge of #67495 - Centril:rollup-6aer3xg, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #67160 (Make GATs less ICE-prone.)
 - #67333 ([mir-opt] Fix `Inline` pass to handle inlining into `box` expressions)
 - #67420 (use _val to ignore parameter of any::type_name_of_val)
 - #67469 (Remove rustc-dev from the default nightly components)
 - #67489 (Drop petgraph dependency from bootstrap)
 - #67490 (Document privacy of RangeInclusive fields)
 - #67491 (use Result::map_or for bootstrap)

Failed merges:

r? @ghost

4 years agoRemove clean::Mutability enum
Guillaume Gomez [Sat, 21 Dec 2019 14:29:46 +0000 (15:29 +0100)]
Remove clean::Mutability enum

4 years agosubmodules: update clippy from 69f99e74 to cfb33200
Matthias Krüger [Sat, 21 Dec 2019 20:04:28 +0000 (21:04 +0100)]
submodules: update clippy from 69f99e74 to cfb33200

Changes:
````
rustup "Merge `ast::Mutability` and `mir::Mutability`"
rustup https://github.com/rust-lang/rust/pull/67130
rustup https://github.com/rust-lang/rust/pull/67455
There are no per-file copyright headers anymore
Update lints for `iterator_step_by_zero` changes
Fix 'redudant' spelling in redundant_clone docs
Fix documentation example for unnecessary_filter_map.
Fix `expect_fun_call` false negative on references
Fix `iterator_step_by_zero` description in declaration
Fix `iterator_step_by_zero` definition
Correct `iterator_step_by_zero` documentation
Update iterator_step_by_zero
Prevent `cmp_nan` when inside constants
Detect comparisons with NAN constants
Fix clippy build failure
````

4 years agoUpdate unstable book build to use NonZeroU32
LeSeulArtichaut [Sat, 21 Dec 2019 13:50:56 +0000 (14:50 +0100)]
Update unstable book build to use NonZeroU32

4 years agospan_suggestion_hidden -> tool_only_span_suggestion
Mazdak Farrokhzad [Sat, 21 Dec 2019 02:32:54 +0000 (03:32 +0100)]
span_suggestion_hidden -> tool_only_span_suggestion

4 years agounwrap -> expect
Mazdak Farrokhzad [Sat, 21 Dec 2019 02:28:22 +0000 (03:28 +0100)]
unwrap -> expect

4 years agoparse_ty_bare_fn: improve docs
Mazdak Farrokhzad [Sun, 8 Dec 2019 11:40:20 +0000 (12:40 +0100)]
parse_ty_bare_fn: improve docs

4 years agodocument parse_late_bound_lifetime_defs
Mazdak Farrokhzad [Sun, 8 Dec 2019 11:29:55 +0000 (12:29 +0100)]
document parse_late_bound_lifetime_defs

4 years agoextract error_negative_bounds
Mazdak Farrokhzad [Sun, 8 Dec 2019 11:29:05 +0000 (12:29 +0100)]
extract error_negative_bounds

4 years agoparse_generic_bounds: account for negative lifetime bounds
Mazdak Farrokhzad [Sun, 8 Dec 2019 11:19:53 +0000 (12:19 +0100)]
parse_generic_bounds: account for negative lifetime bounds

4 years agosimplify 'let question = ...;'
Mazdak Farrokhzad [Sun, 8 Dec 2019 10:57:18 +0000 (11:57 +0100)]
simplify 'let question = ...;'

4 years agosimplify negative bound diagnostic
Mazdak Farrokhzad [Sun, 8 Dec 2019 10:49:25 +0000 (11:49 +0100)]
simplify negative bound diagnostic

4 years agoextract parse_generic_lt_bound
Mazdak Farrokhzad [Sun, 8 Dec 2019 10:28:57 +0000 (11:28 +0100)]
extract parse_generic_lt_bound

4 years agoextract parse_generic_ty_bound
Mazdak Farrokhzad [Sun, 8 Dec 2019 10:19:24 +0000 (11:19 +0100)]
extract parse_generic_ty_bound

4 years agoparse_generic_bound: leave a FIXME
Mazdak Farrokhzad [Sun, 8 Dec 2019 10:08:04 +0000 (11:08 +0100)]
parse_generic_bound: leave a FIXME

4 years agofunctionalize parse_generic_bound
Mazdak Farrokhzad [Sun, 8 Dec 2019 10:04:26 +0000 (11:04 +0100)]
functionalize parse_generic_bound

4 years agoextract parse_generic_bound
Mazdak Farrokhzad [Sun, 8 Dec 2019 09:32:38 +0000 (10:32 +0100)]
extract parse_generic_bound

4 years agoextract can_begin_bound
Mazdak Farrokhzad [Sun, 8 Dec 2019 09:04:31 +0000 (10:04 +0100)]
extract can_begin_bound

4 years agoparse_generic_bounds_common: dedent
Mazdak Farrokhzad [Sun, 8 Dec 2019 08:42:32 +0000 (09:42 +0100)]
parse_generic_bounds_common: dedent

4 years agoextract recover_paren_lifetime
Mazdak Farrokhzad [Sun, 8 Dec 2019 08:29:17 +0000 (09:29 +0100)]
extract recover_paren_lifetime

4 years agoextract error_opt_out_lifetime
Mazdak Farrokhzad [Sun, 8 Dec 2019 08:18:34 +0000 (09:18 +0100)]
extract error_opt_out_lifetime

4 years agoparser/ty.rs: minor formatting tweaks
Mazdak Farrokhzad [Sun, 8 Dec 2019 08:10:17 +0000 (09:10 +0100)]
parser/ty.rs: minor formatting tweaks

4 years agoparse_ty_common: .fatal -> .struct_span_err
Mazdak Farrokhzad [Sun, 8 Dec 2019 08:08:19 +0000 (09:08 +0100)]
parse_ty_common: .fatal -> .struct_span_err

4 years agoextract error_illegal_c_variadic_ty
Mazdak Farrokhzad [Sun, 8 Dec 2019 08:01:26 +0000 (09:01 +0100)]
extract error_illegal_c_variadic_ty

4 years agoextract parse_path_start_ty
Mazdak Farrokhzad [Sun, 8 Dec 2019 07:49:20 +0000 (08:49 +0100)]
extract parse_path_start_ty

4 years agoextract parse_dyn_ty
Mazdak Farrokhzad [Sun, 8 Dec 2019 07:38:23 +0000 (08:38 +0100)]
extract parse_dyn_ty

4 years agoextract parse_impl_ty
Mazdak Farrokhzad [Sun, 8 Dec 2019 07:29:12 +0000 (08:29 +0100)]
extract parse_impl_ty

4 years agoextract parse_typeof_ty
Mazdak Farrokhzad [Sun, 8 Dec 2019 07:23:10 +0000 (08:23 +0100)]
extract parse_typeof_ty

4 years agoextract parse_array_or_slice_ty
Mazdak Farrokhzad [Sun, 8 Dec 2019 07:19:53 +0000 (08:19 +0100)]
extract parse_array_or_slice_ty

4 years agoRollup merge of #67491 - lzutao:res-map-or, r=Mark-Simulacrum
Mazdak Farrokhzad [Sat, 21 Dec 2019 18:07:44 +0000 (19:07 +0100)]
Rollup merge of #67491 - lzutao:res-map-or, r=Mark-Simulacrum

use Result::map_or for bootstrap

4 years agoRollup merge of #67490 - Mark-Simulacrum:i-67371, r=Dylan-DPC
Mazdak Farrokhzad [Sat, 21 Dec 2019 18:07:42 +0000 (19:07 +0100)]
Rollup merge of #67490 - Mark-Simulacrum:i-67371, r=Dylan-DPC

Document privacy of RangeInclusive fields

Fixes #67371

4 years agoRollup merge of #67489 - Mark-Simulacrum:drop-petgraph, r=Centril
Mazdak Farrokhzad [Sat, 21 Dec 2019 18:07:40 +0000 (19:07 +0100)]
Rollup merge of #67489 - Mark-Simulacrum:drop-petgraph, r=Centril

Drop petgraph dependency from bootstrap

It was essentially unused, likely leftover from a previous refactoring iteration. This should hopefully help reduce bootstrap build times a little, dropping petgraph, fixedbitset, and ordermap from the dependency set.

r? @alexcrichton

4 years agoRollup merge of #67469 - cuviper:no-default-rustc-dev, r=Mark-Simulacrum
Mazdak Farrokhzad [Sat, 21 Dec 2019 18:07:39 +0000 (19:07 +0100)]
Rollup merge of #67469 - cuviper:no-default-rustc-dev, r=Mark-Simulacrum

Remove rustc-dev from the default nightly components

It was already filtered from other branches, but we only kept it in
nightly's default to ease the transition. Now that the separation of
rust-std/rustc-dev has reached the 1.40 release, it seems like a good
time for that transition to end.

Closes #67425.
r? @Mark-Simulacrum

4 years agoRollup merge of #67420 - lzutao:_val, r=Centril
Mazdak Farrokhzad [Sat, 21 Dec 2019 18:07:37 +0000 (19:07 +0100)]
Rollup merge of #67420 - lzutao:_val, r=Centril

use _val to ignore parameter of any::type_name_of_val

mem::drop does the same thing too.

4 years agoRollup merge of #67333 - wesleywiser:fix_inline_into_box_place, r=oli-obk
Mazdak Farrokhzad [Sat, 21 Dec 2019 18:07:36 +0000 (19:07 +0100)]
Rollup merge of #67333 - wesleywiser:fix_inline_into_box_place, r=oli-obk

[mir-opt] Fix `Inline` pass to handle inlining into `box` expressions

r? @oli-obk

Before, the test case just ICE'd here:

https://github.com/rust-lang/rust/blob/a605441e049f0b6d5f7715b94b8ac4662fd7fcf6/src/librustc_mir/transform/inline.rs#L668

4 years agoRollup merge of #67160 - matthewjasper:gat-generics, r=nikomatsakis
Mazdak Farrokhzad [Sat, 21 Dec 2019 18:07:31 +0000 (19:07 +0100)]
Rollup merge of #67160 - matthewjasper:gat-generics, r=nikomatsakis

Make GATs less ICE-prone.

After this PR simple lifetime-generic associated types can now be used in a compiling program. There are two big limitations:

* #30472 has not been addressed in any way (see src/test/ui/generic-associated-types/iterable.rs)
* Using type- and const-generic associated types errors because bound types and constants aren't handled by trait solving.
    * The errors are technically non-fatal, but they happen in a [part of the compiler](https://github.com/rust-lang/rust/blob/4abb0ad2731e9ac6fd5d64d4cf15b7c82e4b5a81/src/librustc_typeck/lib.rs#L298) that fairly aggressively stops compiling on errors.

closes #47206
closes #49362
closes #62521
closes #63300
closes #64755
closes #67089

4 years agoAuto merge of #67206 - ehuss:update-cargo-books, r=dtolnay
bors [Sat, 21 Dec 2019 17:52:47 +0000 (17:52 +0000)]
Auto merge of #67206 - ehuss:update-cargo-books, r=dtolnay

Update cargo, books

Update nomicon, cargo, reference, book, rust-by-example, embedded-book

## nomicon

2 commits in 041c46e692a2592853aeca132c8dfe8eb5a79a9e..8be35b201f9cf0a4c3fcc96c83ac21671dcf3112
2019-11-20 16:46:45 +0100 to 2019-12-01 13:02:12 -0500
- Update unwinding.md
- ci: remove needless rust-docs component

## cargo

15 commits in 626f0f40efd32e6b3dbade50cd53fdfaa08446ba..5a139f7e6d67fd8a416a3f19d8e01581d24c0333
2019-12-03 16:53:04 +0000 to 2019-12-10 20:17:50 +0000
- Bump cargo-platform version. (rust-lang/cargo#7693)
- Add a test for `cargo locate-project` (rust-lang/cargo#7690)
- Emit error on [target.'cfg(debug_assertions)'.dependencies] and similar (rust-lang/cargo#7660)
- Update the layout of `Cargo Commands` in doc (rust-lang/cargo#7687)
- Features and dependencies can't have the same name (rust-lang/cargo#7682)
- Fix some typos in doc (rust-lang/cargo#7672)
- Add test for `NAME` environment variable when `cargo new` (rust-lang/cargo#7667)
- Add test for `GIT_COMMITTER_EMAIL` when `cargo new` (rust-lang/cargo#7666)
- document support for Bitbucket Pipelines badges (rust-lang/cargo#7663)
- Add cargo-vendor to the list of cargo commands in doc (rust-lang/cargo#7659)
- Fix typo in section 'Caching the Cargo home in CI' (rust-lang/cargo#7661)
- Docs: Add an appendix on git authentication. (rust-lang/cargo#7658)
- Remove --offline empty index error. (rust-lang/cargo#7655)
- Change the link destination of cargo book contribution (rust-lang/cargo#7657)
- Add a --offline hint. (rust-lang/cargo#7654)

## reference

2 commits in 9e843aeb4df083522c7277179bbaa25d0507731c..787e8d84034a4a0ae17084bbae25474152144b9a
2019-11-24 17:44:04 +0100 to 2019-12-10 10:01:29 -0800
- Update for visibility syntax changes. (rust-lang-nursery/reference#722)
- document `bind_by_move_pattern_guards` (rust-lang-nursery/reference#720)

## book

2 commits in 81ebaa2a3f88d4d106516c489682e64cacba4f60..ef8bb568035ded8ddfa30a9309026638cc3c8136
2019-11-15 08:30:04 -0800 to 2019-11-28 11:00:04 -0600
- Remove optional commas from match arms in ch18-03 (rust-lang/book#2176)
- Remove call_box() from ch20-03 (rust-lang/book#2177)

## rust-by-example

1 commits in 4835e025826729827a94fdeb7cb85fed288d08bb..b7ac1bc76b7d02a43c83b3a931d226f708aa1ff4
2019-11-14 09:20:43 -0300 to 2019-12-02 11:38:43 -0300
- Make TryFrom & TryInto example editable (rust-lang/rust-by-example#1297)

## embedded-book

1 commits in 5ca585c4a7552efb546e7681c3de0712f4ae4fdc..c26234930282210849256e4ecab925f0f2daf3be
2019-08-27 13:39:14 +0000 to 2019-12-07 17:25:11 +0000
- Fix `impl Gpio` -&gt; `impl GpioConfig`  (rust-embedded/book#216)

4 years agoparse_ptr -> parse_ty_ptr & refactor
Mazdak Farrokhzad [Sun, 8 Dec 2019 06:58:45 +0000 (07:58 +0100)]
parse_ptr -> parse_ty_ptr & refactor

4 years agorefactor parse_ty_tuple_or_parens
Mazdak Farrokhzad [Sun, 8 Dec 2019 06:55:38 +0000 (07:55 +0100)]
refactor parse_ty_tuple_or_parens

4 years agoextract parse_ty_tuple_or_parens
Mazdak Farrokhzad [Sun, 8 Dec 2019 05:44:24 +0000 (06:44 +0100)]
extract parse_ty_tuple_or_parens

4 years agouse Result::map_or for bootstrap
Lzu Tao [Sat, 21 Dec 2019 17:04:41 +0000 (17:04 +0000)]
use Result::map_or for bootstrap

4 years agouse _val to ignore parameter of any::type_name_of_val
Lzu Tao [Sat, 21 Dec 2019 16:48:35 +0000 (16:48 +0000)]
use _val to ignore parameter of any::type_name_of_val

4 years agoDocument privacy of RangeInclusive fields
Mark Rousskov [Sat, 21 Dec 2019 16:27:51 +0000 (11:27 -0500)]
Document privacy of RangeInclusive fields

4 years agoDrop petgraph dependency from bootstrap
Mark Rousskov [Sat, 21 Dec 2019 15:54:15 +0000 (10:54 -0500)]
Drop petgraph dependency from bootstrap

It was essentially unused, likely leftover from a previous refactoring
iteration.

4 years agoChange results to options
Christian Poveda [Sat, 21 Dec 2019 15:27:58 +0000 (10:27 -0500)]
Change results to options

4 years agoAuto merge of #67485 - Centril:rollup-gt0opvr, r=Centril
bors [Sat, 21 Dec 2019 14:30:26 +0000 (14:30 +0000)]
Auto merge of #67485 - Centril:rollup-gt0opvr, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #67059 (Fix too restrictive checks on Drop impls)
 - #67355 (Merge `ast::Mutability` and `mir::Mutability`)
 - #67393 (Enable opting out of specific default LLVM arguments.)
 - #67422 (Cleanup err codes)
 - #67462 (Make ptr::slice_from_raw_parts a const fn available under a feature flag)
 - #67467 (Test slice patterns more)
 - #67478 (Fix src/libcore/str/mod.rs doc comments)

Failed merges:

r? @ghost

4 years agoRollup merge of #67478 - brunobell:master, r=Centril
Mazdak Farrokhzad [Sat, 21 Dec 2019 14:29:50 +0000 (15:29 +0100)]
Rollup merge of #67478 - brunobell:master, r=Centril

Fix src/libcore/str/mod.rs doc comments

Fix grammar in src/libcore/str/mod.rs doc comments. r? @steveklabnik

4 years agoRollup merge of #67467 - matthewjasper:test-slice-patterns, r=oli-obk
Mazdak Farrokhzad [Sat, 21 Dec 2019 14:29:49 +0000 (15:29 +0100)]
Rollup merge of #67467 - matthewjasper:test-slice-patterns, r=oli-obk

Test slice patterns more

Adds tests for const evaluation and some more borrow checking tests.

Fixes some bugs in const eval for subslice patterns.
closes #66934

r? @oli-obk
cc @Centril

4 years agoRollup merge of #67462 - DutchGhost:const_slice_from_raw_parts, r=dtolnay
Mazdak Farrokhzad [Sat, 21 Dec 2019 14:29:47 +0000 (15:29 +0100)]
Rollup merge of #67462 - DutchGhost:const_slice_from_raw_parts, r=dtolnay

Make ptr::slice_from_raw_parts a const fn available under a feature flag

A first step in the direction of https://github.com/rust-lang/rust/issues/67456 .
This makes `ptr::slice_from_raw_parts` and `ptr::slice_from_raw_parts_mut` available as a const fn under a feature flag.

4 years agoRollup merge of #67422 - GuillaumeGomez:cleanup-err-codes, r=Dylan-DPC
Mazdak Farrokhzad [Sat, 21 Dec 2019 14:29:45 +0000 (15:29 +0100)]
Rollup merge of #67422 - GuillaumeGomez:cleanup-err-codes, r=Dylan-DPC

Cleanup err codes

r? @Dylan-DPC

4 years agoRollup merge of #67393 - michaelwoerister:llvm-args-override, r=varkor
Mazdak Farrokhzad [Sat, 21 Dec 2019 14:29:44 +0000 (15:29 +0100)]
Rollup merge of #67393 - michaelwoerister:llvm-args-override, r=varkor

Enable opting out of specific default LLVM arguments.

`rustc` by default adds a few arguments to LLVM (like `-mergefunc-use-aliases` for example). With this PR `rustc` will only emit these arguments if the same argument has not already been specified by the user via `-Cllvm-args`. This enables opting out of these defaults.

The PR also removes a PGO specific `-Z` flag the effect of which can also be easily achieved by `-Cllvm-args`.

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

4 years agoRollup merge of #67355 - Centril:merge-mut, r=oli-obk
Mazdak Farrokhzad [Sat, 21 Dec 2019 14:29:42 +0000 (15:29 +0100)]
Rollup merge of #67355 - Centril:merge-mut, r=oli-obk

Merge `ast::Mutability` and `mir::Mutability`

r? @oli-obk

4 years agoRollup merge of #67059 - TommasoBianchi:dropck_fix_pr, r=pnkfelix
Mazdak Farrokhzad [Sat, 21 Dec 2019 14:29:40 +0000 (15:29 +0100)]
Rollup merge of #67059 - TommasoBianchi:dropck_fix_pr, r=pnkfelix

Fix too restrictive checks on Drop impls

Fixes #34426. Fixes #58311.

This PR completes and extends #59497 (which has been inactive for a while now).
The problem generating both issues was that when checking that the `Predicate`s of the `Drop` impl are exactly the same as the ones of the struct definition, the check was essentially performed by a simple `==` operator, which was not handling correctly HRTBs and involved `Fn` types.

The implemented solution relies on the `relate` machinery to more correctly equate `Predicate`s, and on `anonymize_late_bound_regions` to handle HRTB in a more general way. As the `Relate` trait currently is implemented only for `TraitPredicate` and `ProjectionPredicate` (and as they were the ones generating problems), `relate` is used only for them while for other `Predicate`s the equality check is kept. I'm currently considering whether it would make sense to implement the `Relate` trait also for all other `Predicate`s to render the proposed solution more general.

4 years agoFix rustdoc
Matthew Jasper [Sun, 8 Dec 2019 22:02:33 +0000 (22:02 +0000)]
Fix rustdoc

4 years agoUpdate tests for GATs
Matthew Jasper [Sun, 8 Dec 2019 17:22:35 +0000 (17:22 +0000)]
Update tests for GATs

* Make some run-pass or check-pass
* Use `#![allow(incomplete_features)]`
* Update FIXMEs now that some of the issues have been addressed
* Add regression tests

4 years agoAdd more tests for slice patterns
Matthew Jasper [Sun, 15 Dec 2019 16:14:24 +0000 (16:14 +0000)]
Add more tests for slice patterns

4 years agoRequire issue = "none" over issue = "0" in unstable attributes
Ross MacArthur [Sat, 21 Dec 2019 11:16:18 +0000 (13:16 +0200)]
Require issue = "none" over issue = "0" in unstable attributes

4 years agoAuto merge of #66994 - Centril:stmt-polish, r=estebank
bors [Sat, 21 Dec 2019 11:05:03 +0000 (11:05 +0000)]
Auto merge of #66994 - Centril:stmt-polish, r=estebank

refactor expr & stmt parsing + improve recovery

Summary of important changes (best read commit-by-commit, ignoring whitespace changes):

- `AttrVec` is introduces as an alias for `ThinVec<Attribute>`
- `parse_expr_bottom` and `parse_stmt` are thoroughly refactored.
- Extract diagnostics logic for `vec![...]` in a pattern context.
- Recovery is added for `do catch { ... }`
- Recovery is added for `'label: non_block_expr`
- Recovery is added for `var $local`, `auto $local`, and `mut $local`. Fixes #65257.
- Recovery is added for `e1 and e2` and `e1 or e2`.
- ~~`macro_legacy_warnings` is turned into an error (has been a warning for 3 years!)~~
- Fixes #63396 by forward-porting #64105 which now works thanks to added recovery.
- `ui-fulldeps/ast_stmt_expr_attr.rs` is turned into UI and pretty tests.
- Recovery is fixed for `#[attr] if expr {}`

r? @estebank

4 years agoFix src/libcore/str/mod.rs doc comments
Broono Lu [Sat, 21 Dec 2019 10:12:46 +0000 (18:12 +0800)]
Fix src/libcore/str/mod.rs doc comments

4 years agoRemove iter_private.rs
Masaki Hara [Sat, 21 Dec 2019 06:16:00 +0000 (15:16 +0900)]
Remove iter_private.rs

The contents of this file have been moved in #56932 (520e8b0) and the
file should have been removed as well.

4 years agoMove the rest of the mir-opt inline tests into a folder
Wesley Wiser [Sun, 15 Dec 2019 20:37:28 +0000 (15:37 -0500)]
Move the rest of the mir-opt inline tests into a folder

4 years ago[mir-opt] Fix `Inline` pass to handle inlining into `box` expressions
Wesley Wiser [Sun, 15 Dec 2019 19:07:30 +0000 (14:07 -0500)]
[mir-opt] Fix `Inline` pass to handle inlining into `box` expressions

4 years agoAuto merge of #67464 - Centril:rollup-j3mkl1m, r=Centril
bors [Sat, 21 Dec 2019 01:02:54 +0000 (01:02 +0000)]
Auto merge of #67464 - Centril:rollup-j3mkl1m, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #67130 (Const prop should finish propagation into user defined variables)
 - #67163 (Split up ptr/mod.rs in libcore...)
 - #67314 (Don't suppress move errors for union fields)
 - #67392 (Fix unresolved type span inside async object)
 - #67404 (Separate region inference logic from error handling better)
 - #67428 (`is_binding_pat`: use explicit match & include or-pats in grammar)

Failed merges:

r? @ghost

4 years agoRemove rustc-dev from the default nightly components
Josh Stone [Fri, 20 Dec 2019 23:45:03 +0000 (15:45 -0800)]
Remove rustc-dev from the default nightly components

It was already filtered from other branches, but we only kept it in
nightly's default to ease the transition. Now that the separation of
rust-std/rustc-dev has reached the 1.40 release, it seems like a good
time for that transition to end.

4 years agoDon't ICE in subslice pattern const-eval
Matthew Jasper [Fri, 20 Dec 2019 23:11:41 +0000 (23:11 +0000)]
Don't ICE in subslice pattern const-eval

4 years agoAdd a big notice about const intrinsics
Oliver Scherer [Fri, 20 Dec 2019 23:07:36 +0000 (00:07 +0100)]
Add a big notice about const intrinsics

4 years agoRequire const stability attributes on intrinsics to be able to use them in constant...
Oliver Scherer [Fri, 20 Dec 2019 22:15:50 +0000 (23:15 +0100)]
Require const stability attributes on intrinsics to be able to use them in constant contexts

4 years agotweak var/auto/mut recovery
Mazdak Farrokhzad [Wed, 4 Dec 2019 11:15:01 +0000 (12:15 +0100)]
tweak var/auto/mut recovery

4 years agouse .span_suggestion_short for &&
Mazdak Farrokhzad [Wed, 4 Dec 2019 10:27:11 +0000 (11:27 +0100)]
use .span_suggestion_short for &&

4 years agoast_stmt_expr_attr -> pretty & ui tests
Mazdak Farrokhzad [Wed, 4 Dec 2019 10:16:12 +0000 (11:16 +0100)]
ast_stmt_expr_attr -> pretty & ui tests