Commit graph

4807 commits

Author SHA1 Message Date
Simonas Kazlauskas
64af7eae1e Move SanitizerSet to rustc_target 2021-04-03 00:37:49 +03:00
bors
23fa536050 Auto merge of #76881 - hameerabbasi:issue-53325, r=oli-obk
Add allocation information to undefined behaviour errors.

So far I'm looking on information on whether the error messages are suitable.

Fixes #53325.
2021-04-02 17:38:57 +00:00
bors
36bcf40697 Auto merge of #83468 - hi-rustin:rustin-patch-lint, r=nikomatsakis
add OR_PATTERNS_BACK_COMPAT lint

close https://github.com/rust-lang/rust/issues/83318
2021-04-02 15:14:48 +00:00
bors
a207871d5c Auto merge of #83781 - JohnTitor:rollup-1vm3dxo, r=JohnTitor
Rollup of 5 pull requests

Successful merges:

 - #83535 (Break when there is a mismatch in the type count)
 - #83721 (Add a button to copy the "use statement")
 - #83740 (Fix comment typo in once.rs)
 - #83745 (Add my new email address to .mailmap)
 - #83754 (Add test to ensure search tabs behaviour)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-04-02 12:51:41 +00:00
Yuki Okushi
03ba8ab606
Rollup merge of #83535 - MidasLamb:mir-type-count-mismatch, r=nikomatsakis
Break when there is a mismatch in the type count

When other errors are generated, there can be a mismatch between the
amount of input types in MIR, and the amount in the function itself.
Break from the comparative loop if this is the case to prevent
out-of-bounds.
Fixes #83499
2021-04-02 21:28:20 +09:00
bors
0978a9eb99 Auto merge of #83207 - oli-obk:valtree2, r=lcnr
normalize mir::Constant differently from ty::Const in preparation for valtrees

Valtrees are unable to represent many kind of constant values (this is on purpose). For constants that are used at runtime, we do not need a valtree representation and can thus use a different form of evaluation. In order to make this explicit and less fragile, I added a `fold_constant` method to `TypeFolder` and implemented it for normalization. Normalization can now, when it wants to eagerly evaluate a constant, normalize `mir::Constant` directly into a `mir::ConstantKind::Val` instead of relying on the `ty::Const` evaluation.

In the future we can get rid of the `ty::Const` in there entirely and add our own `Unevaluated` variant to `mir::ConstantKind`. This would allow us to remove the `promoted` field from `ty::ConstKind::Unevaluated`, as promoteds can never occur in the type system.

cc `@rust-lang/wg-const-eval`

r? `@lcnr`
2021-04-02 10:28:12 +00:00
bors
5662d9343f Auto merge of #80965 - camelid:rename-doc-spotlight, r=jyn514
Rename `#[doc(spotlight)]` to `#[doc(notable_trait)]`

Fixes #80936.

"spotlight" is not a very specific or self-explaining name.
Additionally, the dialog that it triggers is called "Notable traits".
So, "notable trait" is a better name.

* Rename `#[doc(spotlight)]` to `#[doc(notable_trait)]`
* Rename `#![feature(doc_spotlight)]` to `#![feature(doc_notable_trait)]`
* Update documentation
* Improve documentation

r? `@Manishearth`
2021-04-02 07:04:58 +00:00
bors
4fa76a4a77 Auto merge of #80828 - SNCPlay42:opaque-projections, r=estebank
Fix expected/found order on impl trait projection mismatch error

fixes #68561

This PR adds a new `ObligationCauseCode` used when checking the concrete type of an impl trait satisfies its bounds, and checks for that cause code in the existing test to see if a projection's normalized type should be the "expected" or "found" type.

The second commit adds a `peel_derives` to that test, which appears to be necessary in some cases (see projection-mismatch-in-impl-where-clause.rs, which would still give expected/found in the wrong order otherwise). This caused some other changes in diagnostics not involving impl trait, but they look correct to me.
2021-04-02 03:39:32 +00:00
bors
d1065e6cef Auto merge of #83663 - AngelicosPhosphoros:simplify_binary_and_to_get_better_asm, r=nagisa
Simplify logical operations CFG

This is basically same commit as e38e954a0d which was reverted later in 676953fde9
In both cases, this changes weren't benchmarked.
e38e954a0d leads to missed optimization described in [this issue](https://github.com/rust-lang/rust/issues/62993)
676953fde9 leads to missed optimization described in [this issue](https://github.com/rust-lang/rust/issues/83623)
2021-04-02 00:48:31 +00:00
hi-rustin
aa987c2f57 address comments 2021-04-02 08:08:02 +08:00
bors
d474075a8f Auto merge of #82780 - cjgillot:dep-stream, r=michaelwoerister
Stream the dep-graph to a file instead of storing it in-memory.

This is a reimplementation of #60035.

Instead of storing the dep-graph in-memory, the nodes are encoded as they come
into the a temporary file as they come. At the end of a successful the compilation,
this file is renamed to be the persistent dep-graph, to be decoded during the next
compilation session.

This two-files scheme avoids overwriting the dep-graph on unsuccessful or crashing compilations.

The structure of the file is modified to be the sequence of `(DepNode, Fingerprint, EdgesVec)`.
The deserialization is responsible for going to the more compressed representation.
The `node_count` and `edge_count` are stored in the last 16 bytes of the file,
in order to accurately reserve capacity for the vectors.

At the end of the compilation, the encoder is flushed and dropped.
The graph is not usable after this point: any creation of a node will ICE.

I had to retrofit the debugging options, which is not really pretty.
2021-04-01 16:29:33 +00:00
AngelicosPhosphoros
4464cc2256 Simplify logical operations CFG
This is basically same commit as e38e954a0d which was reverted later in 676953fde9
In both cases, this changes weren't benchmarked.
e38e954a0d leads to missed optimization described in [this issue](https://github.com/rust-lang/rust/issues/62993)
676953fde9 leads to missed optimization described in [this issue](https://github.com/rust-lang/rust/issues/83623)

Also it changes some src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump* files automatically.
2021-04-01 18:34:11 +03:00
hi-rustin
2c66e15468 add OR_PATTERNS_BACK_COMPAT lint
test: add more cases

test: add comments

refine msg
2021-04-01 23:14:14 +08:00
Oli Scherer
c6676db7ae Some more fine-grained forced inlining 2021-04-01 10:40:50 +00:00
Oli Scherer
d81f5ab100 Inline some functions that suddenly show up more in traces 2021-04-01 09:22:12 +00:00
bors
49e1ec0995 Auto merge of #83736 - JohnTitor:fix-unsafe_block_in_unsafe_fn-stabilized-version, r=jyn514
Fix the `unsafe_block_in_unsafe_fn`s stabilized version

Fixes #83735
2021-04-01 05:34:54 +00:00
Yuki Okushi
fe9c4fbb9e Fix the unsafe_block_in_unsafe_fns stabilized version 2021-04-01 10:56:51 +09:00
Dylan DPC
1ef52ac5f5
Rollup merge of #83711 - JohnTitor:more-friendly-unknown-target-error, r=davidtwco
Clarify `--print target-list` is a rustc's option

Fixes #68238
2021-04-01 02:41:47 +02:00
JohnTitor
82c6709d6f Clarify --print target-list is a rustc's option 2021-04-01 01:59:50 +09:00
Camille GILLOT
f3dde45d2a Enable debugging the dep-graph without debug-assertions.
It may also be useful in these cases,
and some CI configurations test without debug assertions.
2021-03-31 17:12:06 +02:00
Jack Huey
7108918db6 Cleanups and comments 2021-03-31 10:16:37 -04:00
Jack Huey
0c98dc66fd Fix tests and AstConv -> dyn AstConv 2021-03-31 10:16:37 -04:00
Jack Huey
4ff65ec782 Fmt and test revert 2021-03-31 10:16:37 -04:00
Jack Huey
8ad7e5685e Fix new problem from rebase and a little cleanup 2021-03-31 10:16:37 -04:00
Jack Huey
6d5efa9f04 Add var to BoundRegion. Add query to get bound vars for applicable items. 2021-03-31 10:16:37 -04:00
Jack Huey
666859a6f8 Make late and late_anon regions track the bound var position 2021-03-31 10:15:56 -04:00
Jack Huey
84f82d348c Revert explicit lifetimes 2021-03-31 10:15:56 -04:00
Jack Huey
30187c81f6 Track bound vars 2021-03-31 10:15:27 -04:00
Jack Huey
62a49c3bb8 Add tcx lifetime to Binder 2021-03-31 10:13:57 -04:00
Jack Huey
74851f4cf3 count bound vars 2021-03-31 10:11:47 -04:00
Jack Huey
97a22a4f9c Add u32 for bound variables to Binder 2021-03-31 10:05:32 -04:00
Jack Huey
4955d755d3 Some rebinds and dummys 2021-03-31 10:05:32 -04:00
Oli Scherer
d139968d19 bail out early when substituting mir constants that don't need substituting 2021-03-31 10:40:45 +00:00
Oli Scherer
4e8edfb5c2 Forward some layouts to prevent recomputation 2021-03-31 10:40:45 +00:00
Oli Scherer
dbacfbc368 Add a new normalization query just for mir constants 2021-03-31 10:40:42 +00:00
Oli Scherer
c7c39ce6d0 We should never see unevaluated type-level constants after monomorphization unless errors occurred 2021-03-31 09:13:45 +00:00
Oli Scherer
1d56b8a2bc Make unevaluated DefId rendering deterministic 2021-03-31 09:13:45 +00:00
bors
a5029ac0ab Auto merge of #83684 - cjgillot:csp, r=petrochenkov
Remove hir::CrateItem.

The crate span is exactly the crate module's inner span. There is no need to store it twice.
2021-03-31 08:34:40 +00:00
Hameer Abbasi
c3ec0add8b Add allocation information to undefined behaviour errors. 2021-03-31 07:21:08 +00:00
bors
2a32abbcde Auto merge of #83681 - jyn514:blanket-impls-tweaks, r=Aaron1011
rustdoc: Only look at blanket impls in `get_blanket_impls`

The idea here is that all the work in 16156fb278/compiler/rustc_middle/src/ty/trait_def.rs (L172-L186) doesn't matter for `get_blanket_impls` - Rustdoc will already pick up on those blocks when it documents the item.
2021-03-31 05:47:22 +00:00
bors
6ff482bde5 Auto merge of #83666 - Amanieu:instrprof-order, r=tmandry
Run LLVM coverage instrumentation passes before optimization passes

This matches the behavior of Clang and allows us to remove several
hacks which were needed to ensure functions weren't optimized away
before reaching the instrumentation pass.

Fixes #83429

cc `@richkadel`

r? `@tmandry`
2021-03-31 03:20:33 +00:00
Dylan DPC
7d888d100f
Rollup merge of #83654 - JohnTitor:issue-83606, r=estebank
Do not emit a suggestion that causes the E0632 error

Fixes #83606
2021-03-31 01:14:46 +02:00
Camille GILLOT
9d8f833e05 Remove hir::CrateItem. 2021-03-30 20:31:06 +02:00
bors
926ec1cb8b Auto merge of #83639 - osa1:issue83638, r=estebank
Replace tabs in err messages before rendering

This is done in other call sites, but was missing in one place.

Fixes #83638
2021-03-30 17:07:19 +00:00
Joshua Nelson
6f06b761b9 Only look at blanket impls in get_blanket_impls 2021-03-30 12:28:33 -04:00
Camille GILLOT
8ee9322c10 Also profile finishing the encoding. 2021-03-30 18:10:08 +02:00
Camille GILLOT
df24315ddf Adjust profiling. 2021-03-30 18:10:08 +02:00
Camille GILLOT
fe89f3236c Address review. 2021-03-30 18:10:08 +02:00
Camille GILLOT
65a8681a17 Add documentation. 2021-03-30 18:10:07 +02:00
Camille GILLOT
c5c935af92 Simplify tracking the encoder state. 2021-03-30 18:10:07 +02:00