]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoAuto merge of #70655 - oli-obk:subrepo_funness, r=Mark-Simulacrum
bors [Sat, 2 May 2020 13:19:30 +0000 (13:19 +0000)]
Auto merge of #70655 - oli-obk:subrepo_funness, r=Mark-Simulacrum

Make clippy a git subtree instead of a git submodule

r? @eddyb

cc #70651

documentation at https://github.com/rust-lang/rust/pull/70654

4 years agoAuto merge of #71795 - RalfJung:rollup-yqxfi5a, r=RalfJung
bors [Sat, 2 May 2020 10:13:57 +0000 (10:13 +0000)]
Auto merge of #71795 - RalfJung:rollup-yqxfi5a, r=RalfJung

Rollup of 6 pull requests

Successful merges:

 - #71712 (Miri: port error backtraces to std::backtrace)
 - #71736 (bootstrap: also apply unused-attributes hack without deny_warnings)
 - #71738 (remove AllocId generalization of Pointer)
 - #71739 (remove obsolete comment)
 - #71781 (Uncomment test code for failure to use `Box::pin`)
 - #71782 (Use a non-existent test path instead of clobbering /dev/null)

Failed merges:

r? @ghost

4 years agoRollup merge of #71782 - cuviper:leave-dev-null-alone, r=Mark-Simulacrum
Ralf Jung [Sat, 2 May 2020 10:08:15 +0000 (12:08 +0200)]
Rollup merge of #71782 - cuviper:leave-dev-null-alone, r=Mark-Simulacrum

Use a non-existent test path instead of clobbering /dev/null

Fixes #71502.
r? @Mark-Simulacrum

4 years agoRollup merge of #71781 - estebank:box-pin-test, r=tmandry
Ralf Jung [Sat, 2 May 2020 10:08:13 +0000 (12:08 +0200)]
Rollup merge of #71781 - estebank:box-pin-test, r=tmandry

Uncomment test code for failure to use `Box::pin`

Close #69083.

4 years agoRollup merge of #71739 - tshepang:master, r=Dylan-DPC
Ralf Jung [Sat, 2 May 2020 10:08:12 +0000 (12:08 +0200)]
Rollup merge of #71739 - tshepang:master, r=Dylan-DPC

remove obsolete comment

Referenced was removed in 9f492fefef8d9a75f6dc27c834561fe977ca70c5

4 years agoRollup merge of #71738 - RalfJung:pointer-no-alloc-id, r=oli-obk
Ralf Jung [Sat, 2 May 2020 10:08:10 +0000 (12:08 +0200)]
Rollup merge of #71738 - RalfJung:pointer-no-alloc-id, r=oli-obk

remove AllocId generalization of Pointer

This was only needed for the "snapshot" machinery, which is gone.

r? @oli-obk

4 years agoRollup merge of #71736 - RalfJung:silence-spurious-unused, r=Mark-Simulacrum
Ralf Jung [Sat, 2 May 2020 10:08:09 +0000 (12:08 +0200)]
Rollup merge of #71736 - RalfJung:silence-spurious-unused, r=Mark-Simulacrum

bootstrap: also apply unused-attributes hack without deny_warnings

This is a follow-up to https://github.com/rust-lang/rust/pull/70881 that also silences these warnings when deny_warnings is off. They otherwise spam my screen during development and make it hard to see actual warnings.

Cc  @eddyb r? @Mark-Simulacrum

4 years agoRollup merge of #71712 - RalfJung:error-backtrace, r=oli-obk
Ralf Jung [Sat, 2 May 2020 10:08:03 +0000 (12:08 +0200)]
Rollup merge of #71712 - RalfJung:error-backtrace, r=oli-obk

Miri: port error backtraces to std::backtrace

No need to pull in an external dependency if libstd already includes this feature (using the same dependency internally, but... still).

r? @oli-obk

4 years agoAdd 'src/tools/clippy/' from commit 'd2708873ef711ec8ab45df1e984ecf24a96cd369'
Oliver Scherer [Sat, 2 May 2020 07:49:00 +0000 (09:49 +0200)]
Add 'src/tools/clippy/' from commit 'd2708873ef711ec8ab45df1e984ecf24a96cd369'

git-subtree-dir: src/tools/clippy
git-subtree-mainline: 06c44816c1532e5ff08ad072f581fc068eb60e2e
git-subtree-split: d2708873ef711ec8ab45df1e984ecf24a96cd369

4 years agoDelete the clippy submodule
Oliver Scherer [Wed, 1 Apr 2020 10:27:30 +0000 (12:27 +0200)]
Delete the clippy submodule

4 years agoAlso build clippy with `./x.py check`
Oliver Scherer [Wed, 1 Apr 2020 13:57:48 +0000 (15:57 +0200)]
Also build clippy with `./x.py check`

4 years agoGate on clippy on CI
Oliver Scherer [Wed, 1 Apr 2020 11:18:06 +0000 (13:18 +0200)]
Gate on clippy on CI

4 years agoAuto merge of #70170 - eddyb:wf-early-exit, r=nikomatsakis
bors [Sat, 2 May 2020 06:51:08 +0000 (06:51 +0000)]
Auto merge of #70170 - eddyb:wf-early-exit, r=nikomatsakis

wf: handle "livelock" checking before reaching `WfPredicates::compute`.

For `wf::obligations`'s "livelock" handling, this PR shouldn't cause any behavioral changes, as the check moved to it should be equivalent to the old one in `WfPredicates::compute`.

However, it fixes #70168 by making *other* users of `WfPredicates::compute` (that is, `wf::predicate_obligations` and `compute`'s own upvar handling) correct for `ty::Infer`, in that they now get a `WellFormed(ty::Infer(_))` obligation instead of silently ignoring the type.

r? @nikomatsakis

4 years agoAuto merge of #71716 - alexcrichton:bitcode-follow-up, r=nnethercote
bors [Sat, 2 May 2020 03:39:04 +0000 (03:39 +0000)]
Auto merge of #71716 - alexcrichton:bitcode-follow-up, r=nnethercote

Rename `bitcode-in-rlib` option to `embed-bitcode`

This commit finishes work first pioneered in #70458 and started in #71528.
The `-C bitcode-in-rlib` option, which has not yet reached stable, is
renamed to `-C embed-bitcode` since that more accurately reflects what
it does now anyway. Various tests and such are updated along the way as
well.

This'll also need to be backported to the beta channel to ensure we
don't accidentally stabilize `-Cbitcode-in-rlib` as well.

4 years agoAuto merge of #71776 - Dylan-DPC:rollup-k1iuuow, r=Dylan-DPC
bors [Sat, 2 May 2020 00:21:39 +0000 (00:21 +0000)]
Auto merge of #71776 - Dylan-DPC:rollup-k1iuuow, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #71018 (handle ConstValue::ByRef in relate)
 - #71758 (Remove leftover chalk types)
 - #71760 (Document unsafety for `*const T` and `*mut T`)
 - #71761 (doc: reference does not exist, probably a typo)
 - #71762 (doc: this resulted in a link pointing to a non-existent target)

Failed merges:

 - #71726 (Suggest deref when coercing `ty::Ref` to `ty::RawPtr` with arbitrary mutability)

r? @ghost

4 years agoUncomment test code for failure to use `Box::pin`
Esteban Küber [Fri, 1 May 2020 23:53:20 +0000 (16:53 -0700)]
Uncomment test code for failure to use `Box::pin`

Close #69083.

4 years agoUse a non-existent test path instead of clobbering /dev/null
Josh Stone [Fri, 1 May 2020 23:50:10 +0000 (16:50 -0700)]
Use a non-existent test path instead of clobbering /dev/null

4 years agoRollup merge of #71762 - tshepang:typo, r=jonas-schievink
Dylan DPC [Fri, 1 May 2020 21:16:40 +0000 (23:16 +0200)]
Rollup merge of #71762 - tshepang:typo, r=jonas-schievink

doc: this resulted in a link pointing to a non-existent target

4 years agoRollup merge of #71761 - tshepang:missing-target, r=jonas-schievink
Dylan DPC [Fri, 1 May 2020 21:16:38 +0000 (23:16 +0200)]
Rollup merge of #71761 - tshepang:missing-target, r=jonas-schievink

doc: reference does not exist, probably a typo

4 years agoRollup merge of #71760 - LeSeulArtichaut:document-unsafety, r=Mark-Simulacrum
Dylan DPC [Fri, 1 May 2020 21:16:36 +0000 (23:16 +0200)]
Rollup merge of #71760 - LeSeulArtichaut:document-unsafety, r=Mark-Simulacrum

Document unsafety for `*const T` and `*mut T`

Helps with #66219
r? @Mark-Simulacrum

4 years agoRollup merge of #71758 - jackh726:chalk-remove, r=jackh726
Dylan DPC [Fri, 1 May 2020 21:16:35 +0000 (23:16 +0200)]
Rollup merge of #71758 - jackh726:chalk-remove, r=jackh726

Remove leftover chalk types

Split out from #69406

Since the other PR is having memory problems with `parallel-compiler = true`, figured I should split this out. Surprisingly, this actually changes some errors, and I'm not quite sure why.

r? @nikomatsakis

4 years agoRollup merge of #71018 - lcnr:custom-const-param, r=eddyb
Dylan DPC [Fri, 1 May 2020 21:16:32 +0000 (23:16 +0200)]
Rollup merge of #71018 - lcnr:custom-const-param, r=eddyb

handle ConstValue::ByRef in relate

fixes #68615

r? @eddyb

4 years agoAuto merge of #69808 - cjgillot:vtbl, r=pnkfelix
bors [Fri, 1 May 2020 21:08:23 +0000 (21:08 +0000)]
Auto merge of #69808 - cjgillot:vtbl, r=pnkfelix

Avoid duplicating code for each query

There are at the moment roughly 170 queries in librustc.
The way `ty::query` is structured, a lot of code is duplicated for each query.
I suspect this to be responsible for a part of librustc'c compile time.

The first part of this PR reduces the amount of code generic on the query,
replacing it by code generic on the key-value types. I can split it out if needed.

In a second part, the non-inlined methods in the `QueryAccessors` and `QueryDescription` traits
are made into a virtual dispatch table. This allows to reduce even more the number of generated
functions.

This allows to save 1.5s on check build, and 10% on the size of the librustc.rlib.
(Attributed roughly half and half).
My computer is not good enough to measure properly compiling time.
I have no idea of the effect on performance. A perf run may be required.

cc #65031

4 years agoRemove leftover chalk types
Jack Huey [Fri, 1 May 2020 16:36:18 +0000 (12:36 -0400)]
Remove leftover chalk types

4 years agodoc: this resulted in a link pointing to a non-existent target
Tshepang Lekhonkhobe [Fri, 1 May 2020 18:37:34 +0000 (20:37 +0200)]
doc: this resulted in a link pointing to a non-existent target

4 years agodoc: reference does not exist, probably a typo
Tshepang Lekhonkhobe [Fri, 1 May 2020 18:25:50 +0000 (20:25 +0200)]
doc: reference does not exist, probably a typo

4 years agoAuto merge of #71759 - Dylan-DPC:rollup-5hncork, r=Dylan-DPC
bors [Fri, 1 May 2020 18:00:52 +0000 (18:00 +0000)]
Auto merge of #71759 - Dylan-DPC:rollup-5hncork, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #71744 (remove obsolete comment)
 - #71747 (Remove deadcode in eval_mir_constant_to_operand)
 - #71749 (fix Miri error message padding)
 - #71752 (make Stability doc a more readable (and fix rustdoc warning))
 - #71755 (fix doc reference)

Failed merges:

r? @ghost

4 years agoDocument unsafety for `*const T` and `*mut T`
LeSeulArtichaut [Fri, 1 May 2020 17:49:56 +0000 (19:49 +0200)]
Document unsafety for `*const T` and `*mut T`

4 years agoRollup merge of #71755 - tshepang:fix-comment, r=jonas-schievink
Dylan DPC [Fri, 1 May 2020 17:49:18 +0000 (19:49 +0200)]
Rollup merge of #71755 - tshepang:fix-comment, r=jonas-schievink

fix doc reference

Should of been in e0ce9f8c0a97e5949c9cadd220279d6969289daa,
but that had a typo.

4 years agoRollup merge of #71752 - tshepang:more-readable, r=jonas-schievink
Dylan DPC [Fri, 1 May 2020 17:49:16 +0000 (19:49 +0200)]
Rollup merge of #71752 - tshepang:more-readable, r=jonas-schievink

make Stability doc a more readable (and fix rustdoc warning)

4 years agoRollup merge of #71749 - RalfJung:miri-error-print, r=oli-obk
Dylan DPC [Fri, 1 May 2020 17:49:14 +0000 (19:49 +0200)]
Rollup merge of #71749 - RalfJung:miri-error-print, r=oli-obk

fix Miri error message padding

I screwed up in the previous PR, and accidentally padded with spaces instead of 0s...

r? @oli-obk

4 years agoRollup merge of #71747 - spastorino:safety-scheme-around-consts-cleanup, r=oli-obk
Dylan DPC [Fri, 1 May 2020 17:49:13 +0000 (19:49 +0200)]
Rollup merge of #71747 - spastorino:safety-scheme-around-consts-cleanup, r=oli-obk

Remove deadcode in eval_mir_constant_to_operand

r? @oli-obk @RalfJung

4 years agoRollup merge of #71744 - tshepang:obsolete-comment, r=Dylan-DPC
Dylan DPC [Fri, 1 May 2020 17:49:11 +0000 (19:49 +0200)]
Rollup merge of #71744 - tshepang:obsolete-comment, r=Dylan-DPC

remove obsolete comment

Referenced was removed in 8770d0f34a9bee2691517ab95803a277c453dfda

4 years agoAuto merge of #5548 - matthiaskrgr:traget_os, r=flip1995
bors [Fri, 1 May 2020 16:33:14 +0000 (16:33 +0000)]
Auto merge of #5548 - matthiaskrgr:traget_os, r=flip1995

mismatched_target_os: link to respective section in rust reference

changelog: none

4 years agoRename `bitcode-in-rlib` option to `embed-bitcode`
Alex Crichton [Thu, 30 Apr 2020 17:53:16 +0000 (10:53 -0700)]
Rename `bitcode-in-rlib` option to `embed-bitcode`

This commit finishes work first pioneered in #70458 and started in #71528.
The `-C bitcode-in-rlib` option, which has not yet reached stable, is
renamed to `-C embed-bitcode` since that more accurately reflects what
it does now anyway. Various tests and such are updated along the way as
well.

This'll also need to be backported to the beta channel to ensure we
don't accidentally stabilize `-Cbitcode-in-rlib` as well.

4 years agofix doc reference
Tshepang Lekhonkhobe [Fri, 1 May 2020 15:53:52 +0000 (17:53 +0200)]
fix doc reference

Should of been in e0ce9f8c0a97e5949c9cadd220279d6969289daa,
but that had a typo.

4 years agomake Stability docs a bit more readable, and fix some rustdoc warnings
Tshepang Lekhonkhobe [Fri, 1 May 2020 14:35:25 +0000 (16:35 +0200)]
make Stability docs a bit more readable, and fix some rustdoc warnings

4 years agoRestrict access.
Camille GILLOT [Mon, 30 Mar 2020 15:27:14 +0000 (17:27 +0200)]
Restrict access.

4 years agoInline a few things.
Camille GILLOT [Sun, 29 Mar 2020 09:44:40 +0000 (11:44 +0200)]
Inline a few things.

4 years agoMonomorphise the interface.
Camille GILLOT [Sat, 28 Mar 2020 13:09:53 +0000 (14:09 +0100)]
Monomorphise the interface.

4 years agoMove the DepNode construction to librustc_query_system.
Camille GILLOT [Sat, 28 Mar 2020 12:51:37 +0000 (13:51 +0100)]
Move the DepNode construction to librustc_query_system.

4 years agoMonomorphise try_execute_query.
Camille GILLOT [Sat, 28 Mar 2020 12:12:20 +0000 (13:12 +0100)]
Monomorphise try_execute_query.

4 years agofix Miri error message padding
Ralf Jung [Fri, 1 May 2020 12:39:41 +0000 (14:39 +0200)]
fix Miri error message padding

4 years agoMonomorphise try_start.
Camille GILLOT [Sat, 7 Mar 2020 16:32:07 +0000 (17:32 +0100)]
Monomorphise try_start.

4 years agoMonomorphise try_execute_anon_query.
Camille GILLOT [Fri, 6 Mar 2020 21:56:05 +0000 (22:56 +0100)]
Monomorphise try_execute_anon_query.

4 years agoRemove deadcode in eval_mir_constant_to_operand
Santiago Pastorino [Fri, 1 May 2020 12:30:46 +0000 (09:30 -0300)]
Remove deadcode in eval_mir_constant_to_operand

4 years agoMonomorphise load_from_disk_and_cache_in_memory.
Camille GILLOT [Fri, 6 Mar 2020 21:43:08 +0000 (22:43 +0100)]
Monomorphise load_from_disk_and_cache_in_memory.

4 years agoMonomorphise force_query_with_job.
Camille GILLOT [Fri, 6 Mar 2020 21:15:46 +0000 (22:15 +0100)]
Monomorphise force_query_with_job.

4 years agoAuto merge of #71742 - matthiaskrgr:submodule_upd, r=Dylan-DPC
bors [Fri, 1 May 2020 12:18:41 +0000 (12:18 +0000)]
Auto merge of #71742 - matthiaskrgr:submodule_upd, r=Dylan-DPC

submodules: update cargo from 90931d9b3 to 258c89644

Changes:
````
Remove unnecessary loop in `maybe_spurious`
Fix error with git repo discovery and symlinks.
Allow failure when setting file mtime.
Support multiple `--target` flags on the CLI
build-std: Don't treat std like a "local" package.
Allow `cargo package --list` even for things that don't package.
````

I'd like to get https://github.com/rust-lang/cargo/pull/8186 into nightly asap. :)

r? @ehuss

4 years agoremove obsolete comments
Tshepang Lekhonkhobe [Fri, 1 May 2020 11:32:08 +0000 (13:32 +0200)]
remove obsolete comments

Referenced was removed in 8770d0f34a9bee2691517ab95803a277c453dfda

4 years agosubmodules: update cargo from 90931d9b3 to 258c89644
Matthias Krüger [Fri, 1 May 2020 11:04:03 +0000 (13:04 +0200)]
submodules: update cargo from 90931d9b3 to 258c89644

Changes:
````
Remove unnecessary loop in `maybe_spurious`
Fix error with git repo discovery and symlinks.
Allow failure when setting file mtime.
Support multiple `--target` flags on the CLI
build-std: Don't treat std like a "local" package.
Allow `cargo package --list` even for things that don't package.
````

4 years agofmt
Ralf Jung [Fri, 1 May 2020 10:08:16 +0000 (12:08 +0200)]
fmt

4 years agoremove obsolete comment
Tshepang Lekhonkhobe [Fri, 1 May 2020 09:45:05 +0000 (11:45 +0200)]
remove obsolete comment

Referenced was removed in 9f492fefef8d9a75f6dc27c834561fe977ca70c5

4 years agoremove AllocId generalization of Pointer
Ralf Jung [Fri, 1 May 2020 09:33:21 +0000 (11:33 +0200)]
remove AllocId generalization of Pointer

4 years agobootstrap: also apply unused-attributes hack without deny_warnings
Ralf Jung [Fri, 1 May 2020 09:16:05 +0000 (11:16 +0200)]
bootstrap: also apply unused-attributes hack without deny_warnings

4 years agoAuto merge of #71704 - RalfJung:miri-error-print, r=oli-obk
bors [Fri, 1 May 2020 09:15:12 +0000 (09:15 +0000)]
Auto merge of #71704 - RalfJung:miri-error-print, r=oli-obk

Miri: tweak error print

I started by adjusting the "invalid use of int as pointer" message (it wasn't really clear what is invalid about the use). But then I realized that these are all `Debug` impls we use for these errors, for some reason, so I fixed that to use `Display` instead.

~~This includes https://github.com/rust-lang/rust/pull/71590 (to get the `Display` impl for `Pointer`), so the diff will look better once that finally lands. Here's the [relative diff](https://github.com/RalfJung/rust/compare/e72ebf5119e833b70231c3f2f8c7ca4904b1f0a3...RalfJung:miri-error-print).~~

r? @oli-obk

4 years agouse hex for invalid bool and char (consistently with validation)
Ralf Jung [Fri, 1 May 2020 08:56:17 +0000 (10:56 +0200)]
use hex for invalid bool and char (consistently with validation)

4 years agorename InvalidIntPtrUsage
Ralf Jung [Thu, 30 Apr 2020 18:37:58 +0000 (20:37 +0200)]
rename InvalidIntPtrUsage

4 years agobless you
Ralf Jung [Thu, 30 Apr 2020 09:59:48 +0000 (11:59 +0200)]
bless you

4 years agoInterpError printing really is more Display than Debug
Ralf Jung [Thu, 30 Apr 2020 09:03:55 +0000 (11:03 +0200)]
InterpError printing really is more Display than Debug

also tweak InvalidDiscriminant message

4 years agotweak InvalidIntPointerUsage message
Ralf Jung [Thu, 30 Apr 2020 08:49:45 +0000 (10:49 +0200)]
tweak InvalidIntPointerUsage message

4 years agoAuto merge of #71623 - petrochenkov:localink, r=estebank
bors [Fri, 1 May 2020 04:43:28 +0000 (04:43 +0000)]
Auto merge of #71623 - petrochenkov:localink, r=estebank

Disable localization for all linkers

We previously disabled non-English output from `link.exe` due to encoding issues (#35785).

In https://github.com/rust-lang/rust/pull/70740 it was pointed out that it also prevents correct inspection of the linker output, which we have to do occasionally.

So this PR disables localization for all linkers.

4 years agoAuto merge of #70674 - cjgillot:query-arena-all, r=matthewjasper
bors [Fri, 1 May 2020 01:38:05 +0000 (01:38 +0000)]
Auto merge of #70674 - cjgillot:query-arena-all, r=matthewjasper

Have the per-query caches store the results on arenas

This PR leverages the cache for each query to serve as storage area for the query results.

It introduces a new cache `ArenaCache`, which moves the result to an arena,
and only stores the reference in the hash map.
This allows to remove a sizeable part of the usage of the global `TyCtxt` arena.

I only migrated queries that already used arenas before.

4 years agomismatched_target_os: link to respective section in rust reference
Matthias Krüger [Thu, 30 Apr 2020 23:21:24 +0000 (01:21 +0200)]
mismatched_target_os: link to respective section in rust reference

4 years agoAuto merge of #71721 - tmandry:rollup-e27pxex, r=tmandry
bors [Thu, 30 Apr 2020 22:24:24 +0000 (22:24 +0000)]
Auto merge of #71721 - tmandry:rollup-e27pxex, r=tmandry

Rollup of 8 pull requests

Successful merges:

 - #71148 (Vec drop and truncate: drop using raw slice *mut [T])
 - #71465 (Add a convenience method on `TyCtxt` for checking for thread locals)
 - #71567 (Handle build completion message from Cargo)
 - #71590 (MIR dump: print pointers consistently with Miri output)
 - #71682 (Bump pulldown-cmark)
 - #71688 (Allow `Downcast` projections unconditionally in const-checking)
 - #71691 (Allow `Unreachable` terminators unconditionally in const-checking)
 - #71719 (Update backtrace-sys)

Failed merges:

r? @ghost

4 years agoRollup merge of #71719 - tmandry:update-backtrace-sys, r=Mark-Simulacrum
Tyler Mandry [Thu, 30 Apr 2020 22:23:20 +0000 (15:23 -0700)]
Rollup merge of #71719 - tmandry:update-backtrace-sys, r=Mark-Simulacrum

Update backtrace-sys

Diff:

- Don't look for old RUSTC_DEBUGINFO vars (rust-lang/backtrace-rs#313)

This fixes an issue of libbacktrace never being built with debuginfo.

r? @Mark-Simulacrum
cc @alexcrichton

4 years agoRollup merge of #71691 - ecstatic-morse:const-unreachable, r=oli-obk,RalfJung
Tyler Mandry [Thu, 30 Apr 2020 22:23:19 +0000 (15:23 -0700)]
Rollup merge of #71691 - ecstatic-morse:const-unreachable, r=oli-obk,RalfJung

Allow `Unreachable` terminators unconditionally in const-checking

If we ever actually reach an `Unreachable` terminator while executing, the MIR is ill-formed or the user's program is UB due to something like `unreachable_unchecked`. I don't think we need to forbid these in `qualify_min_const_fn`.

r? @oli-obk

4 years agoRollup merge of #71688 - ecstatic-morse:const-downcast, r=oli-obk
Tyler Mandry [Thu, 30 Apr 2020 22:23:17 +0000 (15:23 -0700)]
Rollup merge of #71688 - ecstatic-morse:const-downcast, r=oli-obk

Allow `Downcast` projections unconditionally in const-checking

`ProjectionElem::Downcast` sounds scary, but it's really just the projection we use to access a particular enum variant. They usually appear in the lowering of a `match` statement, so they have been associated with control flow in const-checking, but they don't do any control flow by themselves. We already have a HIR pass that looks for `if` and `match` (even ones that have 1 or fewer reachable branches). That pass is double-checked by a MIR pass that looks for `SwitchInt`s and `FakeRead`s for match scrutinees. In my opinion, there's no need to look for `Downcast` as well.

r? @oli-obk

4 years agoRollup merge of #71682 - ehuss:bump-pulldown-cmark, r=Dylan-DPC
Tyler Mandry [Thu, 30 Apr 2020 22:23:15 +0000 (15:23 -0700)]
Rollup merge of #71682 - ehuss:bump-pulldown-cmark, r=Dylan-DPC

Bump pulldown-cmark

Pulls in 0.7.1 with the following fixes:

- Update html5ever to 0.25
- Fix hang on unclosed html element

Closes #70871

4 years agoRollup merge of #71590 - RalfJung:mir-dump-pointers, r=oli-obk
Tyler Mandry [Thu, 30 Apr 2020 22:23:13 +0000 (15:23 -0700)]
Rollup merge of #71590 - RalfJung:mir-dump-pointers, r=oli-obk

MIR dump: print pointers consistently with Miri output

This makes MIR allocation dump pointer printing consistent with Miri output: both use hexadecimal offsets with a `0x` prefix. To save some space, MIR dump replaces the `alloc` prefix by `a` when necessary.

I also made AllocId/Pointer printing more consistent in their Debug/Display handling, and adjusted Display printing for Scalar a bit to avoid using decimal printing when we do not know the sign with which to interpret the value (IMO using decimal then is misleading).

4 years agoRollup merge of #71567 - Mark-Simulacrum:no-success, r=matthiaskrgr
Tyler Mandry [Thu, 30 Apr 2020 22:23:12 +0000 (15:23 -0700)]
Rollup merge of #71567 - Mark-Simulacrum:no-success, r=matthiaskrgr

Handle build completion message from Cargo

This was introduced in the recent bump to 1.44 bootstrap cargo

Fixes #71561.

4 years agoRollup merge of #71465 - oli-obk:is_thread_local_cleanup, r=matthewjasper
Tyler Mandry [Thu, 30 Apr 2020 22:23:10 +0000 (15:23 -0700)]
Rollup merge of #71465 - oli-obk:is_thread_local_cleanup, r=matthewjasper

Add a convenience method on `TyCtxt` for checking for thread locals

This PR extracts the cleanup part of #71192

r? @bjorn3

4 years agoRollup merge of #71148 - bluss:vec-drop-raw-slice, r=RalfJung
Tyler Mandry [Thu, 30 Apr 2020 22:23:08 +0000 (15:23 -0700)]
Rollup merge of #71148 - bluss:vec-drop-raw-slice, r=RalfJung

Vec drop and truncate: drop using raw slice *mut [T]

By creating a *mut [T] directly (without going through &mut [T]), avoid
questions of validity of the contents of the slice.

Consider the following risky code:

```rust
unsafe {
    let mut v = Vec::<bool>::with_capacity(16);
    v.set_len(16);
}
```

The intention is that with this change, we avoid one of the soundness
questions about the above snippet, because Vec::drop no longer
produces a mutable slice of the vector's contents.

r? @RalfJung

4 years agowf: {Int,Float}Var can only infer to always-WF ints/floats.
Eduard-Mihai Burtescu [Thu, 2 Apr 2020 22:01:30 +0000 (01:01 +0300)]
wf: {Int,Float}Var can only infer to always-WF ints/floats.

4 years agowf: handle "livelock" checking before reaching `WfPredicates::compute`.
Eduard-Mihai Burtescu [Thu, 19 Mar 2020 23:49:01 +0000 (01:49 +0200)]
wf: handle "livelock" checking before reaching `WfPredicates::compute`.

4 years agoUpdate backtrace-sys
Tyler Mandry [Thu, 30 Apr 2020 19:29:40 +0000 (12:29 -0700)]
Update backtrace-sys

Diff:

- Don't look for old RUSTC_DEBUGINFO vars (rust-lang/backtrace-rs#313)

4 years agoAuto merge of #71717 - Dylan-DPC:rollup-av5vjor, r=Dylan-DPC
bors [Thu, 30 Apr 2020 19:01:01 +0000 (19:01 +0000)]
Auto merge of #71717 - Dylan-DPC:rollup-av5vjor, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #70950 (extend NLL checker to understand `'empty` combined with universes)
 - #71433 (Add help message for missing right operand in condition)
 - #71449 (Move `{Free,}RegionRelations` and `FreeRegionMap` to `rustc_infer`)
 - #71559 (Detect git version before attempting to use --progress)
 - #71597 (Rename Unique::empty() -> Unique::dangling())

Failed merges:

r? @ghost

4 years agoRollup merge of #71597 - CohenArthur:refactor-unique-empty, r=shepmaster
Dylan DPC [Thu, 30 Apr 2020 18:15:28 +0000 (20:15 +0200)]
Rollup merge of #71597 - CohenArthur:refactor-unique-empty, r=shepmaster

Rename Unique::empty() -> Unique::dangling()

A `FIXME` comment in `src/libcore/ptr/unique.rs` suggested refactoring `Unique::empty()` to `Unique::dangling()` which this PR does.

4 years agoRollup merge of #71559 - dillona:detect_git_progress_version, r=Mark-Simulacrum
Dylan DPC [Thu, 30 Apr 2020 18:15:26 +0000 (20:15 +0200)]
Rollup merge of #71559 - dillona:detect_git_progress_version, r=Mark-Simulacrum

Detect git version before attempting to use --progress

Otherwise each update is run twice and errors are printed

I've tested this with:
git version 2.8.2.windows.1 (Windows)
git version 2.26.2.266.ge870325ee8 (Linux built from source)
git version 2.17.1 (Linux)
git version 2.21.1 (Apple Git-122.3) (MacOS)

I've tested with Python 2.7 (Windows, Linux, MacOS), 3.6 (Linux), and 3.7 (MacOS)

4 years agoRollup merge of #71449 - ecstatic-morse:free-region-cleanup, r=Mark-Simulacrum
Dylan DPC [Thu, 30 Apr 2020 18:15:24 +0000 (20:15 +0200)]
Rollup merge of #71449 - ecstatic-morse:free-region-cleanup, r=Mark-Simulacrum

Move `{Free,}RegionRelations` and `FreeRegionMap` to `rustc_infer`

...and out of `rustc_middle`. This is to further #65031, albeit in a very minor way

r? @Mark-Simulacrum

4 years agoRollup merge of #71433 - antoyo:error/missing-right-operand, r=Dylan-DPC
Dylan DPC [Thu, 30 Apr 2020 18:15:22 +0000 (20:15 +0200)]
Rollup merge of #71433 - antoyo:error/missing-right-operand, r=Dylan-DPC

Add help message for missing right operand in condition

closes #30035

4 years agoRollup merge of #70950 - nikomatsakis:leak-check-nll-2, r=matthewjasper
Dylan DPC [Thu, 30 Apr 2020 18:15:20 +0000 (20:15 +0200)]
Rollup merge of #70950 - nikomatsakis:leak-check-nll-2, r=matthewjasper

extend NLL checker to understand `'empty` combined with universes

This PR extends the NLL region checker to understand `'empty` combined with universes. In particular, it means that the NLL region checker no longer considers `exists<R2> { forall<R1> { R1: R2 } }` to be provable. This is work towards https://github.com/rust-lang/rust/issues/59490, but we're not all the way there. One thing in particular it does not address is error messages.

The modifications to the NLL region inference code turned out to be simpler than expected. The main change is to require that if `R1: R2` then `universe(R1) <= universe(R2)`.

This constraint follows from the region lattice (shown below), because we assume then that `R2` is "at least" `empty(Universe(R2))`, and hence if `R1: R2` (i.e., `R1 >= R2` on the lattice) then `R1` must be in some universe that can name `'empty(Universe(R2))`, which requires that `Universe(R1) <= Universe(R2)`.

```
static ----------+-----...------+       (greatest)
|                |              |
early-bound and  |              |
free regions     |              |
|                |              |
scope regions    |              |
|                |              |
empty(root)   placeholder(U1)   |
|            /                  |
|           /         placeholder(Un)
empty(U1) --         /
|                   /
...                /
|                 /
empty(Un) --------                      (smallest)
```

I also made what turned out to be a somewhat unrelated change to add a special region to represent `'empty(U0)`, which we use (somewhat hackily) to indicate well-formedness checks in some parts of the compiler. This fixes #68550.

I did some investigation into fixing the error message situation. That's a bit trickier: the existing "nice region error" code around placeholders relies on having better error tracing than NLL currently provides, so that it knows (e.g.) that the constraint arose from applying a trait impl and things like that. I feel like I was hoping *not* to do such fine-grained tracing in NLL, and it seems like we...largely...got away with that. I'm not sure yet if we'll have to add more tracing information or if there is some sort of alternative.

It's worth pointing out though that I've not kind of shifted my opinion on whose job it should be to enforce lifetimes: I tend to think we ought to be moving back towards *something like* the leak-check (just not the one we *had*). If we took that approach, it would actually resolve this aspect of the error message problem, because we would be resolving 'higher-ranked errors' in the trait solver itself, and hence we wouldn't have to thread as much causal information back to the region checker. I think it would also help us with removing the leak check while not breaking some of the existing crates out there.

Regardless, I think it's worth landing this change, because it was relatively simple and it aligns the set of programs that NLL accepts with those that are accepted by the main region checker, and hence should at least *help* us in migration (though I guess we still also have to resolve the existing crates that rely on leak check for coherence).

r? @matthewjasper

4 years agoMiri: port error backtraces to std::backtrace
Ralf Jung [Thu, 30 Apr 2020 16:24:43 +0000 (18:24 +0200)]
Miri: port error backtraces to std::backtrace

4 years agohandle ByRef in relate
Bastian Kauschke [Sat, 11 Apr 2020 16:05:02 +0000 (18:05 +0200)]
handle ByRef in relate

4 years agocoerce documentation
Bastian Kauschke [Sat, 11 Apr 2020 08:23:33 +0000 (10:23 +0200)]
coerce documentation

4 years agoAuto merge of #71675 - pietroalbini:ci-fix-shrink-regression, r=Mark-Simulacrum
bors [Thu, 30 Apr 2020 15:35:16 +0000 (15:35 +0000)]
Auto merge of #71675 - pietroalbini:ci-fix-shrink-regression, r=Mark-Simulacrum

ci: use bash when executing the "bors build finished" jobs

We don't clone the repository in those builders, so the default shell (`src/ci/exec-with-shell.py`) is not present there. This fixes a GHA regression introduced in #71434.

r? @Mark-Simulacrum

4 years agoA test now fails during check instead of build
Oliver Scherer [Thu, 30 Apr 2020 15:27:33 +0000 (17:27 +0200)]
A test now fails during check instead of build

4 years agoAddress review comments
Oliver Scherer [Thu, 30 Apr 2020 15:05:36 +0000 (17:05 +0200)]
Address review comments

4 years agoHighlight an error that can only happen in CTFE
Oliver Scherer [Thu, 30 Apr 2020 12:53:28 +0000 (14:53 +0200)]
Highlight an error that can only happen in CTFE

4 years agoAdd a convenience function for testing whether a static is `#[thread_local]`
Oliver Scherer [Fri, 17 Apr 2020 16:55:23 +0000 (18:55 +0200)]
Add a convenience function for testing whether a static is `#[thread_local]`

4 years agoSeparate miri/ctfe unsupported operations
Oliver Scherer [Thu, 16 Apr 2020 15:32:48 +0000 (17:32 +0200)]
Separate miri/ctfe unsupported operations

4 years agoAuto merge of #71707 - Dylan-DPC:rollup-hk8itvo, r=Dylan-DPC
bors [Thu, 30 Apr 2020 12:17:15 +0000 (12:17 +0000)]
Auto merge of #71707 - Dylan-DPC:rollup-hk8itvo, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #71205 (rustc: fix check_attr() for methods, closures and foreign functions)
 - #71540 (Suggest deref when coercing `ty::Ref` to `ty::RawPtr`)
 - #71655 (Miri: better document and fix dynamic const pattern soundness checks)
 - #71672 (document missing stable counterparts of intrinsics)
 - #71692 (Add clarification on std::cfg macro docs v. #[cfg] attribute)

Failed merges:

r? @ghost

4 years agoRollup merge of #71692 - dfreese:cfgdocs, r=kennytm
Dylan DPC [Thu, 30 Apr 2020 12:07:58 +0000 (14:07 +0200)]
Rollup merge of #71692 - dfreese:cfgdocs, r=kennytm

Add clarification on std::cfg macro docs v. #[cfg] attribute

The wording was discussed, to a limited degree in #71679.  This tries to
address some confusion I as well as someone else had independently when
looking at this macro.

Fixes #71679

4 years agoRollup merge of #71672 - lcnr:instrinsics-wow, r=Dylan-DPC
Dylan DPC [Thu, 30 Apr 2020 12:07:57 +0000 (14:07 +0200)]
Rollup merge of #71672 - lcnr:instrinsics-wow, r=Dylan-DPC

document missing stable counterparts of intrinsics

Notes the stable counterpart of each intrinsic in case one exists.

Implements #34338

r? @Dylan-DPC

4 years agoRollup merge of #71655 - RalfJung:const-pattern-soundness, r=oli-obk
Dylan DPC [Thu, 30 Apr 2020 12:07:55 +0000 (14:07 +0200)]
Rollup merge of #71655 - RalfJung:const-pattern-soundness, r=oli-obk

Miri: better document and fix dynamic const pattern soundness checks

https://github.com/rust-lang/const-eval/issues/42 got me thinking about soundness for consts being used in patterns, and I found a hole in our existing dynamic checks: a const referring to a mutable static *in a different crate* was not caught. This PR fixes that. It also adds some comments that explain which invariants are crucial for soundness of const-patterns.

Curiously, trying to weaponize this soundness hole failed: pattern matching compilation ICEd when encountering the cross-crate static, saying "expected allocation ID alloc0 to point to memory". I don't know why that would happen, statics *should* be entirely normal memory for pattern matching to access.

r? @oli-obk
Cc @rust-lang/wg-const-eval

4 years agoRollup merge of #71540 - ldm0:ref2ptr, r=oli-obk
Dylan DPC [Thu, 30 Apr 2020 12:07:53 +0000 (14:07 +0200)]
Rollup merge of #71540 - ldm0:ref2ptr, r=oli-obk

Suggest deref when coercing `ty::Ref` to `ty::RawPtr`

Fixes #32122

Currently we do autoderef when casting `ty::Ref` ->`ty::Ref`, but we don't autoderef when casting `ty::Ref` -> `ty::RawPtr`. This PR make the compiler suggests deref when coercing `ty::Ref` to `ty::RawPtr`

4 years agoRollup merge of #71205 - NeoRaider:check_attr, r=jonas-schievink
Dylan DPC [Thu, 30 Apr 2020 12:07:52 +0000 (14:07 +0200)]
Rollup merge of #71205 - NeoRaider:check_attr, r=jonas-schievink

rustc: fix check_attr() for methods, closures and foreign functions

This fixes an issue that previously turned up for methods in https://github.com/rust-lang/rust/pull/69274, but also exists for closures and foreign function: `check_attr` does not call `codegen_fn_attrs()` for these types when it should, meaning that incorrectly used function attributes are not diagnosed without codegen.

The issue affects our UI tests, as they run with `--emit=metadata` by default, but as it turns out, this is not the only case: Function attributes are not checked on any dead code without this fix!

This makes the fix a **breaking change**. The following very silly Rust programs compiles fine on stable Rust when it should not, which is fixed by this PR.
```rust
fn main() {
    #[target_feature(enable = "sse2")]
    || {};
}
```

I assume any real-world program which may trigger this issue would at least emit a dead code warning, but of course that is no guarantee that such code does not exist...

Fixes #70307

4 years agorename-unique: Rename Unique::empty() to Unique::dangling()
cohenarthur [Thu, 30 Apr 2020 09:00:45 +0000 (11:00 +0200)]
rename-unique: Rename Unique::empty() to Unique::dangling()

rename-unique: Change calls and doc in raw_vec.rs

rename-unique: Change empty() -> dangling() in const-ptr-unique-rpass.rs

4 years agoAuto merge of #70175 - Amanieu:remove_nlp, r=pnkfelix
bors [Thu, 30 Apr 2020 07:04:43 +0000 (07:04 +0000)]
Auto merge of #70175 - Amanieu:remove_nlp, r=pnkfelix

Remove -Z no-landing-pads flag

Since #67502, `-Z no-landing-pads` will cause all attempted unwinds to abort since we don't generate a `try` / `catch`. This previously worked because `__rust_try` was located in libpanic_unwind which is always compiled with `-C panic=unwind`, but `__rust_try` is now directly inline into the crate that uses `catch_unwind`.

As such, `-Z no-landing-pads` is now mostly useless and people should use `-C panic=abort` instead.

4 years agoAuto merge of #71687 - RalfJung:miri, r=RalfJung
bors [Thu, 30 Apr 2020 03:48:47 +0000 (03:48 +0000)]
Auto merge of #71687 - RalfJung:miri, r=RalfJung

update Miri

Fixes https://github.com/rust-lang/rust/issues/71632
r? @ghost
Cc @rust-lang/miri