]> git.lizzy.rs Git - rust.git/log
rust.git
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 #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 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 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 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 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 agoCleanup linkchecker whitelist
Oliver Middleton [Wed, 1 Jan 2020 23:46:25 +0000 (23:46 +0000)]
Cleanup linkchecker whitelist

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

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 agoAdd a test for #37333
Michal Terepeta [Wed, 1 Jan 2020 11:39:13 +0000 (12:39 +0100)]
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 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.