]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoAuto merge of #67808 - Marwes:projection_normalization_recurse, r=nikomatsakis
bors [Sun, 5 Jan 2020 01:18:57 +0000 (01:18 +0000)]
Auto merge of #67808 - Marwes:projection_normalization_recurse, r=nikomatsakis

perf: Don't recurse into types that do not need normalizing

A bit speculative at this stage but profiling shows that type folding
takes up a substantial amount of time during normalization which may
indicate that many types may be folded despite there being nothing to
normalize

4 years agoAuto merge of #67803 - Centril:librustc_hir, r=Zoxc
bors [Sat, 4 Jan 2020 21:50:12 +0000 (21:50 +0000)]
Auto merge of #67803 - Centril:librustc_hir, r=Zoxc

Extract `rustc_hir` out of `rustc`

The new crate contains:
```rust
pub mod def;
pub mod def_id;
mod hir;
pub mod hir_id;
pub mod itemlikevisit;
pub mod pat_util;
pub mod print;
mod stable_hash_impls;

pub use hir::*;
pub use hir_id::*;
pub use stable_hash_impls::HashStableContext;
```

Remains to be done in follow-up PRs:

- Move `rustc::hir::map` into `rustc_hir_map` -- this has to be a separate crate due to the `dep_graph` (blocked on https://github.com/rust-lang/rust/pull/67761).

- Move references to `rustc::hir` to `rustc_hir` where possible.

cc https://github.com/rust-lang/rust/issues/65031

r? @Zoxc

4 years agoAuto merge of #67874 - Dylan-DPC:rollup-xy6bkoe, r=Dylan-DPC
bors [Sat, 4 Jan 2020 18:39:14 +0000 (18:39 +0000)]
Auto merge of #67874 - Dylan-DPC:rollup-xy6bkoe, r=Dylan-DPC

Rollup of 4 pull requests

Successful merges:

 - #67137 (libstd uses `core::panic::Location` where possible.)
 - #67709 (Introduce an option for disabling deduplication of diagnostics)
 - #67775 (Make "use $crate" a hard error)
 - #67812 (Tweak and extend internal BTreeMap documentation, including debug asserts.)

Failed merges:

r? @ghost

4 years agoRollup merge of #67812 - ssomers:btreemap_internal_doc, r=rkruppe
Dylan DPC [Sat, 4 Jan 2020 18:22:51 +0000 (23:52 +0530)]
Rollup merge of #67812 - ssomers:btreemap_internal_doc, r=rkruppe

Tweak and extend internal BTreeMap documentation, including debug asserts.

Gathered from work on various other pull requests (e.g. #67725, #67686).

4 years agoRollup merge of #67775 - mental32:master, r=Dylan-DPC
Dylan DPC [Sat, 4 Jan 2020 18:22:50 +0000 (23:52 +0530)]
Rollup merge of #67775 - mental32:master, r=Dylan-DPC

Make "use $crate" a hard error

Closes #37390

4 years agoRollup merge of #67709 - petrochenkov:nodedup2, r=Centril
Dylan DPC [Sat, 4 Jan 2020 18:22:48 +0000 (23:52 +0530)]
Rollup merge of #67709 - petrochenkov:nodedup2, r=Centril

Introduce an option for disabling deduplication of diagnostics

With the intent of using it in UI tests (https://github.com/rust-lang/rust/pull/67122).

The option is boolean (`-Z deduplicate-diagnostics=yes/no`) and can be specified multiple times with later values overriding earlier values (`-Z deduplicate-diagnostics=no -Z deduplicate-diagnostics=yes` == `-Z deduplicate-diagnostics=yes`), so it can be set in a hierarchical way, e.g. UI testing infra may disable the deduplication by default with specific tests being able to enable it back.

4 years agoRollup merge of #67137 - anp:tracked-panic-internals, r=eddyb
Dylan DPC [Sat, 4 Jan 2020 18:22:44 +0000 (23:52 +0530)]
Rollup merge of #67137 - anp:tracked-panic-internals, r=eddyb

libstd uses `core::panic::Location` where possible.

cc @eddyb

4 years agopacify the parallel compiler
Mazdak Farrokhzad [Thu, 2 Jan 2020 08:53:15 +0000 (09:53 +0100)]
pacify the parallel compiler

4 years agocleanup librustc_hir/Cargo.toml
Mazdak Farrokhzad [Thu, 2 Jan 2020 07:51:53 +0000 (08:51 +0100)]
cleanup librustc_hir/Cargo.toml

4 years agohir::{hir,def,itemlikevisit,pat_util,print} -> rustc_hir
Mazdak Farrokhzad [Thu, 2 Jan 2020 04:18:45 +0000 (05:18 +0100)]
hir::{hir,def,itemlikevisit,pat_util,print} -> rustc_hir

Also fix fallout wrt. HashStable.

4 years agoextract Export, ExportMap from hir::def
Mazdak Farrokhzad [Thu, 2 Jan 2020 03:53:12 +0000 (04:53 +0100)]
extract Export, ExportMap from hir::def

4 years agosimplify self::Namespace::* import
Mazdak Farrokhzad [Thu, 2 Jan 2020 03:24:17 +0000 (04:24 +0100)]
simplify self::Namespace::* import

4 years agomove {Par}DeepVisitor to intravisit
Mazdak Farrokhzad [Thu, 2 Jan 2020 03:18:51 +0000 (04:18 +0100)]
move {Par}DeepVisitor to  intravisit

4 years agohir::hir: simplify some imports
Mazdak Farrokhzad [Thu, 2 Jan 2020 02:48:12 +0000 (03:48 +0100)]
hir::hir: simplify some imports

4 years agosplit hir/mod.rs -> hir.rs & hir/hir.rs
Mazdak Farrokhzad [Thu, 2 Jan 2020 02:39:11 +0000 (03:39 +0100)]
split hir/mod.rs -> hir.rs & hir/hir.rs

4 years agoRestrict visibility of location_triple_for_span.
Adam Perry [Fri, 3 Jan 2020 13:44:49 +0000 (05:44 -0800)]
Restrict visibility of location_triple_for_span.

4 years agoClean up comments in panicking infra.
Adam Perry [Sat, 4 Jan 2020 08:49:18 +0000 (00:49 -0800)]
Clean up comments in panicking infra.

4 years agoUpdate ABI in const impls of panic_fn/begin_panic_fn.
Adam Perry [Tue, 24 Dec 2019 03:25:09 +0000 (19:25 -0800)]
Update ABI in const impls of panic_fn/begin_panic_fn.

4 years agoTest cleanups to match #[track_caller] in panic!.
Adam Perry [Sun, 8 Dec 2019 12:51:55 +0000 (04:51 -0800)]
Test cleanups to match #[track_caller] in panic!.

* Removes unnecessary feature flag from track_caller test.
* Tests of panic internals no longer need to explicitly construct Location.
* Add #![warn(const_err)] to retain-never-const per @oli-obk.
* Add track_caller test with diverging function.

4 years agocore and std macros and panic internals use panic::Location::caller.
Adam Perry [Sat, 7 Dec 2019 16:37:08 +0000 (08:37 -0800)]
core and std macros and panic internals use panic::Location::caller.

4 years agomove `HirId` to librustc_hir::hir_id
Mazdak Farrokhzad [Wed, 25 Dec 2019 14:26:30 +0000 (15:26 +0100)]
move `HirId` to librustc_hir::hir_id

4 years agomove def_id to new rustc_hir crate
Mazdak Farrokhzad [Wed, 25 Dec 2019 02:51:27 +0000 (03:51 +0100)]
move def_id to new rustc_hir crate

4 years agomove describe_as_module to where it's used
Mazdak Farrokhzad [Wed, 25 Dec 2019 00:27:51 +0000 (01:27 +0100)]
move describe_as_module to where it's used

4 years agoremove DefId::to_dep_node (dead code)
Mazdak Farrokhzad [Tue, 24 Dec 2019 23:31:55 +0000 (00:31 +0100)]
remove DefId::to_dep_node (dead code)

4 years ago{HirId,ItemLocal}{Map,Set} -> rustc::hir & nix rustc::nodemap
Mazdak Farrokhzad [Tue, 24 Dec 2019 23:22:24 +0000 (00:22 +0100)]
{HirId,ItemLocal}{Map,Set} -> rustc::hir & nix rustc::nodemap

4 years agoDefId{Map,Set} -> rustc::hir::def_id
Mazdak Farrokhzad [Tue, 24 Dec 2019 23:10:10 +0000 (00:10 +0100)]
DefId{Map,Set} -> rustc::hir::def_id

4 years agocanonicalize rustc_session imports
Mazdak Farrokhzad [Tue, 24 Dec 2019 22:43:44 +0000 (23:43 +0100)]
canonicalize rustc_session imports

4 years agomove Node{Map,Set} -> rustc_session::node_id
Mazdak Farrokhzad [Tue, 24 Dec 2019 21:42:56 +0000 (22:42 +0100)]
move Node{Map,Set} -> rustc_session::node_id

4 years agodefine_id_collections -> rustc_data_structures
Mazdak Farrokhzad [Tue, 24 Dec 2019 21:32:36 +0000 (22:32 +0100)]
define_id_collections -> rustc_data_structures

4 years agocanonicalize FxHash{Map,Set} imports
Mazdak Farrokhzad [Tue, 24 Dec 2019 04:02:53 +0000 (05:02 +0100)]
canonicalize FxHash{Map,Set} imports

4 years agoextract rustc::middle::codegen_fn_attrs
Mazdak Farrokhzad [Tue, 24 Dec 2019 04:30:02 +0000 (05:30 +0100)]
extract rustc::middle::codegen_fn_attrs

4 years agofn adt_kind -> wfcheck
Mazdak Farrokhzad [Tue, 24 Dec 2019 04:12:01 +0000 (05:12 +0100)]
fn adt_kind -> wfcheck

4 years agoTweak and extend internal documentation, including debug asserts.
Stein Somers [Thu, 2 Jan 2020 11:33:07 +0000 (12:33 +0100)]
Tweak and extend internal documentation, including debug asserts.

Co-Authored-By: Robin Kruppe <robin.kruppe@gmail.com>
4 years agoAuto merge of #67866 - GuillaumeGomez:rollup-32vsg5b, r=GuillaumeGomez
bors [Sat, 4 Jan 2020 12:37:27 +0000 (12:37 +0000)]
Auto merge of #67866 - GuillaumeGomez:rollup-32vsg5b, r=GuillaumeGomez

Rollup of 4 pull requests

Successful merges:

 - #67822 (Revert `const_err` lint checking of casts)
 - #67823 (improve some `Drop`-related error messages)
 - #67837 (Clean up err codes)
 - #67848 (Remove unused `#[link_name = "m"]` attributes)

Failed merges:

r? @ghost

4 years agoRollup merge of #67848 - ollie27:float_link_name_attr, r=Dylan-DPC
Guillaume Gomez [Sat, 4 Jan 2020 12:17:32 +0000 (13:17 +0100)]
Rollup merge of #67848 - ollie27:float_link_name_attr, r=Dylan-DPC

Remove unused `#[link_name = "m"]` attributes

These were perhaps supposed to be `#[link(name = "m")]` but linking libm should be handled by the libc crate anyway.

They should have triggered a compile error: #47725

4 years agoRollup merge of #67837 - GuillaumeGomez:clean-up-err-codes, r=Dylan-DPC
Guillaume Gomez [Sat, 4 Jan 2020 12:17:30 +0000 (13:17 +0100)]
Rollup merge of #67837 - GuillaumeGomez:clean-up-err-codes, r=Dylan-DPC

Clean up err codes

r? @Dylan-DPC

4 years agoRollup merge of #67823 - euclio:drop-improvements, r=petrochenkov
Guillaume Gomez [Sat, 4 Jan 2020 12:17:29 +0000 (13:17 +0100)]
Rollup merge of #67823 - euclio:drop-improvements, r=petrochenkov

improve some `Drop`-related error messages

4 years agoRollup merge of #67822 - wesleywiser:revert_67676, r=oli-obk
Guillaume Gomez [Sat, 4 Jan 2020 12:17:27 +0000 (13:17 +0100)]
Rollup merge of #67822 - wesleywiser:revert_67676, r=oli-obk

Revert `const_err` lint checking of casts

Reverts part of #67676

r? @oli-obk

cc @SimonSapin

4 years agoAuto merge of #67788 - cjgillot:delint-day, r=Zoxc
bors [Sat, 4 Jan 2020 09:32:29 +0000 (09:32 +0000)]
Auto merge of #67788 - cjgillot:delint-day, r=Zoxc

Move early and late lint mechanisms to librustc_lint.

As requested, split from #67737

r? @Zoxc

4 years agotry to fix ui errors
Yuki Okushi [Fri, 3 Jan 2020 09:25:49 +0000 (18:25 +0900)]
try to fix ui errors

4 years agoAuto merge of #67853 - Centril:rollup-sx5zi9n, r=Centril
bors [Sat, 4 Jan 2020 06:20:09 +0000 (06:20 +0000)]
Auto merge of #67853 - Centril:rollup-sx5zi9n, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #66913 (Suggest calling method when first argument is `self`)
 - #67531 (no longer promote non-pattern const functions)
 - #67773 (Add a test for #37333)
 - #67786 (Nix reexports from `rustc_span` in `syntax`)
 - #67789 (Cleanup linkchecker whitelist)
 - #67810 (Implement uncommon_codepoints lint.)
 - #67835 (tweak wording of mismatched delimiter errors)
 - #67845 (Also remove const-hack for abs)

Failed merges:

r? @ghost

4 years agoUpdate E0164.md
Dylan DPC [Sat, 4 Jan 2020 06:11:35 +0000 (11:41 +0530)]
Update E0164.md

4 years agoRollup merge of #67845 - jumbatm:also-unconst-hack-abs, r=oli-obk
Mazdak Farrokhzad [Sat, 4 Jan 2020 01:19:55 +0000 (02:19 +0100)]
Rollup merge of #67845 - jumbatm:also-unconst-hack-abs, r=oli-obk

Also remove const-hack for abs

Closes #67842.

r? @oli-obk

4 years agoRollup merge of #67835 - euclio:delimiter-wording, r=Centril
Mazdak Farrokhzad [Sat, 4 Jan 2020 01:19:54 +0000 (02:19 +0100)]
Rollup merge of #67835 - euclio:delimiter-wording, r=Centril

tweak wording of mismatched delimiter errors

This PR improves the wording of the "incorrect delimiter" error messages. Here's a quick rationale:

- *"un-closed" -> "unclosed"*: "unclosed" is valid English, so there's no need to hyphenate the prefix. This should be pretty uncontroversial, I think.
- *"close delimiter" -> "closing delimiter"*: In my anecdotal experience, I've always heard "closing delimiter" or "closing parenthesis". In addition, the codebase already uses this terminology in comments and function names more than "close delimiter", which could indicate that it's more intuitive.
- "incorrect delimiter" -> "mismatched delimiter": "Incorrect delimiter" is vague; why is it incorrect? "mismatched" clearly indicates why the delimiter is causing the error.

r? @estebank

4 years agoRollup merge of #67810 - crlf0710:uncommon_codepoints_lint, r=Manishearth
Mazdak Farrokhzad [Sat, 4 Jan 2020 01:19:52 +0000 (02:19 +0100)]
Rollup merge of #67810 - crlf0710:uncommon_codepoints_lint, r=Manishearth

Implement uncommon_codepoints lint.

Part of #55467 .  The checks of `$crate` and `{{root}}` are very unfortunate. But i'm not sure where they belongs to.

4 years agoRollup merge of #67789 - ollie27:linkchecker_whitelist, r=nikomatsakis
Mazdak Farrokhzad [Sat, 4 Jan 2020 01:19:51 +0000 (02:19 +0100)]
Rollup merge of #67789 - ollie27:linkchecker_whitelist, r=nikomatsakis

Cleanup linkchecker whitelist

linkchecker is no longer run on the compiler docs so they can be removed from the whitelist.

4 years agoRollup merge of #67786 - Centril:canon-span, r=petrochenkov
Mazdak Farrokhzad [Sat, 4 Jan 2020 01:19:49 +0000 (02:19 +0100)]
Rollup merge of #67786 - Centril:canon-span, r=petrochenkov

Nix reexports from `rustc_span` in `syntax`

Remove reexports `syntax::{source_map, symbol, edition}` and use `rustc_span` paths directly.

r? @petrochenkov

4 years agoRollup merge of #67773 - michalt:issue-37333-test, r=nikomatsakis
Mazdak Farrokhzad [Sat, 4 Jan 2020 01:19:48 +0000 (02:19 +0100)]
Rollup merge of #67773 - michalt:issue-37333-test, r=nikomatsakis

Add a test for #37333

The test checks that we reuse the CGU of a crate when the implementation
details of an `extern crate` have changed.

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
4 years agoRollup merge of #67531 - RalfJung:tame-promotion, r=nikomatsakis
Mazdak Farrokhzad [Sat, 4 Jan 2020 01:19:46 +0000 (02:19 +0100)]
Rollup merge of #67531 - RalfJung:tame-promotion, r=nikomatsakis

no longer promote non-pattern const functions

This is trying to pack-pedal a bit on promotion feature creep, as proposed by @eddyb [here](https://github.com/rust-lang/const-eval/issues/19#issuecomment-472799062): possibly, a sane subset of `const fn` that we could promote are those that are just constructors -- the same subset that we might want to allow in pattern position at some point.

So, this removes the `rustc_promotable` attribute from the three functions they identified that do not fit this pattern. The first step is to run crater to see if there is code in the wild that relies on this being promotable.

r? @oli-obk

4 years agoRollup merge of #66913 - VirrageS:help-self, r=varkor,Centril
Mazdak Farrokhzad [Sat, 4 Jan 2020 01:19:44 +0000 (02:19 +0100)]
Rollup merge of #66913 - VirrageS:help-self, r=varkor,Centril

Suggest calling method when first argument is `self`

Closes: #66782
I've explored different approaches for this MR but I think the most straightforward is the best one.

I've tried to find out if the methods for given type exist (to maybe have a better suggestion), but we don't collect them anywhere and collecting them is quite problematic. Moreover, collecting all the methods would require rewriting big part of the code and also could potentially include performance degradation, which I don't think is necessary for this simple case.

4 years agoRemove unused `#[link_name = "m"]` attributes
Oliver Middleton [Fri, 3 Jan 2020 23:41:11 +0000 (23:41 +0000)]
Remove unused `#[link_name = "m"]` attributes

These were perhaps supposed to be `#[link(name = "m")]` but linking libm should be handled by the libc crate anyway.

4 years agoClean up E0164 explanation
Guillaume Gomez [Fri, 3 Jan 2020 16:42:56 +0000 (17:42 +0100)]
Clean up E0164 explanation

4 years agoSmall error explanations cleanup
Guillaume Gomez [Fri, 3 Jan 2020 16:42:44 +0000 (17:42 +0100)]
Small error explanations cleanup

4 years agoclarify that `Drop` can be implemented for enums and unions too
Andy Russell [Fri, 3 Jan 2020 03:24:21 +0000 (22:24 -0500)]
clarify that `Drop` can be implemented for enums and unions too

4 years agoimprove generic `Drop` error messages
Andy Russell [Fri, 3 Jan 2020 00:02:06 +0000 (19:02 -0500)]
improve generic `Drop` error messages

- Use the span of the predicate
- Use the def's description instead of "struct/enum" (notably incorrect
  for unions)
- Align formatting with other error messages

4 years agoAlso remove const-hack for abs
jumbatm [Fri, 3 Jan 2020 22:42:05 +0000 (08:42 +1000)]
Also remove const-hack for abs

4 years agoAuto merge of #67829 - michaelwoerister:try-to-fix-pgo-branch-weights-test, r=Mark...
bors [Fri, 3 Jan 2020 22:03:20 +0000 (22:03 +0000)]
Auto merge of #67829 - michaelwoerister:try-to-fix-pgo-branch-weights-test, r=Mark-Simulacrum

Attempt to fix intermittent failures of pgo-branch-weights test.

This PR tries to fix the intermittent failures of the pgo-branch-weights test (https://github.com/rust-lang/rust/issues/67746). The failing instances show no `!prof` annotations in LLVM IR. One possible cause is that the instrumented binary did not record anything. This is something I've occasionally seen happen for similarly small programs when using GNU ld as linker. The linker would not properly append the instruction counter sections, leading to most counters being dropped. This PR makes the test use the Gold linker instead.

It also makes each command exit immediately on failure so we can pinpoint the failure source better, should there still be a problem.

r? @Mark-Simulacrum

4 years agoAuto merge of #67809 - RalfJung:miri, r=RalfJung
bors [Fri, 3 Jan 2020 18:46:13 +0000 (18:46 +0000)]
Auto merge of #67809 - RalfJung:miri, r=RalfJung

update miri

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

4 years agoApply suggestions from code review
mental [Fri, 3 Jan 2020 15:48:10 +0000 (17:48 +0200)]
Apply suggestions from code review

Co-Authored-By: Yuki Okushi <huyuumi.dev@gmail.com>
4 years agoAddress review comments + Fix rebase
Vadim Petrochenkov [Fri, 3 Jan 2020 14:03:11 +0000 (18:03 +0400)]
Address review comments + Fix rebase

4 years agoAdd a test
Vadim Petrochenkov [Sun, 29 Dec 2019 20:53:35 +0000 (23:53 +0300)]
Add a test

4 years agorustdoc: Respect diagnostic debugging options
Vadim Petrochenkov [Sun, 29 Dec 2019 20:07:23 +0000 (23:07 +0300)]
rustdoc: Respect diagnostic debugging options

4 years agoIntroduce an option for disabling deduplication of diagnostics
Vadim Petrochenkov [Sun, 29 Dec 2019 19:10:47 +0000 (22:10 +0300)]
Introduce an option for disabling deduplication of diagnostics

4 years agotweak wording of mismatched delimiter errors
Andy Russell [Fri, 3 Jan 2020 13:40:15 +0000 (08:40 -0500)]
tweak wording of mismatched delimiter errors

4 years agoThank you Dylan and JohnTitor for blessing me.
mental [Fri, 3 Jan 2020 09:50:12 +0000 (11:50 +0200)]
Thank you Dylan and JohnTitor for blessing me.

4 years agoAttempt to fix intermittent failures of pgo-branch-weights test.
Michael Woerister [Fri, 3 Jan 2020 09:40:15 +0000 (10:40 +0100)]
Attempt to fix intermittent failures of pgo-branch-weights test.

4 years agoAuto merge of #67828 - JohnTitor:rollup-qmswkkl, r=JohnTitor
bors [Fri, 3 Jan 2020 09:07:05 +0000 (09:07 +0000)]
Auto merge of #67828 - JohnTitor:rollup-qmswkkl, r=JohnTitor

Rollup of 10 pull requests

Successful merges:

 - #67450 (Allow for setting a ThinLTO import limit during bootstrap)
 - #67595 (Suggest adding a lifetime constraint for opaque type)
 - #67636 (allow rustfmt key in [build] section)
 - #67736 (Less-than is asymmetric, not antisymmetric)
 - #67762 (Add missing links for insecure_time)
 - #67783 (Warn for bindings named same as variants when matching against a borrow)
 - #67796 (Ensure that we process projections during MIR inlining)
 - #67807 (Use drop instead of the toilet closure `|_| ()`)
 - #67816 (Clean up err codes)
 - #67825 (Minor: change take() docs grammar to match other docs)

Failed merges:

r? @ghost

4 years agoRollup merge of #67825 - petertodd:2020-mem-take-grammar, r=steveklabnik
Yuki Okushi [Fri, 3 Jan 2020 08:56:33 +0000 (17:56 +0900)]
Rollup merge of #67825 - petertodd:2020-mem-take-grammar, r=steveklabnik

Minor: change take() docs grammar to match other docs

Eg. mem::replace()

4 years agoRollup merge of #67816 - GuillaumeGomez:clean-up-err-codes, r=Dylan-DPC
Yuki Okushi [Fri, 3 Jan 2020 08:56:32 +0000 (17:56 +0900)]
Rollup merge of #67816 - GuillaumeGomez:clean-up-err-codes, r=Dylan-DPC

Clean up err codes

r? @Dylan-DPC

4 years agoRollup merge of #67807 - lzutao:toilet-closure, r=Centril
Yuki Okushi [Fri, 3 Jan 2020 08:56:30 +0000 (17:56 +0900)]
Rollup merge of #67807 - lzutao:toilet-closure, r=Centril

Use drop instead of the toilet closure `|_| ()`

4 years agoRollup merge of #67796 - Aaron1011:fix/mir-inline-proj, r=wesleywiser
Yuki Okushi [Fri, 3 Jan 2020 08:56:29 +0000 (17:56 +0900)]
Rollup merge of #67796 - Aaron1011:fix/mir-inline-proj, r=wesleywiser

Ensure that we process projections during MIR inlining

Fixes #67710

Previously, we were not calling `super_place`, which resulted in us
failing to update any local references that occur in
ProjectionElem::Index. This caused the post-inlining MIR to contain a
reference to a local ID from the inlined callee, leading to an ICE
due to a type mismatch.

4 years agoRollup merge of #67783 - LeSeulArtichaut:pattern-ref-warning, r=Centril
Yuki Okushi [Fri, 3 Jan 2020 08:56:27 +0000 (17:56 +0900)]
Rollup merge of #67783 - LeSeulArtichaut:pattern-ref-warning, r=Centril

Warn for bindings named same as variants when matching against a borrow

Fixes #67776

4 years agoRollup merge of #67762 - lzutao:systemtime-links, r=joshtriplett
Yuki Okushi [Fri, 3 Jan 2020 08:56:26 +0000 (17:56 +0900)]
Rollup merge of #67762 - lzutao:systemtime-links, r=joshtriplett

Add missing links for insecure_time

4 years agoRollup merge of #67736 - taralx:patch-1, r=sfackler
Yuki Okushi [Fri, 3 Jan 2020 08:56:24 +0000 (17:56 +0900)]
Rollup merge of #67736 - taralx:patch-1, r=sfackler

Less-than is asymmetric, not antisymmetric

This has bothered me for a while. It's such a small nit, but...

4 years agoRollup merge of #67636 - semarie:bootstrap-rustfmt, r=Mark-Simulacrum
Yuki Okushi [Fri, 3 Jan 2020 08:56:23 +0000 (17:56 +0900)]
Rollup merge of #67636 - semarie:bootstrap-rustfmt, r=Mark-Simulacrum

allow rustfmt key in [build] section

Permit using `rustfmt` in `config.toml`. It will allow to not download `rustfmt` binary, which is not possible for at least some tiers-3 platforms.

Fixes: #67624
r? @Mark-Simulacrum

4 years agoRollup merge of #67595 - ohadravid:impl-trait-does-not-live-long-enough, r=estebank
Yuki Okushi [Fri, 3 Jan 2020 08:56:21 +0000 (17:56 +0900)]
Rollup merge of #67595 - ohadravid:impl-trait-does-not-live-long-enough, r=estebank

Suggest adding a lifetime constraint for opaque type

Fixes #67577, where code like this:

```
struct List {
  data: Vec<String>,
}
impl List {
  fn started_with<'a>(&'a self, prefix: &'a str) -> impl Iterator<Item=&'a str> {
    self.data.iter().filter(|s| s.starts_with(prefix)).map(|s| s.as_ref())
  }
}
```

will show this error:
```
   Compiling playground v0.0.1 (/playground)
error[E0597]: `prefix` does not live long enough
 --> src/lib.rs:6:47
  |
5 |   fn started_with<'a>(&'a self, prefix: &'a str) -> impl Iterator<Item=&'a str> {
  |                   -- lifetime `'a` defined here     --------------------------- opaque type requires that `prefix` is borrowed for `'a`
...
```

but without suggesting the lovely `help: you can add a constraint..`.

r? @estebank

4 years agoRollup merge of #67450 - michaelwoerister:bootstrap-import-limit, r=Mark-Simulacrum
Yuki Okushi [Fri, 3 Jan 2020 08:56:20 +0000 (17:56 +0900)]
Rollup merge of #67450 - michaelwoerister:bootstrap-import-limit, r=Mark-Simulacrum

Allow for setting a ThinLTO import limit during bootstrap

The benchmarks in https://github.com/rust-lang/rust/pull/66625 have shown that a lower ThinLTO import limit can be a net win for bootstrap times. This PR:
- exposes the setting to `config.toml`,
- defaults to a lower limit if `incremental = true` in `config.toml`, and
- sets a lower limit for `x86_64-gnu-llvm-7` CI image in order to make the jobs complete more quickly (which remains to be tested).

This setting will affect how the compiler and it's tools are compiled. It will not affect the settings the compiler uses when compiling user code.

r? @pietroalbini
cc @rust-lang/infra

4 years agoAuto merge of #67768 - wesleywiser:dnm_test_perf_65244, r=Mark-Simulacrum
bors [Fri, 3 Jan 2020 05:51:04 +0000 (05:51 +0000)]
Auto merge of #67768 - wesleywiser:dnm_test_perf_65244, r=Mark-Simulacrum

Revert #65244 for performance reasons

This reverts commit f35517ee861dc012ccc26083dd4520045e2c4f6f.

Revert #65244 so we can see if it is the cause of the performance issue in #67706

cc https://github.com/rust-lang/rust/issues/67644

4 years agoMinor: change take() docs grammar to match other docs
Peter Todd [Fri, 3 Jan 2020 05:40:04 +0000 (00:40 -0500)]
Minor: change take() docs grammar to match other docs

Eg. mem::replace()

4 years agoRevert `const_err` lint checking of casts
Wesley Wiser [Fri, 3 Jan 2020 01:28:21 +0000 (20:28 -0500)]
Revert `const_err` lint checking of casts

Reverts part of #67676

4 years agoImplement uncommon_codepoints lint.
Charles Lew [Thu, 2 Jan 2020 12:02:22 +0000 (20:02 +0800)]
Implement uncommon_codepoints lint.

4 years agoClean up E0131 error explanation
Guillaume Gomez [Thu, 2 Jan 2020 18:57:25 +0000 (19:57 +0100)]
Clean up E0131 error explanation

4 years agofix src/test fallout
Mazdak Farrokhzad [Wed, 1 Jan 2020 23:01:07 +0000 (00:01 +0100)]
fix src/test fallout

4 years agoReformulate test description
LeSeulArtichaut [Thu, 2 Jan 2020 20:11:43 +0000 (21:11 +0100)]
Reformulate test description

Co-authored-by: Centril <twingoow@gmail.com>
4 years agoEnhance test
LeSeulArtichaut [Thu, 2 Jan 2020 20:08:25 +0000 (21:08 +0100)]
Enhance test

Co-authored-by: Centril <twingoow@gmail.com>
4 years agoMove test
LeSeulArtichaut [Thu, 2 Jan 2020 19:13:40 +0000 (20:13 +0100)]
Move test

Co-authored-by: Centril <twingoow@gmail.com>
4 years agoClean up E0130 error explanation
Guillaume Gomez [Thu, 2 Jan 2020 18:57:19 +0000 (19:57 +0100)]
Clean up E0130 error explanation

4 years agosyntax::map_in_place: leave fixme
Mazdak Farrokhzad [Wed, 1 Jan 2020 20:11:02 +0000 (21:11 +0100)]
syntax::map_in_place: leave fixme

4 years agoNormalize `syntax::edition` imports.
Mazdak Farrokhzad [Wed, 1 Jan 2020 18:40:49 +0000 (19:40 +0100)]
Normalize `syntax::edition` imports.

4 years agoupdate miri
Ralf Jung [Thu, 2 Jan 2020 15:08:43 +0000 (16:08 +0100)]
update miri

4 years agoSet a lower ThinLTO import limit for PR CI image.
Michael Woerister [Fri, 20 Dec 2019 13:43:28 +0000 (14:43 +0100)]
Set a lower ThinLTO import limit for PR CI image.

4 years agobootstrap: Allow for setting the ThinLTO import limit used for compiler the compiler.
Michael Woerister [Fri, 20 Dec 2019 13:38:28 +0000 (14:38 +0100)]
bootstrap: Allow for setting the ThinLTO import limit used for compiler the compiler.

4 years agoNormalize `syntax::symbol` imports.
Mazdak Farrokhzad [Wed, 1 Jan 2020 18:30:57 +0000 (19:30 +0100)]
Normalize `syntax::symbol` imports.

4 years agoNormalize `syntax::source_map` imports.
Mazdak Farrokhzad [Wed, 1 Jan 2020 18:25:28 +0000 (19:25 +0100)]
Normalize `syntax::source_map` imports.

4 years agoperf: Don't recurse into types that do not need normalizing
Markus Westerlind [Thu, 2 Jan 2020 11:14:23 +0000 (12:14 +0100)]
perf: Don't recurse into types that do not need normalizing

A bit speculative at this stage but profiling shows that type folding
takes up a substantial amount of time during normalization which may
indicate that many types may be folded despite there being nothing to
normalize

4 years agoAuto merge of #63177 - MOZGIII:find-result, r=Amanieu
bors [Thu, 2 Jan 2020 10:20:09 +0000 (10:20 +0000)]
Auto merge of #63177 - MOZGIII:find-result, r=Amanieu

Add Iterator::try_find

I found a need for this fn, and created this PR.

Tracking issue: #63178

I did a fair amount of thinking about the function name, and settled on the current one.
I don't see other anything else that's non-trivial here, but I'm open for debate. I just want this functionality to be there.
It couples with the `collect` trick for collecting `Result<Vec<T>, E>` from `Iterator<Item = Result<T, E>>`.

UPD:

I've already looked at `fallible_iterator` crate, but I don't think it supports my use case.
The main problem is that I can't construct a failable iterator. I have a regular iterator, and I just need to apply a predicate that can fail via `find` method.

UPD: `fallible_iterator` would work, but it's not elegant cause I'd have to make a failable iterator by mapping iterator with `Result::Ok` first.

4 years agoLets see if I can get these ui tests to run.
mental [Thu, 2 Jan 2020 10:03:04 +0000 (12:03 +0200)]
Lets see if I can get these ui tests to run.

4 years agoRemove // check-pass for ui/import/import-crate-var.rs
mental [Thu, 2 Jan 2020 09:59:32 +0000 (11:59 +0200)]
Remove // check-pass for ui/import/import-crate-var.rs

4 years agoUse drop instead of the toilet closure `|_| ()`
Lzu Tao [Thu, 2 Jan 2020 08:56:12 +0000 (08:56 +0000)]
Use drop instead of the toilet closure `|_| ()`

4 years agoUpdate src/test/ui
mental [Thu, 2 Jan 2020 06:38:59 +0000 (08:38 +0200)]
Update src/test/ui