Commit Graph

144 Commits

Author SHA1 Message Date
bors fd15e6180d Auto merge of #70743 - oli-obk:eager_const_to_pat_conversion, r=eddyb
Fully destructure constants into patterns

r? `@varkor`

as discussed in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/constants.20in.20patterns/near/192789924

we should probably crater it once reviewed
2020-09-26 06:44:28 +00:00
marmeladema 5946c12476 Move `is_raw_guess` check in `ty::print::pretty` 2020-09-25 22:48:44 +01:00
marmeladema 35bad3edbf Address review comment 2020-09-25 22:48:44 +01:00
marmeladema 23085b6360 Fix profiling query key creation 2020-09-25 22:46:15 +01:00
marmeladema 657ecdb75e Rename `DefPathData::get_name()` to `DefPathData::name()` 2020-09-25 22:46:15 +01:00
marmeladema 2708ad8bb4 Fix pretty-printing of `DisambiguatedDefPathData` 2020-09-25 22:46:15 +01:00
marmeladema 9f50c49117 Implement `Display` for `DisambiguatedDefPathData` and `DefPathData` 2020-09-25 22:46:15 +01:00
marmeladema f1878d19fa Move from {{closure}}#0 syntax to {closure#0} for (def) path components 2020-09-25 22:46:14 +01:00
Jonas Schievink e739468f97
Rollup merge of #77155 - lcnr:ImplSource, r=ecstatic-morse
remove enum name from ImplSource variants

This is quite a lot cleaner in my opinion.
2020-09-25 19:42:48 +02:00
bors 5b9e886403 Auto merge of #73453 - erikdesjardins:tuplayout, r=eddyb
Ignore ZST offsets when deciding whether to use Scalar/ScalarPair layout

This is important because Scalar/ScalarPair layout previously would not be used if any ZST had nonzero offset.
For example, before this change, only `((), u128)` would be laid out like `u128`, not `(u128, ())`.

Fixes #63244
2020-09-25 14:42:20 +00:00
bors b984ef6797 Auto merge of #77152 - vandenheuvel:update_chalk_further, r=jackh726
Update chalk to 0.28.0
2020-09-25 12:22:05 +00:00
Jonas Schievink 8515efb193
Rollup merge of #77165 - simonvandel:do-not-fire-on-drop-and-replace, r=oli-obk
Followup to #76673

Resolves https://github.com/rust-lang/rust/pull/76673#discussion_r494426303
r? @tmiasko
2020-09-25 02:29:52 +02:00
Jonas Schievink 6f3da3d53f
Rollup merge of #77121 - duckymirror:html-root-url, r=jyn514
Updated html_root_url for compiler crates

Closes #77103

r? @jyn514
2020-09-25 02:29:45 +02:00
Simon Vandel Sillesen 7dec440340 Resolve https://github.com/rust-lang/rust/pull/76673#discussion_r494426303 2020-09-24 21:02:53 +02:00
Bram van den Heuvel 51c781f613 Upgrade chalk to 0.28.0 2020-09-24 20:54:33 +02:00
Bastian Kauschke 1857184cd1 remove enum name from ImplSource variants 2020-09-24 19:22:36 +02:00
Bram van den Heuvel 5f67571e34 Update chalk to 0.27.0 2020-09-24 19:10:01 +02:00
Bram van den Heuvel 61b2a6f5e5 Update chalk to 0.26.0 2020-09-24 19:10:01 +02:00
Bram van den Heuvel ed784023e5 Update chalk to 0.25.0 2020-09-24 19:10:01 +02:00
Bram van den Heuvel cb660c6ab5 Update chalk to 0.24.0 2020-09-24 19:10:01 +02:00
Bram van den Heuvel 52eeff6fbe Update chalk to 0.23.0 2020-09-24 19:10:00 +02:00
Bram van den Heuvel b832a97a51 Update chalk to 0.22.0 2020-09-24 19:10:00 +02:00
bors 87d262acb5 Auto merge of #77006 - oli-obk:🐌_const_queries, r=Mark-Simulacrum
Cache `eval_to_allocation_raw` on disk

https://github.com/rust-lang/rust/pull/74949#issuecomment-695833161 regressed the performance on these queries, this PR gets the perf back.
2020-09-24 15:12:17 +00:00
Oliver Scherer 40629ef827 Always cache const eval queries 2020-09-24 17:09:09 +02:00
bors 893fadd11a Auto merge of #76820 - jyn514:query-comments, r=davidtwco
Preserve doc-comments when generating queries

Closes https://github.com/rust-lang/rust/issues/76812
2020-09-24 13:01:46 +00:00
bors 86b4172305 Auto merge of #77028 - andjo403:mini, r=matthewjasper
Move MiniSet to data_structures

remove the need for T to be copy from MiniSet as was done for MiniMap

MiniMap and MiniSet was added by https://github.com/rust-lang/rust/pull/72412

think that this can be used in https://github.com/rust-lang/rust/pull/68828
2020-09-24 08:14:30 +00:00
Erik Hofmayer 138a2e5eaa /nightly/nightly-rustc 2020-09-23 21:51:56 +02:00
Erik Hofmayer dd66ea2d3d Updated html_root_url for compiler crates 2020-09-23 21:14:43 +02:00
Dylan DPC bcdbe79f0c
Rollup merge of #76994 - yuk1ty:fix-small-typo, r=estebank
fix small typo in docs and comments

Fixed `the the` to `the`, as far as I found.
2020-09-23 14:54:07 +02:00
Dylan DPC 98e5ee7df0
Rollup merge of #76939 - lcnr:const-evaluatable-cont, r=oli-obk
emit errors during AbstractConst building

There changes are currently still untested, so I don't expect this to pass CI 😆

It seems to me like this is the direction we want to go in, though we didn't have too much of a discussion about this.

r? @oli-obk
2020-09-23 14:54:02 +02:00
Andreas Jonson 6586c37bec Move MiniSet to data_structures
remove the need for T to be copy from MiniSet as was done for MiniMap
2020-09-23 08:09:16 +02:00
ecstatic-morse 50d4aebc7a
Rollup merge of #76914 - lcnr:path-no-more, r=ecstatic-morse
extend `Ty` and `TyCtxt` lints to self types

blocked on #76891

r? @ecstatic-morse cc @Aaron1011
2020-09-21 20:40:57 -07:00
ecstatic-morse dcf4d1f2be
Rollup merge of #76888 - matthiaskrgr:clippy_single_match_2, r=Dylan-DPC
use if let instead of single match arm expressions

use if let instead of single match arm expressions to compact code and reduce nesting (clippy::single_match)
2020-09-21 20:40:55 -07:00
ecstatic-morse 30f1bab7e6
Rollup merge of #76581 - lcnr:bound-too-generic, r=eddyb
do not ICE on bound variables, return `TooGeneric` instead

fixes #73260, fixes #74634, fixes #76595

r? @nikomatsakis
2020-09-21 20:40:47 -07:00
bors 45198456be Auto merge of #76913 - vandenheuvel:performance_debug, r=lcnr
Fixing the performance regression of #76244

Issue https://github.com/rust-lang/rust/issues/74865 suggested that removing the `def_id` field from `ParamEnv` would improve performance. PR https://github.com/rust-lang/rust/pull/76244 implemented this change.

Generally, [results](https://perf.rust-lang.org/compare.html?start=80fc9b0ecb29050d45b17c64af004200afd3cfc2&end=5ef250dd2ad618ee339f165e9b711a1b4746887d) were as expected: an instruction count decrease of about a percent. The instruction count for the unicode crates increased by about 3%, which `@nnethercote` speculated to be caused by a quirk of inlining or codegen. As the results were generally positive, and for chalk integration, this was also a step in the right direction, the PR was r+'d regardless.

However, [wall-time performance results](https://perf.rust-lang.org/compare.html?start=a055c5a1bd95e029e9b31891db63b6dc8258b472&end=7402a394471a6738a40fea7d4f1891666e5a80c5&stat=task-clock) show a much larger performance degradation: 25%, as [mentioned](https://github.com/rust-lang/rust/pull/76244#issuecomment-694459840) by `@Mark-Simulacrum.`

This PR, for now, reverts #76244 and attempts to find out, which change caused the regression.
2020-09-22 00:22:24 +00:00
Bastian Kauschke 2f893e458a review 2020-09-21 23:25:52 +02:00
Bastian Kauschke 073127a04f check for cycles when unifying const variables 2020-09-21 12:27:55 +02:00
Oliver Scherer c160bf3c3e Cache `eval_to_allocation_raw` on disk 2020-09-21 11:38:39 +02:00
Bram van den Heuvel ab83d372ed Add an unused field of type `Option<DefId>` to `ParamEnv` struct. 2020-09-21 09:39:26 +02:00
yuk1ty 16047d46a1 fix typo in docs and comments 2020-09-21 12:14:28 +09:00
Ralf Jung 9567b5a9f5
Rollup merge of #76891 - lcnr:less-ref, r=ecstatic-morse
don't take `TyCtxt` by reference

small cleanup
2020-09-20 15:52:03 +02:00
Ralf Jung 8405d50e12
Rollup merge of #76890 - matthiaskrgr:matches_simpl, r=lcnr
use matches!() macro for simple if let conditions
2020-09-20 15:52:01 +02:00
Ralf Jung 39b9a25e60
Rollup merge of #76732 - camelid:mir-basic-block-docs, r=RalfJung
Add docs for `BasicBlock`

Fixes #76715.

---

@rustbot modify labels: A-mir T-doc C-enhancement
2020-09-20 15:51:46 +02:00
bors 41507ed0d5 Auto merge of #76964 - RalfJung:rollup-ybn06fs, r=RalfJung
Rollup of 15 pull requests

Successful merges:

 - #76722 (Test and fix Send and Sync traits of BTreeMap artefacts)
 - #76766 (Extract some intrinsics out of rustc_codegen_llvm)
 - #76800 (Don't generate bootstrap usage unless it's needed)
 - #76809 (simplfy condition in ItemLowerer::with_trait_impl_ref())
 - #76815 (Fix wording in mir doc)
 - #76818 (Don't compile regex at every function call.)
 - #76821 (Remove redundant nightly features)
 - #76823 (black_box: silence unused_mut warning when building with cfg(miri))
 - #76825 (use `array_windows` instead of `windows` in the compiler)
 - #76827 (fix array_windows docs)
 - #76828 (use strip_prefix over starts_with and manual slicing based on pattern length (clippy::manual_strip))
 - #76840 (Move to intra doc links in core/src/future)
 - #76845 (Use intra docs links in core::{ascii, option, str, pattern, hash::map})
 - #76853 (Use intra-doc links in library/core/src/task/wake.rs)
 - #76871 (support panic=abort in Miri)

Failed merges:

r? `@ghost`
2020-09-20 11:02:36 +00:00
Oliver Scherer 34c62e0abc Add a query for dereferencing constants of reference type 2020-09-20 12:42:44 +02:00
Ralf Jung 50d56bc774
Rollup merge of #76825 - lcnr:array-windows-apply, r=varkor
use `array_windows` instead of `windows` in the compiler

I do think these changes are beautiful, but do have to admit that using type inference for the window length
can easily be confusing. This seems like a general issue with const generics, where inferring constants adds an additional
complexity which users have to learn and keep in mind.
2020-09-20 12:08:26 +02:00
Ralf Jung 4322e1b92d
Rollup merge of #76821 - est31:remove_redundant_nightly_features, r=oli-obk,Mark-Simulacrum
Remove redundant nightly features

Removes a bunch of redundant/outdated nightly features. The first commit removes a `core_intrinsics` use for which a stable wrapper has been provided since. The second commit replaces the `const_generics` feature with `min_const_generics` which might get stabilized this year. The third commit is the result of a trial/error run of removing every single feature and then adding it back if compile failed. A bunch of unused features are the result that the third commit removes.
2020-09-20 12:08:22 +02:00
Ralf Jung c12feb35db
Rollup merge of #76815 - pickfire:patch-6, r=jonas-schievink
Fix wording in mir doc
2020-09-20 12:08:19 +02:00
Matthias Krüger c690c82ad4 use if let instead of single match arm expressions to compact code and reduce nesting (clippy::single_match) 2020-09-20 11:42:52 +02:00
bors 5e449b9adf Auto merge of #74949 - oli-obk:validate_const_eval_raw, r=RalfJung
Validate constants during `const_eval_raw`

This PR implements the groundwork for https://github.com/rust-lang/rust/issues/72396

* constants are now validated during `const_eval_raw`
* to prevent cycle errors, we do not validate references to statics anymore beyond the fact that they are not dangling
* the `const_eval` query ICEs if used on `static` items
* as a side effect promoteds are now evaluated to `ConstValue::Scalar` again (since they are just a reference to the actual promoted allocation in most cases).
2020-09-20 08:58:32 +00:00