]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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 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 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 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 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 agoAuto merge of #67779 - Amanieu:ehabi_fix, r=Mark-Simulacrum
bors [Thu, 2 Jan 2020 07:04:20 +0000 (07:04 +0000)]
Auto merge of #67779 - Amanieu:ehabi_fix, r=Mark-Simulacrum

Update the barrier cache during ARM EHABI unwinding

Fixes #67242

r? @alexcrichton

4 years agoAuto merge of #67700 - cjgillot:passes-stability, r=Zoxc
bors [Thu, 2 Jan 2020 03:52:42 +0000 (03:52 +0000)]
Auto merge of #67700 - cjgillot:passes-stability, r=Zoxc

Move stability queries to librustc_passes.

Contains:
- check_mod_unstable_api_usage query;
- stability_index query;
- check_unused_or_stable features pass.

Split out of #67688

r? @Zoxc

4 years agoEnsure that we process projections during MIR inlining
Aaron Hill [Thu, 2 Jan 2020 01:10:55 +0000 (20:10 -0500)]
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 agoAuto merge of #67689 - mark-i-m:update-guide, r=JohnTitor
bors [Thu, 2 Jan 2020 00:37:03 +0000 (00:37 +0000)]
Auto merge of #67689 - mark-i-m:update-guide, r=JohnTitor

Update rustc-guide

r? @ehuss

cc @rust-lang/wg-learning

4 years agoAdded test
LeSeulArtichaut [Wed, 1 Jan 2020 23:48:58 +0000 (00:48 +0100)]
Added test

4 years agoWarn for bindings named same as variants when matching against a borrow
LeSeulArtichaut [Wed, 1 Jan 2020 17:40:13 +0000 (18:40 +0100)]
Warn for bindings named same as variants when matching against a borrow

4 years agoAdd Iterator::try_find
MOZGIII [Tue, 6 Aug 2019 11:13:13 +0000 (14:13 +0300)]
Add Iterator::try_find

4 years agoAuto merge of #67676 - wesleywiser:lint_overflowing_int_casts, r=oli-obk
bors [Wed, 1 Jan 2020 21:27:11 +0000 (21:27 +0000)]
Auto merge of #67676 - wesleywiser:lint_overflowing_int_casts, r=oli-obk

Lint overflowing integer casts in const prop

This extends the invalid cases we catch in const prop to include
overflowing integer casts using the same machinery as the overflowing
binary and unary operation logic.

r? @oli-obk

4 years agoIgnore overflow lint on 32-bit platform
Wesley Wiser [Wed, 1 Jan 2020 17:30:17 +0000 (12:30 -0500)]
Ignore overflow lint on 32-bit platform

4 years agoupdate rustc-guide
Mark Mansi [Sat, 28 Dec 2019 23:05:55 +0000 (17:05 -0600)]
update rustc-guide

4 years agoUpdate the barrier cache during ARM EHABI unwinding
Amanieu d'Antras [Wed, 1 Jan 2020 16:11:45 +0000 (17:11 +0100)]
Update the barrier cache during ARM EHABI unwinding

4 years agoAuto merge of #67729 - mati865:deps, r=nikomatsakis
bors [Wed, 1 Jan 2020 15:10:48 +0000 (15:10 +0000)]
Auto merge of #67729 - mati865:deps, r=nikomatsakis

Bump smallvec

4 years agoMove stability queries to librustc_passes.
Camille GILLOT [Sun, 29 Dec 2019 10:20:20 +0000 (11:20 +0100)]
Move stability queries to librustc_passes.

Contains:
- check_mod_unstable_api_usage query;
- stability_index query;
- check_unused_or_stable features pass.

4 years agoMove stability.rs to librustc_passes.
Camille GILLOT [Sun, 29 Dec 2019 10:20:15 +0000 (11:20 +0100)]
Move stability.rs to librustc_passes.

4 years agoAuto merge of #67471 - nnethercote:revert-66405, r=nikomatsakis
bors [Wed, 1 Jan 2020 11:54:21 +0000 (11:54 +0000)]
Auto merge of #67471 - nnethercote:revert-66405, r=nikomatsakis

Revert parts of #66405.

Because PR #66405 caused major performance regressions in some cases.

That PR had five commits, two of which affected performance, and three
of which were refactorings. This change undoes the performance-affecting
changes, while keeping the refactorings in place.

Fixes #67454.

r? @nikomatsakis

4 years agoAuto merge of #67763 - petrochenkov:crateren2, r=Centril
bors [Wed, 1 Jan 2020 08:39:44 +0000 (08:39 +0000)]
Auto merge of #67763 - petrochenkov:crateren2, r=Centril

Rename `syntax_pos` to `rustc_span` in source code

Follow-up to https://github.com/rust-lang/rust/pull/67707.

r? @Centril

4 years agoRename `syntax_pos` to `rustc_span` in source code
Vadim Petrochenkov [Tue, 31 Dec 2019 17:15:40 +0000 (20:15 +0300)]
Rename `syntax_pos` to `rustc_span` in source code

4 years agoRevert "core: add IntoFuture trait and support for await"
Wesley Wiser [Wed, 1 Jan 2020 00:18:08 +0000 (19:18 -0500)]
Revert "core: add IntoFuture trait and support for await"

This reverts commit f35517ee861dc012ccc26083dd4520045e2c4f6f.

4 years agoRevert parts of #66405.
Nicholas Nethercote [Fri, 20 Dec 2019 23:53:41 +0000 (10:53 +1100)]
Revert parts of #66405.

Because it caused major performance regressions in some cases.

That PR had five commits, two of which affected performance, and three
of which were refactorings. This change undoes the performance-affecting
changes, while keeping the refactorings in place.

Fixes #67454.

4 years agoAuto merge of #67726 - JohnTitor:clippy-up, r=oli-obk
bors [Tue, 31 Dec 2019 22:51:24 +0000 (22:51 +0000)]
Auto merge of #67726 - JohnTitor:clippy-up, r=oli-obk

Update Clippy

Fixes #67716
r? @oli-obk

4 years agoAuto merge of #67764 - Centril:rollup-ycbq3os, r=Centril
bors [Tue, 31 Dec 2019 19:41:36 +0000 (19:41 +0000)]
Auto merge of #67764 - Centril:rollup-ycbq3os, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #67574 (Extract `rustc_ast_lowering` crate from `rustc`)
 - #67685 (Constify Result)
 - #67702 (Add symbol normalization for proc_macro_server.)
 - #67730 (Cleanup pattern type checking, fix diagnostics bugs (+ improvements))
 - #67744 (parser: reduce diversity in error handling mechanisms)
 - #67748 (Use function attribute "frame-pointer" instead of "no-frame-pointer-elim")

Failed merges:

r? @ghost

4 years agoRollup merge of #67748 - MaskRay:frame-pointer, r=rkruppe
Mazdak Farrokhzad [Tue, 31 Dec 2019 18:19:39 +0000 (19:19 +0100)]
Rollup merge of #67748 - MaskRay:frame-pointer, r=rkruppe

Use function attribute "frame-pointer" instead of "no-frame-pointer-elim"

LLVM 8 ([D56351](http://reviews.llvm.org/D56351)) introduced "frame-pointer". In LLVM 10 (D71863),
"no-frame-pointer-elim"/"no-frame-pointer-elim-non-leaf" will be
ignored.

-----

In the LLVM monorepo, run `git show origin/release/8.x:llvm/lib/CodeGen/TargetOptionsImpl.cpp` to see that `"frame-pointer"` is available since LLVM 8.

4 years agoRollup merge of #67744 - Centril:reduce-diversity, r=petrochenkov
Mazdak Farrokhzad [Tue, 31 Dec 2019 18:19:38 +0000 (19:19 +0100)]
Rollup merge of #67744 - Centril:reduce-diversity, r=petrochenkov

parser: reduce diversity in error handling mechanisms

Instead of having e.g. `span_err`, `fatal`, etc., we prefer to move towards uniformly using `struct_span_err` thus making it harder to emit fatal and/or unstructured diagnostics.

This PR also de-fatalizes some diagnostics.

r? @estebank

4 years agoRollup merge of #67730 - Centril:typeck-pat-cleanup, r=estebank
Mazdak Farrokhzad [Tue, 31 Dec 2019 18:19:36 +0000 (19:19 +0100)]
Rollup merge of #67730 - Centril:typeck-pat-cleanup, r=estebank

Cleanup pattern type checking, fix diagnostics bugs (+ improvements)

r? @estebank

4 years agoRollup merge of #67702 - crlf0710:normalize_ident2, r=petrochenkov
Mazdak Farrokhzad [Tue, 31 Dec 2019 18:19:34 +0000 (19:19 +0100)]
Rollup merge of #67702 - crlf0710:normalize_ident2, r=petrochenkov

Add symbol normalization for proc_macro_server.

Follow up for #66670, finishing the first bullet point in #55467.

r? @petrochenkov

4 years agoRollup merge of #67685 - lukaslueg:const_result, r=oli-obk
Mazdak Farrokhzad [Tue, 31 Dec 2019 18:19:33 +0000 (19:19 +0100)]
Rollup merge of #67685 - lukaslueg:const_result, r=oli-obk

Constify Result

r? @oli-obk

This is just the `Result`-part of #67494 which I'll resubmit once #66254 has landed.

4 years agoRollup merge of #67574 - Centril:librustc_lowering, r=Mark-Simulacrum
Mazdak Farrokhzad [Tue, 31 Dec 2019 18:19:31 +0000 (19:19 +0100)]
Rollup merge of #67574 - Centril:librustc_lowering, r=Mark-Simulacrum

Extract `rustc_ast_lowering` crate from `rustc`

Working towards https://github.com/rust-lang/rust/issues/65031.

This PR moves `src/librustc/hir/lowering{/, .rs}` to its own crate (`librustc_ast_lowering`) which is very self-contained (only `fn lower_crate` and `trait Resolver` are exposed).

r? @Mark-Simulacrum

4 years agoAdd missing links for insecure_time
Lzu Tao [Tue, 31 Dec 2019 17:14:49 +0000 (17:14 +0000)]
Add missing links for insecure_time

4 years agonix `lower_label` identity function.
Mazdak Farrokhzad [Tue, 24 Dec 2019 02:52:56 +0000 (03:52 +0100)]
nix `lower_label` identity function.

4 years agolibrustc_ast_lowering: fix misc fallout.
Mazdak Farrokhzad [Sun, 22 Dec 2019 17:15:02 +0000 (18:15 +0100)]
librustc_ast_lowering: fix misc fallout.

4 years agolibrustc_ast_lowering: cargo changes.
Mazdak Farrokhzad [Sun, 22 Dec 2019 17:12:56 +0000 (18:12 +0100)]
librustc_ast_lowering: cargo changes.

4 years agolibrustc_ast_lowering: move the files.
Mazdak Farrokhzad [Sun, 22 Dec 2019 17:08:34 +0000 (18:08 +0100)]
librustc_ast_lowering: move the files.

4 years agoAuto merge of #67699 - cjgillot:passes-resolve, r=Zoxc
bors [Tue, 31 Dec 2019 16:21:10 +0000 (16:21 +0000)]
Auto merge of #67699 - cjgillot:passes-resolve, r=Zoxc

Move resolve_lifetimes query in librustc_resolve.

Split out of #67688

r? @Zoxc

4 years agoConstify Result
Lukas Lueg [Sat, 28 Dec 2019 20:33:36 +0000 (21:33 +0100)]
Constify Result

4 years agoAuto merge of #67752 - Dylan-DPC:rollup-7f9v4nx, r=Dylan-DPC
bors [Tue, 31 Dec 2019 12:58:10 +0000 (12:58 +0000)]
Auto merge of #67752 - Dylan-DPC:rollup-7f9v4nx, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #67430 (doc: minus (U+2212) instead of dash (U+002D) for negative infinity)
 - #67697 (Move the region_scope_tree query to librustc_passes.)
 - #67719 (Add self to .mailmap)
 - #67723 (Add error code explanation for E0477)
 - #67735 (Support `-Z ui-testing=yes/no`)

Failed merges:

r? @ghost

4 years agoRollup merge of #67735 - petrochenkov:uibool, r=Mark-Simulacrum
Dylan DPC [Tue, 31 Dec 2019 12:44:07 +0000 (18:14 +0530)]
Rollup merge of #67735 - petrochenkov:uibool, r=Mark-Simulacrum

Support `-Z ui-testing=yes/no`

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

This way we can remove the special opt-out support from `compiletest`.

Inspired by https://github.com/rust-lang/rust/pull/67709.

4 years agoRollup merge of #67723 - ldm0:E0477, r=Dylan-DPC
Dylan DPC [Tue, 31 Dec 2019 12:44:06 +0000 (18:14 +0530)]
Rollup merge of #67723 - ldm0:E0477, r=Dylan-DPC

Add error code explanation for E0477

Part of #61137

4 years agoRollup merge of #67719 - jumbatm:add-self-to-mailmap, r=Mark-Simulacrum
Dylan DPC [Tue, 31 Dec 2019 12:44:04 +0000 (18:14 +0530)]
Rollup merge of #67719 - jumbatm:add-self-to-mailmap, r=Mark-Simulacrum

Add self to .mailmap

r? @Mark-Simulacrum

Cheers.

4 years agoRollup merge of #67697 - cjgillot:passes-scope-tree, r=Zoxc
Dylan DPC [Tue, 31 Dec 2019 12:44:03 +0000 (18:14 +0530)]
Rollup merge of #67697 - cjgillot:passes-scope-tree, r=Zoxc

Move the region_scope_tree query to librustc_passes.

Split out of #67688.

r? @Zoxc

4 years agoRollup merge of #67430 - tspiteri:minus-inf, r=Dylan-DPC
Dylan DPC [Tue, 31 Dec 2019 12:44:01 +0000 (18:14 +0530)]
Rollup merge of #67430 - tspiteri:minus-inf, r=Dylan-DPC

doc: minus (U+2212) instead of dash (U+002D) for negative infinity

The documentation for [`f32::NEG_INFINITY`](https://doc.rust-lang.org/std/f32/constant.NEG_INFINITY.html) contains “-∞” with a dash instead of a minus sign, “−∞” with a proper minus sign looks better with the used Source Serif Pro font. Similarly for [`f64::NEG_INFINITY`](https://doc.rust-lang.org/std/f64/constant.NEG_INFINITY.html).

4 years agoUpdate Clippy
Yuki Okushi [Mon, 30 Dec 2019 11:27:26 +0000 (20:27 +0900)]
Update Clippy

4 years agoChange wording for lifetime suggestion for opaque types from `constraint` to `bound`
Ohad Ravid [Wed, 25 Dec 2019 08:26:25 +0000 (09:26 +0100)]
Change wording for lifetime suggestion for opaque types from `constraint` to `bound`

4 years agoAuto merge of #67597 - estebank:placeholder-type, r=oli-obk
bors [Tue, 31 Dec 2019 09:50:49 +0000 (09:50 +0000)]
Auto merge of #67597 - estebank:placeholder-type, r=oli-obk

Suggest type param when encountering `_` in item signatures

Fix #27435.

4 years agoSimplify ResolveLiftimes creation.
Camille GILLOT [Mon, 30 Dec 2019 11:48:32 +0000 (12:48 +0100)]
Simplify ResolveLiftimes creation.

4 years agoReview comments.
Camille GILLOT [Sun, 29 Dec 2019 19:45:48 +0000 (20:45 +0100)]
Review comments.

4 years agoInert doc comments.
Camille GILLOT [Sun, 29 Dec 2019 10:17:20 +0000 (11:17 +0100)]
Inert doc comments.

4 years agoMove resolve_lifetimes query in librustc_resolve.
Camille GILLOT [Sun, 29 Dec 2019 09:48:52 +0000 (10:48 +0100)]
Move resolve_lifetimes query in librustc_resolve.

4 years agoMove resolve_lifetime.rs to librustc_resolve.
Camille GILLOT [Sun, 29 Dec 2019 09:47:49 +0000 (10:47 +0100)]
Move resolve_lifetime.rs to librustc_resolve.

4 years agoUse function attribute "frame-pointer" instead of "no-frame-pointer-elim"
Fangrui Song [Tue, 31 Dec 2019 05:35:13 +0000 (21:35 -0800)]
Use function attribute "frame-pointer" instead of "no-frame-pointer-elim"

LLVM 8 (D56351) introduced "frame-pointer". In LLVM 10 (D71863),
"no-frame-pointer-elim"/"no-frame-pointer-elim-non-leaf" will be
ignored.

4 years agoparser: bug -> span_bug
Mazdak Farrokhzad [Tue, 31 Dec 2019 03:30:55 +0000 (04:30 +0100)]
parser: bug -> span_bug

4 years agoparser::diagnostics: remove fn fatal
Mazdak Farrokhzad [Tue, 31 Dec 2019 03:21:58 +0000 (04:21 +0100)]
parser::diagnostics: remove fn fatal

4 years agoparser::pat: remove .fatal calls
Mazdak Farrokhzad [Tue, 31 Dec 2019 02:36:45 +0000 (03:36 +0100)]
parser::pat: remove .fatal calls

4 years agoparser::path: remove .fatal calls
Mazdak Farrokhzad [Tue, 31 Dec 2019 00:57:42 +0000 (01:57 +0100)]
parser::path: remove .fatal calls

4 years agoparser::module: remove .fatal calls
Mazdak Farrokhzad [Tue, 31 Dec 2019 00:28:10 +0000 (01:28 +0100)]
parser::module: remove .fatal calls

4 years agoparser::item: remove .fatal calls
Mazdak Farrokhzad [Tue, 31 Dec 2019 00:19:53 +0000 (01:19 +0100)]
parser::item: remove .fatal calls

4 years agoparser::attr: remove .fatal calls
Mazdak Farrokhzad [Tue, 31 Dec 2019 00:13:00 +0000 (01:13 +0100)]
parser::attr: remove .fatal calls

4 years agoprocess_potential_macro_variable: de-fatalize an error
Mazdak Farrokhzad [Mon, 30 Dec 2019 23:25:30 +0000 (00:25 +0100)]
process_potential_macro_variable: de-fatalize an error

4 years agoparser: span_fatal -> struct_span_err
Mazdak Farrokhzad [Mon, 30 Dec 2019 23:20:41 +0000 (00:20 +0100)]
parser: span_fatal -> struct_span_err

4 years agode-fatalize some errors
Mazdak Farrokhzad [Mon, 30 Dec 2019 14:09:42 +0000 (15:09 +0100)]
de-fatalize some errors

4 years agoparser: call .struct_span_err directly
Mazdak Farrokhzad [Mon, 30 Dec 2019 13:56:57 +0000 (14:56 +0100)]
parser: call .struct_span_err directly

4 years agoAuto merge of #67032 - cjgillot:hirene, r=Zoxc
bors [Tue, 31 Dec 2019 03:27:36 +0000 (03:27 +0000)]
Auto merge of #67032 - cjgillot:hirene, r=Zoxc

Allocate HIR on an arena 4/4

This is the fourth and last PR in the series started by #66931, #66936 and #66942.

The last commits should compile on their own.
The difference with the previous PR is given by https://github.com/cjgillot/rust/compare/hirene-ty...hirene

A few more cleanups may be necessary, please tell me.

r? @eddyb like the other
cc @Zoxc

4 years agoInline and remove `nfc_symbol_from` method.
Charles Lew [Mon, 30 Dec 2019 12:00:05 +0000 (20:00 +0800)]
Inline and remove `nfc_symbol_from` method.

4 years agoAdd symbol normalization for proc_macro_server.
Charles Lew [Sun, 29 Dec 2019 11:50:43 +0000 (19:50 +0800)]
Add symbol normalization for proc_macro_server.

4 years ago[const-prop] Expand comment about casting ZST enums
Wesley Wiser [Sun, 29 Dec 2019 15:34:09 +0000 (10:34 -0500)]
[const-prop] Expand comment about casting ZST enums

4 years ago[const-prop] Clean up `check_cast()` a bit
Wesley Wiser [Sat, 28 Dec 2019 21:51:13 +0000 (16:51 -0500)]
[const-prop] Clean up `check_cast()` a bit

4 years ago[const-prop] Extract some functions out of `_const_prop`
Wesley Wiser [Sat, 28 Dec 2019 21:43:39 +0000 (16:43 -0500)]
[const-prop] Extract some functions out of `_const_prop`

4 years agoLint overflowing integer casts in const prop
Wesley Wiser [Fri, 13 Dec 2019 03:03:32 +0000 (22:03 -0500)]
Lint overflowing integer casts in const prop

This extends the invalid cases we catch in const prop to include
overflowing integer casts using the same machinery as the overflowing
binary and unary operation logic.

4 years agoEnlarge smallvec.
Camille GILLOT [Mon, 30 Dec 2019 22:25:47 +0000 (23:25 +0100)]
Enlarge smallvec.

4 years agoReduce allocations.
Camille GILLOT [Mon, 30 Dec 2019 22:09:35 +0000 (23:09 +0100)]
Reduce allocations.

4 years agoLess-than is asymmetric, not antisymmetric
JP Sugarbroad [Mon, 30 Dec 2019 20:17:23 +0000 (12:17 -0800)]
Less-than is asymmetric, not antisymmetric

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

4 years agoreview comments and fix rebase
Esteban Küber [Mon, 30 Dec 2019 19:45:48 +0000 (11:45 -0800)]
review comments and fix rebase

4 years agoAuto merge of #67707 - petrochenkov:crateren, r=Centril
bors [Mon, 30 Dec 2019 18:06:54 +0000 (18:06 +0000)]
Auto merge of #67707 - petrochenkov:crateren, r=Centril

Rename some crates and modules in the frontend

Migrate from `syntax_*` naming scheme to `rustc_*`.
See https://github.com/rust-lang/rust/pull/65324#issuecomment-551103396 and several comments below.

Renamed crates:
`syntax_expand` -> `rustc_expand`
`syntax_pos` -> `rustc_span` ([motivation](https://github.com/rust-lang/rust/pull/65324#issuecomment-552173320))
`syntax_ext` -> `rustc_builtin_macros`

Also one module in resolve is renamed for consistency and to avoid tautology.

r? @Centril

4 years agoSuggest adding a lifetime constraint when opaque type is responsible for "does not...
Ohad Ravid [Tue, 24 Dec 2019 18:14:20 +0000 (19:14 +0100)]
Suggest adding a lifetime constraint when opaque type is responsible for "does not live long enough" error