Commit graph

4923 commits

Author SHA1 Message Date
Mark Rousskov
b3a4f91b8d Bump cfgs 2021-04-04 14:57:05 -04:00
Dylan DPC
a89eab9bca
Rollup merge of #83521 - sexxi-goose:quick-diagnostic-fix, r=nikomatsakis
2229: Fix diagnostic issue when using FakeReads in closures

This PR fixes a diagnostic issue caused by https://github.com/rust-lang/rust/pull/82536. A temporary work around was used in this merged PR which involved feature gating the addition of FakeReads introduced as a result of pattern matching in closures.

The fix involves adding an optional closure DefId to ForLet and ForMatchedPlace FakeReadCauses. This DefId will only be added if a closure pattern matches a Place starting with an Upvar.

r? ```@nikomatsakis```
2021-04-04 19:20:01 +02:00
Dylan DPC
a1c34493d4
Rollup merge of #73945 - est31:unused_externs, r=Mark-Simulacrum
Add an unstable --json=unused-externs flag to print unused externs

This adds an unstable flag to print a list of the extern names not used by cargo.

This PR will enable cargo to collect unused dependencies from all units and provide warnings.
The companion PR to cargo is: https://github.com/rust-lang/cargo/pull/8437

The goal is eventual stabilization of this flag in rustc as well as in cargo.

Discussion of this feature is mostly contained inside these threads: #57274 #72342 #72603

The feature builds upon the internal datastructures added by #72342

Externs are uniquely identified by name and the information is sufficient for cargo.
If the mode is enabled, rustc will print json messages like:

```
{"unused_extern_names":["byteorder","openssl","webpki"]}
```

For a crate that got passed byteorder, openssl and webpki dependencies but needed none of them.

### Q: Why not pass -Wunused-crate-dependencies?
A: See [ehuss's comment here](https://github.com/rust-lang/rust/issues/57274#issuecomment-624839355)
   TLDR: it's cleaner. Rust's warning system wasn't built to be filtered or edited by cargo.
   Even a basic implementation of the feature would have to change the "n warnings emitted" line that rustc prints at the end.
   Cargo ideally wants to synthesize its own warnings anyways. For example, it would be hard for rustc to emit warnings like
   "dependency foo is only used by dev targets", suggesting to make it a dev-dependency instead.

### Q: Make rustc emit used or unused externs?
A: Emitting used externs has the advantage that it simplifies cargo's collection job.
   However, emitting unused externs creates less data to be communicated between rustc and cargo.
   Often you want to paste a cargo command obtained from `cargo build -vv` for doing something
   completely unrelated. The message is emitted always, even if no warning or error is emitted.
   At that point, even this tiny difference in "noise" matters. That's why I went with emitting unused externs.

### Q: One json msg per extern or a collective json msg?
A: Same as above, the data format should be concise. Having 30 lines for the 30 crates a crate uses would be disturbing to readers.
   Also it helps the cargo implementation to know that there aren't more unused deps coming.

### Q: Why use names of externs instead of e.g. paths?
A: Names are both sufficient as well as neccessary to uniquely identify a passed `--extern` arg.
   Names are sufficient because you *must* pass a name when passing an `--extern` arg.
   Passing a path is optional on the other hand so rustc might also figure out a crate's location from the file system.
   You can also put multiple paths for the same extern name, via e.g. `--extern hello=/usr/lib/hello.rmeta --extern hello=/usr/local/lib/hello.rmeta`,
   but rustc will only ever use one of those paths.
   Also, paths don't identify a dependency uniquely as it is possible to have multiple different extern names point to the same path.
   So paths are ill-suited for identification.

### Q: What about 2015 edition crates?
A: They are fully supported.
   Even on the 2015 edition, an explicit `--extern` flag is is required to enable `extern crate foo;` to work (outside of sysroot crates, which this flag doesn't warn about anyways).
   So the lint would still fire on 2015 edition crates if you haven't included a dependency specified in Cargo.toml using `extern crate foo;` or similar.
   The lint won't fire if your sole use in the crate is through a `extern crate foo;`   statement, but that's not its job.
   For detecting unused `extern crate foo` statements, there is the `unused_extern_crates` lint
   which can be enabled by `#![warn(unused_extern_crates)]` or similar.

cc ```@jsgf``` ```@ehuss``` ```@petrochenkov``` ```@estebank```
2021-04-04 19:19:58 +02:00
Gus Caplan
da66a31572
wasm64 2021-04-04 11:29:34 -05:00
Vadim Petrochenkov
b96584485a resolve: Stable order for derive helper attributes 2021-04-04 17:51:41 +03:00
Vadim Petrochenkov
fbf1bec482 resolve/expand: Cache intermediate results of #[derive] expansion 2021-04-04 17:51:41 +03:00
bors
b1ea2618d3 Auto merge of #83839 - ldm0:deref, r=petrochenkov
Remove unneeded type resolving

small optimization.
2021-04-04 11:15:17 +00:00
Amanieu d'Antras
ddc53f809b Allow clobbering unsupported registers in asm!
Previously registers could only be marked as clobbered if the target feature for that register was enabled. This restriction is now removed.
2021-04-04 10:42:32 +01:00
bors
2616ab1c57 Auto merge of #83811 - JohnTitor:rollup-hnw1xwz, r=JohnTitor
Rollup of 7 pull requests

Successful merges:

 - #82487 (Constify methods of `std::net::SocketAddr`, `SocketAddrV4` and `SocketAddrV6`)
 - #83756 (rustdoc: Rename internal uses of `spotlight`)
 - #83780 (Document "standard" conventions for error messages)
 - #83787 (Monomorphization doc fix)
 - #83803 (add fp-armv8 for ARM_ALLOWED_FEATURES)
 - #83804 (Remove nightly features in rustc_type_ir)
 - #83810 (Fix rustc_lint_defs documentation typo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-04-03 23:17:58 +00:00
Yuki Okushi
81f00c98a6 Trigger unused_doc_comments on macros at once 2021-04-04 05:06:51 +09:00
Vadim Petrochenkov
5839bff0ba Remove attribute #[link_args] 2021-04-03 21:25:53 +03:00
liudingming
3982ac2249 Optimize out unneeded type resolving 2021-04-04 01:40:47 +08:00
Vadim Petrochenkov
cd22425990 expand: Do not ICE when a legacy AST-based macro attribute produces and empty expression 2021-04-03 19:42:09 +03:00
liudingming
8eed8ed967 Move log's short part to first 2021-04-04 00:05:17 +08:00
Yuki Okushi
b2daca745d
Rollup merge of #83810 - benmezger:update-builtin-docs-typo, r=jonas-schievink
Fix rustc_lint_defs documentation typo

Found a typo while reading the documentation. This PR fixes it.
2021-04-04 00:19:41 +09:00
Yuki Okushi
d636b0aa6e
Rollup merge of #83804 - detrumi:build-type-ir-on-stable, r=petrochenkov
Remove nightly features in rustc_type_ir

`rustc_type_ir` will be used as a type library by Chalk, which we want to be able to build on stable, so this PR removes the current nightly features used.
2021-04-04 00:19:40 +09:00
Yuki Okushi
d0266e3c1b
Rollup merge of #83803 - surechen:add_target_feature, r=petrochenkov
add fp-armv8 for ARM_ALLOWED_FEATURES

For fixing err in https://github.com/rust-lang/stdarch/pull/1105.
2021-04-04 00:19:39 +09:00
Yuki Okushi
6a436aaabf
Rollup merge of #83787 - digama0:patch-1, r=bjorn3
Monomorphization doc fix

Only public items are monomorphization roots. This can be confirmed by noting that this program compiles:
```rust
fn foo<T>() { if true { foo::<Option<T>>() } }
fn bar() { foo::<()>() }
```
See also the [zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Why.20are.20non.20public.20items.20monomorphization.20roots.3F).
2021-04-04 00:19:38 +09:00
Ben Mezger
7b05cffa18 Fix rustc_lint_defs documentation typo 2021-04-03 12:00:28 -03:00
bors
97717a5618 Auto merge of #83682 - bjorn3:mmap_wrapper, r=cjgillot
Add an Mmap wrapper to rustc_data_structures

This wrapper implements StableAddress and falls back to directly reading the file on wasm32.

Taken from #83640, which I will close due to the perf regression.
2021-04-03 13:23:42 +00:00
bjorn3
bda6d1f158 Add safety comment to StableAddress impl for Mmap 2021-04-03 14:51:05 +02:00
Wilco Kusee
3ea7c90a94 Add fixme comment to revert change once const_panic is stable 2021-04-03 13:07:03 +02:00
Wilco Kusee
3cfa0a0dff Remove nightly features in rustc_type_ir 2021-04-03 10:00:09 +02:00
surechen
944b53eb75 add fp-armv8 for ARM_ALLOWED_FEATURES 2021-04-03 15:50:59 +08:00
bors
836c317426 Auto merge of #83774 - richkadel:zero-based-counters, r=tmandry
Translate counters from Rust 1-based to LLVM 0-based counter ids

A colleague contacted me and asked why Rust's counters start at 1, when
Clangs appear to start at 0. There is a reason why Rust's internal
counters start at 1 (see the docs), and I tried to keep them consistent
when codegenned to LLVM's coverage mapping format. LLVM should be
tolerant of missing counters, but as my colleague pointed out,
`llvm-cov` will silently fail to generate a coverage report for a
function based on LLVM's assumption that the counters are 0-based.

See:
https://github.com/llvm/llvm-project/blob/main/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp#L170

Apparently, if, for example, a function has no branches, it would have
exactly 1 counter. `CounterValues.size()` would be 1, and (with the
1-based index), the counter ID would be 1. This would fail the check
and abort reporting coverage for the function.

It turns out that by correcting for this during coverage map generation,
by subtracting 1 from the Rust Counter ID (both when generating the
counter increment intrinsic call, and when adding counters to the map),
some uncovered functions (including in tests) now appear covered! This
corrects the coverage for a few tests!

r? `@tmandry`
FYI: `@wesleywiser`
2021-04-03 06:27:03 +00:00
bors
cb17136405 Auto merge of #83599 - jyn514:unorderable, r=Aaron1011
Avoid sorting by DefId for `necessary_variants()`

Follow-up to https://github.com/rust-lang/rust/pull/83074. Originally I tried removing `impl Ord for DefId` but that hit *lots* of errors 😅 so I thought I would start with easy things.

I am not sure whether this could actually cause invalid query results, but this is used from `MarkSymbolVisitor::visit_arm` so it's at least feasible.

r? `@Aaron1011`
2021-04-03 04:11:35 +00:00
Rich Kadel
7ceff6835a Translate counters from Rust 1-based to LLVM 0-based counter ids
A colleague contacted me and asked why Rust's counters start at 1, when
Clangs appear to start at 0. There is a reason why Rust's internal
counters start at 1 (see the docs), and I tried to keep them consistent
when codegenned to LLVM's coverage mapping format. LLVM should be
tolerant of missing counters, but as my colleague pointed out,
`llvm-cov` will silently fail to generate a coverage report for a
function based on LLVM's assumption that the counters are 0-based.

See:
https://github.com/llvm/llvm-project/blob/main/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp#L170

Apparently, if, for example, a function has no branches, it would have
exactly 1 counter. `CounterValues.size()` would be 1, and (with the
1-based index), the counter ID would be 1. This would fail the check
and abort reporting coverage for the function.

It turns out that by correcting for this during coverage map generation,
by subtracting 1 from the Rust Counter ID (both when generating the
counter increment intrinsic call, and when adding counters to the map),
some uncovered functions (including in tests) now appear covered! This
corrects the coverage for a few tests!
2021-04-02 17:16:36 -07:00
bors
9b6c9b638e Auto merge of #81866 - nagisa:nagisa/sanitizer-support-target-prop, r=tmiasko
Maintain supported sanitizers as a target property

In an effort to remove a hard-coded allow-list for target-sanitizer support correspondence, this PR moves the configuration to the target options.

Perhaps the one notable change made in this PR is this doc-comment:

```rust
    /// The sanitizers supported by this target
    ///
    /// Note that the support here is at a codegen level. If the machine code with sanitizer
    /// enabled can generated on this target, but the necessary supporting libraries are not
    /// distributed with the target, the sanitizer should still appear in this list for the target.
```

Previously the target would typically be added to the allow-list at the same time as the supporting runtime libraries are shipped for the target. However whether we ship the runtime libraries or not needn't be baked into the compiler; and if we don't users will receive a significantly more directed error about library not being found.

Fixes #81802
2021-04-02 23:33:01 +00:00
Roxane
0a97eee8df Reduce size of statements 2021-04-02 19:11:50 -04:00
Roxane
2fb1fb7634 Fix diagnostic issue when using FakeReads in closures 2021-04-02 19:11:50 -04:00
Simonas Kazlauskas
41875c82c7 rm target specific logic in link_sanitizer_runtime 2021-04-03 00:37:49 +03:00
Simonas Kazlauskas
a3c0f0a3df (De-)serialize the supported_sanitizers 2021-04-03 00:37:49 +03:00
Simonas Kazlauskas
16c1d0ae06 Maintain supported sanitizers as a target property
This commit adds an additional target property – `supported_sanitizers`,
and replaces the hardcoded allowlists in argument parsing to use this
new property.

Fixes #81802
2021-04-03 00:37:49 +03:00
Simonas Kazlauskas
64af7eae1e Move SanitizerSet to rustc_target 2021-04-03 00:37:49 +03:00
Simonas Kazlauskas
2f000a78bf Manually set dso_local when its valid to do so
This should have no real effect in most cases, as e.g. `hidden`
visibility already implies `dso_local` (or at least LLVM IR does not
preserve the `dso_local` setting if the item is already `hidden`), but
it should fix `-Crelocation-model=static` and improve codegen in
executables.

Note that this PR does not exhaustively port the logic in [clang]. Only
the obviously correct portion and what is necessary to fix a regression
from LLVM 12 that relates to `-Crelocation_model=static`.

Fixes #83335

[clang]: 3001d080c8/clang/lib/CodeGen/CodeGenModule.cpp (L945-L1039)
2021-04-03 00:00:29 +03:00
bors
138fd56cf9 Auto merge of #83790 - Dylan-DPC:rollup-p6ep8jo, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #83065 (Rework `std::sys::windows::alloc`)
 - #83478 (rustdoc: Add unstable option to only emit shared/crate-specific files)
 - #83629 (Fix double-drop in `Vec::from_iter(vec.into_iter())` specialization when items drop during panic)
 - #83673 (give full path of constraint in suggest_constraining_type_param)
 - #83755 (Simplify coverage tests)
 - #83757 (2229: Support migration via rustfix)
 - #83771 (Fix stack overflow detection on FreeBSD 11.1+)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-04-02 20:06:11 +00:00
Dylan DPC
eed73c6e4d
Rollup merge of #83757 - sexxi-goose:migrations_out, r=nikomatsakis
2229: Support migration via rustfix

- Adds support of machine applicable suggestions for `disjoint_capture_drop_reorder`.
- Doesn't migrate in the case of pre-existing bugs in user code

r? ``@nikomatsakis``
2021-04-02 19:57:34 +02:00
Dylan DPC
6cb74ad99f
Rollup merge of #83673 - hi-rustin:rustin-patch-suggestion, r=estebank
give full path of constraint in suggest_constraining_type_param

close https://github.com/rust-lang/rust/issues/83513
2021-04-02 19:57:32 +02:00
LeSeulArtichaut
fb7cf0982b Don't suggest dereferencing an else if expression 2021-04-02 19:50:06 +02: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
Mario Carneiro
99f3e889b1
fix 2021-04-02 10:21:23 -07:00
Mario Carneiro
e01c3b8211
clarify wording 2021-04-02 09:55:23 -07:00
Mario Carneiro
3166e0857d
Monomorphization doc fix
Only public items are monomorphization roots. This can be confirmed by noting that this program compiles:
```rust
fn foo<T>() { if true { foo::<Option<T>>() } }
fn bar() { foo::<()>() }
```
2021-04-02 09:33:34 -07: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
mibac138
e603f994b1 Address review comments
Co-authored-by: Léo Lanteri Thauvin <leseulartichaut@gmail.com>
2021-04-02 12:42:46 +02:00
mibac138
98ad0af60b Properly suggest deref in else block 2021-04-02 12:42:44 +02: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
Aman Arora
1b9620d75f Make the diagnostic message more readable 2021-04-01 21:33:11 -04:00
Aman Arora
a721957a3d Don't introduce a block if a block exists 2021-04-01 21:08:04 -04: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
Aman Arora
18af989c06 Update lint message 2021-04-01 16:49:31 -04: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
Yuki Okushi
b5782bad74 Catch a bad placeholder type error for statics in externs 2021-04-01 10:45:42 +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
b-naber
3194b26ab0 prevent very long compilation runtimes in LateBoundRegionNameCollector 2021-03-31 23:28:01 +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
Aman Arora
e78fac5601 Handle the case of partially captured drop type 2021-03-31 04:40:31 -04: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
bjorn3
5773e51678 Inline a few methods 2021-03-31 09:19:29 +02: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
hi-rustin
8f77356249 give full path of constraint in suggest_constraining_type_param
revert file

bless with nll mode
2021-03-31 09:47:31 +08: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
bjorn3
8331dbe6d0 Add an Mmap wrapper to rustc_data_structures
This wrapper implements StableAddress and falls back to directly reading
the file on wasm32
2021-03-30 18:57:03 +02: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