]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoslice_patterns: address review comments
Mazdak Farrokhzad [Thu, 2 Jan 2020 21:18:34 +0000 (22:18 +0100)]
slice_patterns: address review comments

4 years agoslice_patterns: remove from unstable book
Mazdak Farrokhzad [Mon, 30 Dec 2019 00:53:22 +0000 (01:53 +0100)]
slice_patterns: remove from unstable book

4 years agoslice_patterns: organize some tests
Mazdak Farrokhzad [Mon, 30 Dec 2019 00:37:14 +0000 (01:37 +0100)]
slice_patterns: organize some tests

4 years agoslice_patterns: remove gates in tests
Mazdak Farrokhzad [Mon, 30 Dec 2019 00:23:42 +0000 (01:23 +0100)]
slice_patterns: remove gates in tests

4 years agoslice_patterns: remove feature gate test
Mazdak Farrokhzad [Sun, 29 Dec 2019 23:33:10 +0000 (00:33 +0100)]
slice_patterns: remove feature gate test

4 years agoslice_patterns: remove internal uses of gate
Mazdak Farrokhzad [Sun, 29 Dec 2019 23:32:02 +0000 (00:32 +0100)]
slice_patterns: remove internal uses of gate

4 years agoAdd a test for iter::empty::<*mut i32> being Sync and Send
Konrad Borowski [Wed, 16 Jan 2019 23:07:22 +0000 (00:07 +0100)]
Add a test for iter::empty::<*mut i32> being Sync and Send

4 years agoMake iter::Empty<T> implement Send and Sync for any T
Konrad Borowski [Sat, 18 Jan 2020 17:35:36 +0000 (18:35 +0100)]
Make iter::Empty<T> implement Send and Sync for any T

4 years agoslice_patterns: adjust error codes
Mazdak Farrokhzad [Sun, 29 Dec 2019 23:31:35 +0000 (00:31 +0100)]
slice_patterns: adjust error codes

4 years agostabilize slice_patterns
Mazdak Farrokhzad [Sun, 29 Dec 2019 23:16:16 +0000 (00:16 +0100)]
stabilize slice_patterns

4 years agoAuto merge of #68001 - Marwes:lexical_region_resolve, r=nikomatsakis
bors [Sat, 18 Jan 2020 14:57:40 +0000 (14:57 +0000)]
Auto merge of #68001 - Marwes:lexical_region_resolve, r=nikomatsakis

perf: Only search potentially changed constraints in lexical_region_resolve

Gives a big performance increase to the unicode_normalization benchmark in my testing.

4 years agoclean up e0200 explanation
Guillaume Gomez [Sat, 18 Jan 2020 12:12:30 +0000 (13:12 +0100)]
clean up e0200 explanation

4 years agoimprove type_name_of_val docs
lcnr/Bastian Kauschke [Sat, 18 Jan 2020 13:43:08 +0000 (14:43 +0100)]
improve type_name_of_val docs

4 years agoFix table of syscalls in docs of std::time::SystemTime.
Mara Bos [Sat, 18 Jan 2020 12:33:17 +0000 (13:33 +0100)]
Fix table of syscalls in docs of std::time::SystemTime.

4 years agoFix table of syscalls in docs of std::time::Instant.
Mara Bos [Sat, 18 Jan 2020 12:33:17 +0000 (13:33 +0100)]
Fix table of syscalls in docs of std::time::Instant.

4 years agoAdd `riscv64gc-unknown-linux-gnu` into target list in build-manifest
msizanoen1 [Sat, 18 Jan 2020 11:59:51 +0000 (18:59 +0700)]
Add `riscv64gc-unknown-linux-gnu` into target list in build-manifest

Missed in #68037

r? @alexcrichton

4 years agoAuto merge of #68170 - wesleywiser:stop_const_prop_ref_taking, r=oli-obk
bors [Sat, 18 Jan 2020 11:36:47 +0000 (11:36 +0000)]
Auto merge of #68170 - wesleywiser:stop_const_prop_ref_taking, r=oli-obk

Turn off const propagation of ref taking

Fixes #67529
Fixes #67640
Fixes #67641
Fixes #67862

r? @oli-obk

4 years agoadjust ui tests
Ralf Jung [Sat, 18 Jan 2020 11:24:54 +0000 (12:24 +0100)]
adjust ui tests

4 years agoadjust mir-opt tests
Ralf Jung [Sat, 18 Jan 2020 08:38:42 +0000 (09:38 +0100)]
adjust mir-opt tests

4 years agoget rid of real_drop_in_place again
Ralf Jung [Thu, 16 Jan 2020 21:18:17 +0000 (22:18 +0100)]
get rid of real_drop_in_place again

4 years agoAuto merge of #68037 - msizanoen1:riscv-ci, r=alexcrichton
bors [Sat, 18 Jan 2020 08:18:44 +0000 (08:18 +0000)]
Auto merge of #68037 - msizanoen1:riscv-ci, r=alexcrichton

Distribution CI for riscv64gc-unknown-linux-gnu

This modifies `dist-various-1` to build the standard library for RISC-V GNU/Linux.

r? @alexcrichton

4 years agoAuto merge of #67940 - JohnTitor:rustc-guide, r=JohnTitor
bors [Sat, 18 Jan 2020 04:45:21 +0000 (04:45 +0000)]
Auto merge of #67940 - JohnTitor:rustc-guide, r=JohnTitor

Update rustc-guide

r? @ghost

CC: @rust-lang/wg-learning
4 years agoAuto merge of #68330 - tmandry:rollup-5v29y9r, r=tmandry
bors [Sat, 18 Jan 2020 01:29:28 +0000 (01:29 +0000)]
Auto merge of #68330 - tmandry:rollup-5v29y9r, r=tmandry

Rollup of 9 pull requests

Successful merges:

 - #66660 (Don't warn about snake case for field puns.)
 - #68093 (Fix deref impl typedef)
 - #68204 (Use named fields for `{ast,hir}::ItemKind::Impl`)
 - #68256 (Do not ICE on malformed suggestion spans)
 - #68279 (Clean up E0198 explanation)
 - #68291 (Update sanitizer tests)
 - #68312 (Add regression test for integer literals in generic arguments in where clauses)
 - #68314 (Stop treating `FalseEdges` and `FalseUnwind` as having semantic value for const eval)
 - #68317 (Clean up E0199 explanation)

Failed merges:

r? @ghost

4 years agoRollup merge of #68317 - GuillaumeGomez:clean-up-e0199, r=Dylan-DPC
Tyler Mandry [Sat, 18 Jan 2020 01:28:23 +0000 (17:28 -0800)]
Rollup merge of #68317 - GuillaumeGomez:clean-up-e0199, r=Dylan-DPC

Clean up E0199 explanation

r? @Dylan-DPC

4 years agoRollup merge of #68314 - oli-obk:true_unwind, r=eddyb
Tyler Mandry [Sat, 18 Jan 2020 01:28:22 +0000 (17:28 -0800)]
Rollup merge of #68314 - oli-obk:true_unwind, r=eddyb

Stop treating `FalseEdges` and `FalseUnwind` as having semantic value for const eval

This change does not expose loops or conditions to stable const fns because we check those at the HIR level and in the regular const validity checks.

cc @ecstatic-morse

r? @eddyb

4 years agoRollup merge of #68312 - varkor:issue-67753-regression, r=Centril
Tyler Mandry [Sat, 18 Jan 2020 01:28:20 +0000 (17:28 -0800)]
Rollup merge of #68312 - varkor:issue-67753-regression, r=Centril

Add regression test for integer literals in generic arguments in where clauses

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

4 years agoRollup merge of #68291 - tmiasko:sanitizer-tests, r=nikomatsakis
Tyler Mandry [Sat, 18 Jan 2020 01:28:18 +0000 (17:28 -0800)]
Rollup merge of #68291 - tmiasko:sanitizer-tests, r=nikomatsakis

Update sanitizer tests

* Move tests from src/test/run-make-fulldeps to src/test/ui.
* Fix memory sanitizer test to detect the intended issue rather than
  an unrelated one caused by the use of an uninstrumented std.

4 years agoRollup merge of #68279 - GuillaumeGomez:clean-up-e0198, r=Dylan-DPC
Tyler Mandry [Sat, 18 Jan 2020 01:28:17 +0000 (17:28 -0800)]
Rollup merge of #68279 - GuillaumeGomez:clean-up-e0198, r=Dylan-DPC

Clean up E0198 explanation

r? @Dylan-DPC

4 years agoRollup merge of #68256 - estebank:bad-sugg-span, r=petrochenkov
Tyler Mandry [Sat, 18 Jan 2020 01:28:15 +0000 (17:28 -0800)]
Rollup merge of #68256 - estebank:bad-sugg-span, r=petrochenkov

Do not ICE on malformed suggestion spans

Under the assumption that suggestions are by their very nature always "best effort", it is ok if we don't display them instead of having an ICE. The underlying issue of the malformed span being _created_ is left unaddressed.

Fix #67567.

r? @petrochenkov

4 years agoRollup merge of #68204 - ecstatic-morse:item-kind-impl, r=oli-obk
Tyler Mandry [Sat, 18 Jan 2020 01:28:14 +0000 (17:28 -0800)]
Rollup merge of #68204 - ecstatic-morse:item-kind-impl, r=oli-obk

Use named fields for `{ast,hir}::ItemKind::Impl`

Currently, the widely used `ItemKind::Impl` variant is a tuple with seven fields. I want to add an eighth in #68140, which means I have to update most matches on this variant anyways. Giving a name to each field improves readability and makes future changes of this nature much simpler.

This change will cause several tools to break. I will fix them once this is merged.

4 years agoRollup merge of #68093 - GuillaumeGomez:fix-deref-impl-typedef, r=oli-obk
Tyler Mandry [Sat, 18 Jan 2020 01:28:12 +0000 (17:28 -0800)]
Rollup merge of #68093 - GuillaumeGomez:fix-deref-impl-typedef, r=oli-obk

Fix deref impl typedef

Fixes #35295.

r? @kinnison

4 years agoRollup merge of #66660 - jumbatm:dont_warn_about_snake_case_in_patterns, r=centril
Tyler Mandry [Sat, 18 Jan 2020 01:28:10 +0000 (17:28 -0800)]
Rollup merge of #66660 - jumbatm:dont_warn_about_snake_case_in_patterns, r=centril

Don't warn about snake case for field puns.

Closes #66362.

4 years agoUse named fields for `hir::ItemKind::Impl`
Dylan MacKenzie [Sat, 18 Jan 2020 00:14:29 +0000 (16:14 -0800)]
Use named fields for `hir::ItemKind::Impl`

4 years agoActually pass target LLVM args to LLVM
Jethro Beekman [Sat, 18 Jan 2020 00:11:52 +0000 (16:11 -0800)]
Actually pass target LLVM args to LLVM

4 years agoUse named fields for `ast::ItemKind::Impl`
Dylan MacKenzie [Tue, 14 Jan 2020 04:30:20 +0000 (20:30 -0800)]
Use named fields for `ast::ItemKind::Impl`

4 years agorefactor fix using cfg_if! (fix build)
Vita Batrla [Fri, 17 Jan 2020 23:38:37 +0000 (00:38 +0100)]
refactor fix using cfg_if! (fix build)

4 years agorustdoc: Catch fatal errors when syntax highlighting
Oliver Middleton [Fri, 17 Jan 2020 23:44:44 +0000 (23:44 +0000)]
rustdoc: Catch fatal errors when syntax highlighting

For some errors the lexer will unwind so we need to handle that in addition to handling `token::Unknown`.

4 years agorefactor fix using cfg_if!
Vita Batrla [Fri, 17 Jan 2020 21:46:32 +0000 (22:46 +0100)]
refactor fix using cfg_if!

4 years agoAuto merge of #67476 - mark-i-m:simplify-borrow_check-5, r=matthewjasper
bors [Fri, 17 Jan 2020 21:43:23 +0000 (21:43 +0000)]
Auto merge of #67476 - mark-i-m:simplify-borrow_check-5, r=matthewjasper

Region naming refactoring [6/N]

Followup to #67474

EDIT: this PR is probably best read commit-by-commit...

The major changes in this PR include:
- moving many functions around to modules that better suit them. In particular, a lot of methods were moved from `borrow_check::diagnostics::region_errors` to `borrow_check::region_infer`, and `report_region_errors` was moved from `borrow_check` to `borrow_check::diagnostics::region_errors`.
- `borrow_check::diagnostics::{region_errors, region_name}` are now most comprised of methods on `MirBorrowckCtxt` instead of `RegionInferenceContext`, allowing us to get rid of the annoying `pub(in crate::borrow_check)` on most of the fields of the latter, along with a number of method arguments on many methods.
- I renamed `MirBorrowckCtxt.nonlexical_regioncx` to just `regioncx` because their is no lexical lifetimes any more, and the old name was annoyingly verbose, causing many lines to wrap unnecessarily.
- I got rid of `ErrorRegionNamingContext`. Region naming is implemented as inherent methods on `MirBorrowckCtxt`, so we just move the naming stuff into that struct.

The PR is rather large, but the commits are fairly self-contained (though they don't all compile). There was one minor output change to one test with `compare-mode=nll`, which I think is acceptable.

Between this PR and the last one, a net of 200 lines are removed, most of which was function parameters and context structs :tada:

Some samples:

```diff
-                        self.nonlexical_regioncx.free_region_constraint_info(
-                            &self.body,
-                            &self.local_names,
-                            &self.upvars,
-                            self.mir_def_id,
-                            self.infcx,
-                            borrow_region_vid,
-                            region,
-                        );
+                        self.free_region_constraint_info(borrow_region_vid, region);
```

```diff
-            .or_else(|| {
-                self.give_name_if_anonymous_region_appears_in_yield_ty(
-                    infcx,
-                    body,
-                    *mir_def_id,
-                    fr,
-                    renctx,
-                )
-            });
+            .or_else(|| self.give_name_if_anonymous_region_appears_in_arguments(fr))
```

r? @matthewjasper

cc @eddyb

4 years agoFix some tests failing in `--pass check` mode
Vadim Petrochenkov [Fri, 17 Jan 2020 21:34:33 +0000 (00:34 +0300)]
Fix some tests failing in `--pass check` mode

4 years agoClean up E0199 explanation
Guillaume Gomez [Fri, 17 Jan 2020 18:54:07 +0000 (19:54 +0100)]
Clean up E0199 explanation

4 years agoformatting
Guillaume Gomez [Fri, 17 Jan 2020 18:51:07 +0000 (19:51 +0100)]
formatting

4 years agoExtend url in heading test a bit
Guillaume Gomez [Fri, 17 Jan 2020 18:49:03 +0000 (19:49 +0100)]
Extend url in heading test a bit

4 years agoClean up E0198 explanation
Guillaume Gomez [Thu, 16 Jan 2020 13:35:37 +0000 (14:35 +0100)]
Clean up E0198 explanation

4 years agoAdd regression test for integer literals in generic arguments in where clauses
varkor [Fri, 17 Jan 2020 14:21:14 +0000 (14:21 +0000)]
Add regression test for integer literals in generic arguments in where clauses

4 years agoStop treating `FalseEdges` and `FalseUnwind` as having semantic value for const eval
Oliver Scherer [Fri, 17 Jan 2020 16:09:05 +0000 (17:09 +0100)]
Stop treating `FalseEdges` and `FalseUnwind` as having semantic value for const eval

4 years agoAuto merge of #68311 - Dylan-DPC:rollup-wzgqw9t, r=Dylan-DPC
bors [Fri, 17 Jan 2020 15:58:24 +0000 (15:58 +0000)]
Auto merge of #68311 - Dylan-DPC:rollup-wzgqw9t, r=Dylan-DPC

Rollup of 4 pull requests

Successful merges:

 - #66564 (Document unsafe blocks in core::{cell, str, sync})
 - #67791 (Implement Lift using interners instead of in_arena)
 - #68278 ([self-profiler] Add example to `-Z help` to turn on query key recording)
 - #68300 (Allow added string.insert benchmarks to compile)

Failed merges:

r? @ghost

4 years agoOptions IP_MULTICAST_TTL and IP_MULTICAST_LOOP are 1 byte on BSD and Solaris
Vita Batrla [Fri, 17 Jan 2020 13:43:36 +0000 (14:43 +0100)]
Options IP_MULTICAST_TTL and IP_MULTICAST_LOOP are 1 byte on BSD and Solaris

See ip(4P) man page:
 IP_MULTICAST_TTL     Time  to live for multicast datagrams. This option
                      takes an unsigned character as  an  argument.  Its
                      value  is  the TTL that IP uses on outgoing multi-
                      cast datagrams. The default is 1.

 IP_MULTICAST_LOOP    Loopback for multicast datagrams. Normally  multi-
                      cast  datagrams  are  delivered  to members on the
                      sending  host  (or  sending  zone).  Setting   the
                      unsigned  character argument to 0 causes the oppo-
                      site behavior, meaning that  when  multiple  zones
                      are  present,  the  datagrams are delivered to all
                      zones except the sending zone.

https://docs.oracle.com/cd/E88353_01/html/E37851/ip-4p.html
https://man.openbsd.org/ip.4

4 years agoRollup merge of #68300 - ssomers:67281_take_2, r=Dylan-DPC
Dylan DPC [Fri, 17 Jan 2020 13:23:44 +0000 (18:53 +0530)]
Rollup merge of #68300 - ssomers:67281_take_2, r=Dylan-DPC

Allow added string.insert benchmarks to compile

Allow the code added by #67281 to compile.

(symptons listed [in internals forum](https://internals.rust-lang.org/t/x-py-how-to-benchmark-liballoc/11635))
r? @llogiq

4 years agoRollup merge of #68278 - wesleywiser:doc_query_key_recording, r=michaelwoerister
Dylan DPC [Fri, 17 Jan 2020 13:23:42 +0000 (18:53 +0530)]
Rollup merge of #68278 - wesleywiser:doc_query_key_recording, r=michaelwoerister

[self-profiler] Add example to `-Z help` to turn on query key recording

Also add the `default` option so that it's easy to add query key
recording to the default.

r? @michaelwoerister

4 years agoRollup merge of #67791 - Zoxc:lift-interning, r=eddyb
Dylan DPC [Fri, 17 Jan 2020 13:23:41 +0000 (18:53 +0530)]
Rollup merge of #67791 - Zoxc:lift-interning, r=eddyb

Implement Lift using interners instead of in_arena

r? @eddyb
cc @cjgillot

4 years agoRollup merge of #66564 - foeb:66219-document-unsafe-sync-cell-str, r=Amanieu
Dylan DPC [Fri, 17 Jan 2020 13:23:38 +0000 (18:53 +0530)]
Rollup merge of #66564 - foeb:66219-document-unsafe-sync-cell-str, r=Amanieu

Document unsafe blocks in core::{cell, str, sync}

Split from #66506 (issue #66219). Hopefully doing a chunk at a time is more manageable!

r? @RalfJung

4 years agoAdd @weiznich's regression test
Aaron Hill [Fri, 17 Jan 2020 13:22:40 +0000 (08:22 -0500)]
Add @weiznich's regression test

4 years agoFix typo
Aaron Hill [Fri, 17 Jan 2020 13:13:04 +0000 (08:13 -0500)]
Fix typo

Co-Authored-By: Oliver Scherer <github35764891676564198441@oli-obk.de>
4 years agoperf: Only search the potentially changed constraints in lexical_region_resolve
Markus Westerlind [Wed, 8 Jan 2020 09:35:51 +0000 (10:35 +0100)]
perf: Only search the potentially changed constraints in lexical_region_resolve

4 years agoperf: Filter out and process fixed constraints first in region expansion
Markus Westerlind [Tue, 7 Jan 2020 20:45:49 +0000 (21:45 +0100)]
perf: Filter out and process fixed constraints first in region expansion

Should reduce the number of elements as well as branches in the
extremely hot loop and process_constraint in benchmarks such as
unicode_normalization

4 years agoAuto merge of #68285 - oli-obk:specialization_regression, r=davidtwco
bors [Fri, 17 Jan 2020 12:25:07 +0000 (12:25 +0000)]
Auto merge of #68285 - oli-obk:specialization_regression, r=davidtwco

Array repeat expression lengths must be monomorphic at MIR building time

fixes #67743

4 years ago[self-profiler] Add example to `-Z help` to turn on query key recording
Wesley Wiser [Thu, 16 Jan 2020 13:24:34 +0000 (08:24 -0500)]
[self-profiler] Add example to `-Z help` to turn on query key recording

Also add the `default` option so that it's easy to add query key
recording to the default.

4 years agoAuto merge of #68305 - Dylan-DPC:rollup-aoohsz8, r=Dylan-DPC
bors [Fri, 17 Jan 2020 09:17:18 +0000 (09:17 +0000)]
Auto merge of #68305 - Dylan-DPC:rollup-aoohsz8, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #67956 (Detail transitive containment in E0588 diagnostic)
 - #68153 (resolve: Point at the private item definitions in privacy errors)
 - #68195 (Account for common `impl Trait`/`dyn Trait` return type errors)
 - #68288 (Fix some of the rustfmt fallout in Miri)
 - #68292 (don't clone types that are copy)
 - #68301 (Don't propagate __RUST_TEST_INVOKE to subprocess)

Failed merges:

r? @ghost

4 years agoRollup merge of #68301 - tmandry:dont-propagate-test-invoke, r=alexcrichton
Dylan DPC [Fri, 17 Jan 2020 05:46:42 +0000 (11:16 +0530)]
Rollup merge of #68301 - tmandry:dont-propagate-test-invoke, r=alexcrichton

Don't propagate __RUST_TEST_INVOKE to subprocess

When -Z panic_abort_tests is enabled, we use an environment variable to
tell the subprocess which test to invoke. If that subprocess then
invokes another Rust test binary, chaos ensues.

r? @alexcrichton

4 years agoRollup merge of #68292 - matthiaskrgr:clone_on_copy, r=eddyb
Dylan DPC [Fri, 17 Jan 2020 05:46:40 +0000 (11:16 +0530)]
Rollup merge of #68292 - matthiaskrgr:clone_on_copy, r=eddyb

don't clone types that are copy

Found via clippy.

r? @eddyb

4 years agoRollup merge of #68288 - RalfJung:fmt, r=oli-obk
Dylan DPC [Fri, 17 Jan 2020 05:46:39 +0000 (11:16 +0530)]
Rollup merge of #68288 - RalfJung:fmt, r=oli-obk

Fix some of the rustfmt fallout in Miri

re-post of https://github.com/rust-lang/rust/pull/67833 without the `rustfmt::skip`

r? @oli-obk

4 years agoRollup merge of #68195 - estebank:impl-trait-2000, r=Centril
Dylan DPC [Fri, 17 Jan 2020 05:46:37 +0000 (11:16 +0530)]
Rollup merge of #68195 - estebank:impl-trait-2000, r=Centril

Account for common `impl Trait`/`dyn Trait` return type errors

- When all return paths have the same type, suggest `impl Trait`.
- When all return paths implement the expected `trait`, suggest `Box<dyn Trait>` and mention using an `enum`.
- When multiple different types are returned and `impl Trait` is expected, extend the explanation.
- When return type is `impl Trait` and the return paths do not implement `Trait`, point at the returned values.
- Split `src/librustc/traits/error_reporting.rs` into multiple files to keep size under control.

Fix #68110, cc #66523.

4 years agoRollup merge of #68153 - petrochenkov:privdiag, r=estebank
Dylan DPC [Fri, 17 Jan 2020 05:46:36 +0000 (11:16 +0530)]
Rollup merge of #68153 - petrochenkov:privdiag, r=estebank

resolve: Point at the private item definitions in privacy errors

A basic version of https://github.com/rust-lang/rust/pull/67951.
r? @estebank

4 years agoRollup merge of #67956 - varkor:E0588-provide-context, r=estebank
Dylan DPC [Fri, 17 Jan 2020 05:46:32 +0000 (11:16 +0530)]
Rollup merge of #67956 - varkor:E0588-provide-context, r=estebank

Detail transitive containment in E0588 diagnostic

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

4 years agoAuto merge of #67731 - matthewjasper:drop-in-place-reclimit, r=eddyb
bors [Fri, 17 Jan 2020 04:13:38 +0000 (04:13 +0000)]
Auto merge of #67731 - matthewjasper:drop-in-place-reclimit, r=eddyb

Handle recursive instantiation of drop shims

The compiler used to hang because the recursion limit was never hit.

4 years agoAdd SAFETY comment for atomic example
Phoebe Bell [Fri, 17 Jan 2020 03:26:02 +0000 (19:26 -0800)]
Add SAFETY comment for atomic example

4 years agoreview comments
Esteban Küber [Fri, 17 Jan 2020 02:27:18 +0000 (18:27 -0800)]
review comments

4 years agoFix formatting: ./x.py fmt
Phoebe Bell [Fri, 17 Jan 2020 02:50:53 +0000 (18:50 -0800)]
Fix formatting: ./x.py fmt

4 years agoMove comments for tidy
Phoebe Bell [Fri, 17 Jan 2020 02:38:04 +0000 (18:38 -0800)]
Move comments for tidy

4 years agoElaborate on SAFETY comments
Phoebe Bell [Thu, 26 Dec 2019 20:56:34 +0000 (12:56 -0800)]
Elaborate on SAFETY comments

4 years agoApply suggestions from code review
Phoebe Bell [Thu, 26 Dec 2019 19:57:57 +0000 (11:57 -0800)]
Apply suggestions from code review

Co-Authored-By: Ralf Jung <post@ralfj.de>
4 years agoFix typo "gurantees -> guarantees"
Phoebe Bell [Wed, 20 Nov 2019 02:39:36 +0000 (18:39 -0800)]
Fix typo "gurantees -> guarantees"

4 years agoDocument unsafe blocks in core::{cell, str, sync}
Phoebe Bell [Wed, 20 Nov 2019 02:28:32 +0000 (18:28 -0800)]
Document unsafe blocks in core::{cell, str, sync}

4 years agoDo not ICE on malformed suggestion spans
Esteban Küber [Wed, 15 Jan 2020 17:57:06 +0000 (09:57 -0800)]
Do not ICE on malformed suggestion spans

4 years agoDon't propagate __RUST_TEST_INVOKE to subprocess
Tyler Mandry [Fri, 17 Jan 2020 00:29:32 +0000 (16:29 -0800)]
Don't propagate __RUST_TEST_INVOKE to subprocess

When -Z panic_abort_tests is enabled, we use an environment variable to
tell the subprocess which test to invoke. If that subprocess then
invokes another Rust test binary, chaos ensues.

4 years agoAuto merge of #66716 - derekdreery:debug_non_exhaustive, r=dtolnay
bors [Fri, 17 Jan 2020 00:20:48 +0000 (00:20 +0000)]
Auto merge of #66716 - derekdreery:debug_non_exhaustive, r=dtolnay

Implement `DebugStruct::non_exhaustive`.

This patch adds a function (finish_non_exhaustive) to add ellipsis before the closing brace when formatting using `DebugStruct`.

 ## Example

 ```rust
 #![feature(debug_non_exhaustive)]
 use std::fmt;

 struct Bar {
     bar: i32,
     hidden: f32,
 }

 impl fmt::Debug for Bar {
     fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         fmt.debug_struct("Bar")
            .field("bar", &self.bar)
            .non_exhaustive(true) // Show that some other field(s) exist.
            .finish()
     }
 }

 assert_eq!(
     format!("{:?}", Bar { bar: 10, hidden: 1.0 }),
     "Bar { bar: 10, .. }",
 );
 ```

4 years agoAllow added string.insert benchmarks to compile
Stein Somers [Fri, 17 Jan 2020 00:05:49 +0000 (01:05 +0100)]
Allow added string.insert benchmarks to compile

4 years agoFilter and test predicates using `normalize_and_test_predicates` for const-prop
Aaron Hill [Thu, 16 Jan 2020 23:53:51 +0000 (18:53 -0500)]
Filter and test predicates using `normalize_and_test_predicates` for const-prop

Fixes #68264

Previously, I attempted to use
`substitute_normalize_and_test_predicates` to detect unsatisfiable
bounds. Unfortunately, since const-prop runs in a generic environment
(we don't have any of the function's generic parameters substituted),
this could lead to cycle errors when attempting to normalize predicates.

This check is replaced with a more precise check. We now only call
`normalize_and_test_predicates` on predicates that have the possibility
of being proved unsatisfiable - that is, predicates that don't depend
on anything local to the function (e.g. generic parameters). This
ensures that we don't hit cycle errors when we normalize said
predicates, while still ensuring that we detect unsatisfiable
predicates.

4 years agoRevert previous attempt at detecting unsatisfiable predicates
Aaron Hill [Thu, 16 Jan 2020 23:47:52 +0000 (18:47 -0500)]
Revert previous attempt at detecting unsatisfiable predicates

4 years agodon't clone types that are copy
Matthias Krüger [Thu, 16 Jan 2020 22:15:52 +0000 (23:15 +0100)]
don't clone types that are copy

found via clippy

4 years agoAuto merge of #68287 - flip1995:clippyup, r=oli-obk
bors [Thu, 16 Jan 2020 20:59:57 +0000 (20:59 +0000)]
Auto merge of #68287 - flip1995:clippyup, r=oli-obk

Update Clippy

cc rust-lang/rust-clippy#5054

No issue were opened for this.

r? @Manishearth

4 years agoImprove code readability
Guillaume Gomez [Thu, 16 Jan 2020 20:36:39 +0000 (21:36 +0100)]
Improve code readability

4 years agoRust ./x.py fmt
Richard Dodd [Thu, 16 Jan 2020 20:11:16 +0000 (20:11 +0000)]
Rust ./x.py fmt

4 years agoDon't warn about snake case for field puns that don't introduce a new name.
jumbatm [Sat, 23 Nov 2019 04:52:40 +0000 (14:52 +1000)]
Don't warn about snake case for field puns that don't introduce a new name.

4 years agoreview comments
Esteban Küber [Thu, 16 Jan 2020 19:32:50 +0000 (11:32 -0800)]
review comments

4 years agoIgnore some tests on platforms without libstd spans
Vadim Petrochenkov [Thu, 16 Jan 2020 19:19:55 +0000 (22:19 +0300)]
Ignore some tests on platforms without libstd spans

4 years agoresolve: Say "import" when reporting private imports
Vadim Petrochenkov [Sun, 12 Jan 2020 13:20:57 +0000 (16:20 +0300)]
resolve: Say "import" when reporting private imports

4 years agoresolve: Point at the private item definitions in privacy errors
Vadim Petrochenkov [Sun, 12 Jan 2020 13:04:03 +0000 (16:04 +0300)]
resolve: Point at the private item definitions in privacy errors

4 years agoresolve: Move privacy error reporting into a separate method
Vadim Petrochenkov [Sun, 12 Jan 2020 10:29:00 +0000 (13:29 +0300)]
resolve: Move privacy error reporting into a separate method

Give named fields to `struct PrivacyError`
Move `fn report_ambiguity_error` to `diagnostics.rs`

4 years agoadjust Deref comment
Ralf Jung [Mon, 6 Jan 2020 10:35:55 +0000 (11:35 +0100)]
adjust Deref comment

4 years agolet rustfmt undo most of my edits :(
Ralf Jung [Fri, 3 Jan 2020 12:33:28 +0000 (13:33 +0100)]
let rustfmt undo most of my edits :(

4 years agoAccount for object safety when suggesting `Box<dyn Trait>`
Esteban Küber [Wed, 15 Jan 2020 23:49:54 +0000 (15:49 -0800)]
Account for object safety when suggesting `Box<dyn Trait>`

4 years agoreview comments
Esteban Küber [Wed, 15 Jan 2020 19:14:05 +0000 (11:14 -0800)]
review comments

4 years agoFix error index test
Esteban Küber [Wed, 15 Jan 2020 17:55:56 +0000 (09:55 -0800)]
Fix error index test

4 years agoreview comments
Esteban Küber [Tue, 14 Jan 2020 22:49:30 +0000 (14:49 -0800)]
review comments

4 years agoreview comments
Esteban Küber [Tue, 14 Jan 2020 21:18:06 +0000 (13:18 -0800)]
review comments

4 years agofix error code index comment
Esteban Küber [Tue, 14 Jan 2020 18:29:13 +0000 (10:29 -0800)]
fix error code index comment

4 years agoSplit `librustc/traits/error_reporting.rs`
Esteban Küber [Tue, 14 Jan 2020 02:27:42 +0000 (18:27 -0800)]
Split `librustc/traits/error_reporting.rs`

4 years agofix rustfmt fallout
Ralf Jung [Fri, 3 Jan 2020 12:31:56 +0000 (13:31 +0100)]
fix rustfmt fallout