Commit Graph

111021 Commits

Author SHA1 Message Date
Oliver Scherer
06c44816c1 Delete the clippy submodule 2020-05-02 09:48:46 +02:00
Oliver Scherer
1ef5a93af6 Also build clippy with ./x.py check 2020-05-02 09:46:42 +02:00
Oliver Scherer
a1824505d8 Gate on clippy on CI 2020-05-02 09:46:42 +02:00
bors
dae90c1959 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.
2020-05-02 03:39:04 +00:00
bors
19ae74d0d0 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
2020-05-02 00:21:39 +00:00
Dylan DPC
f2fddd35af
Rollup merge of #71762 - tshepang:typo, r=jonas-schievink
doc: this resulted in a link pointing to a non-existent target
2020-05-01 23:16:40 +02:00
Dylan DPC
50f212e4d5
Rollup merge of #71761 - tshepang:missing-target, r=jonas-schievink
doc: reference does not exist, probably a typo
2020-05-01 23:16:38 +02:00
Dylan DPC
05b1991e76
Rollup merge of #71760 - LeSeulArtichaut:document-unsafety, r=Mark-Simulacrum
Document unsafety for `*const T` and `*mut T`

Helps with #66219
r? @Mark-Simulacrum
2020-05-01 23:16:36 +02:00
Dylan DPC
8aad12b87d
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
2020-05-01 23:16:35 +02:00
Dylan DPC
14c3ee906b
Rollup merge of #71018 - lcnr:custom-const-param, r=eddyb
handle ConstValue::ByRef in relate

fixes #68615

r? @eddyb
2020-05-01 23:16:32 +02:00
bors
dba944a6b7 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
2020-05-01 21:08:23 +00:00
Jack Huey
ef0da3ba4e Remove leftover chalk types 2020-05-01 14:39:05 -04:00
Tshepang Lekhonkhobe
28f8586698 doc: this resulted in a link pointing to a non-existent target 2020-05-01 20:37:34 +02:00
Tshepang Lekhonkhobe
e0db42b32f doc: reference does not exist, probably a typo 2020-05-01 20:25:50 +02:00
bors
7f65393b9a 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
2020-05-01 18:00:52 +00:00
LeSeulArtichaut
d61debac64 Document unsafety for *const T and *mut T 2020-05-01 19:49:56 +02:00
Dylan DPC
da42f6897e
Rollup merge of #71755 - tshepang:fix-comment, r=jonas-schievink
fix doc reference

Should of been in e0ce9f8c0a,
but that had a typo.
2020-05-01 19:49:18 +02:00
Dylan DPC
2a3c2b335b
Rollup merge of #71752 - tshepang:more-readable, r=jonas-schievink
make Stability doc a more readable (and fix rustdoc warning)
2020-05-01 19:49:16 +02:00
Dylan DPC
8d9912ef49
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
2020-05-01 19:49:14 +02:00
Dylan DPC
d83d8be65d
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
2020-05-01 19:49:13 +02:00
Dylan DPC
54013532cd
Rollup merge of #71744 - tshepang:obsolete-comment, r=Dylan-DPC
remove obsolete comment

Referenced was removed in 8770d0f34a
2020-05-01 19:49:11 +02:00
Alex Crichton
e1832fa4e4 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.
2020-05-01 09:05:13 -07:00
Tshepang Lekhonkhobe
5f4b7a4585 fix doc reference
Should of been in e0ce9f8c0a,
but that had a typo.
2020-05-01 17:53:52 +02:00
Tshepang Lekhonkhobe
7a1a69911b make Stability docs a bit more readable, and fix some rustdoc warnings 2020-05-01 16:41:50 +02:00
Camille GILLOT
e4976d0caf Restrict access. 2020-05-01 15:10:45 +02:00
Camille GILLOT
282d72f6bb Inline a few things. 2020-05-01 15:10:12 +02:00
Camille GILLOT
49e024ee7c Monomorphise the interface. 2020-05-01 14:53:55 +02:00
Camille GILLOT
e15383cce1 Move the DepNode construction to librustc_query_system. 2020-05-01 14:48:14 +02:00
Camille GILLOT
8f3e96d658 Monomorphise try_execute_query. 2020-05-01 14:40:17 +02:00
Ralf Jung
1bab6a4db7 fix Miri error message padding 2020-05-01 14:39:41 +02:00
Camille GILLOT
1c7376e797 Monomorphise try_start. 2020-05-01 14:37:12 +02:00
Camille GILLOT
d56085cbc9 Monomorphise try_execute_anon_query. 2020-05-01 14:32:11 +02:00
Santiago Pastorino
8bdf988be2
Remove deadcode in eval_mir_constant_to_operand 2020-05-01 09:30:55 -03:00
Camille GILLOT
85704a41db Monomorphise load_from_disk_and_cache_in_memory. 2020-05-01 14:29:35 +02:00
Camille GILLOT
1b2deaf57a Monomorphise force_query_with_job. 2020-05-01 14:28:57 +02:00
bors
a91d64873f 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
2020-05-01 12:18:41 +00:00
Tshepang Lekhonkhobe
6a681f5ca1 remove obsolete comments
Referenced was removed in 8770d0f34a
2020-05-01 13:43:04 +02:00
Matthias Krüger
868d559699 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.
````
2020-05-01 13:04:03 +02:00
bors
fd61d06772 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](e72ebf5119...RalfJung:miri-error-print).~~

r? @oli-obk
2020-05-01 09:15:12 +00:00
Ralf Jung
cce0cb3c39 use hex for invalid bool and char (consistently with validation) 2020-05-01 10:56:17 +02:00
Ralf Jung
707bd7b213 rename InvalidIntPtrUsage 2020-05-01 10:50:04 +02:00
Ralf Jung
2feeb88b62 bless you 2020-05-01 10:50:04 +02:00
Ralf Jung
f94899565b InterpError printing really is more Display than Debug
also tweak InvalidDiscriminant message
2020-05-01 10:50:04 +02:00
Ralf Jung
671bc08ea8 tweak InvalidIntPointerUsage message 2020-05-01 10:50:04 +02:00
bors
bd0bacc694 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.
2020-05-01 04:43:28 +00:00
bors
e94eaa6dce 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.
2020-05-01 01:38:05 +00:00
bors
614f273e93 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
2020-04-30 22:24:24 +00:00
Tyler Mandry
59abc2afd8
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
2020-04-30 15:23:20 -07:00
Tyler Mandry
1b62bb67da
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
2020-04-30 15:23:19 -07:00
Tyler Mandry
a8e0511b32
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
2020-04-30 15:23:17 -07:00