Commit graph

4621 commits

Author SHA1 Message Date
Camille GILLOT
31447f6f08 Fix comment. 2021-03-23 18:11:04 +01:00
Camille GILLOT
1aad7e738e Err if the debugging options are not passed. 2021-03-22 21:31:00 +01:00
Camille GILLOT
219603a958 Only enable assert_dep_graph when query-dep-graph is enabled. 2021-03-22 19:22:06 +01:00
bors
d04c3aa865 Auto merge of #83273 - cjgillot:endecode, r=michaelwoerister
Simplify encoder and decoder

Extracted from https://github.com/rust-lang/rust/pull/83036 and https://github.com/rust-lang/rust/pull/82780.
2021-03-22 12:18:57 +00:00
Dylan DPC
ea5ba76d1c
Rollup merge of #83336 - camelid:tool-mod-ice, r=petrochenkov
Fix ICE with `use clippy:🅰️:b;`

Fixes #83317.
2021-03-22 02:20:32 +01:00
Dylan DPC
85f16fb4bc
Rollup merge of #83329 - camelid:debuginfo-doc-cleanup, r=davidtwco
Cleanup LLVM debuginfo module docs

- Move debuginfo docs from `doc.rs` module to `doc.md` file
- Cleanup LLVM debuginfo module docs
2021-03-22 02:20:31 +01:00
Camelid
bfae41d7b0 Fix ICE with use clippy:🅰️:b; 2021-03-21 14:20:28 -07:00
Nikita Popov
6ac229ca21 Don't compute optimized PointerKind for unoptimized builds
This saves us both the Freeze/Unpin queries, and avoids placing
noalias attributes, which have a compile-time impact on LLVM
even in optnone builds (due to always_inline functions).
2021-03-21 20:54:42 +01:00
Nikita Popov
39ed64399e Enable mutable noalias by default for LLVM 12
We don't have any known noalias bugs for LLVM 12 ... yet.
2021-03-21 20:10:54 +01:00
Nikita Popov
c3f9403f59 Don't consider !Unpin references as noalias
Such structures may contain self-references, in which case the
same location may be accessible through a pointer that is not
based-on the noalias pointer.

This is still grey area as far as language semantics are concerned,
but checking for !Unpin as an indicator for self-referential
sturctures seems like a good approach for the meantime.
2021-03-21 20:10:53 +01:00
Nikita Popov
08c5ffd4a3 Convert -Z mutable-noalias to Optional<bool>
The default value will dependend on the LLVM version in the future,
so don't specify one to start with.
2021-03-21 20:10:53 +01:00
Nikita Popov
dfc4cafe8e Move decision aboute noalias into codegen_llvm
The frontend shouldn't be deciding whether or not to use mutable
noalias attributes, as this is a pure LLVM concern. Only provide
the necessary information and do the actual decision in
codegen_llvm.
2021-03-21 20:10:53 +01:00
Dylan DPC
69f6a195da
Rollup merge of #83327 - tmiasko:visit-lhs, r=davidtwco
Extend comment in `UsedLocals::visit_lhs`
2021-03-21 02:01:40 +01:00
Dylan DPC
eec77d9967
Rollup merge of #83306 - Aaron1011:js-sys-lint, r=petrochenkov
Extend `proc_macro_back_compat` lint to `js-sys`

With this PR, we now lint for all cases where we perform some kind of
proc-macro back-compat hack.

The `js-sys` had an internal fix made to properly handle
`None`-delimited groups, so we need to manually check the version in the
filename. As a result, we no longer apply the back-compat hack to cases
where the version number is missing file the file path. This should not
affect any users of the `crates.io` crate.
2021-03-21 02:01:39 +01:00
Dylan DPC
118aba359b
Rollup merge of #83040 - lcnr:unused-ct-substs, r=oli-obk
extract `ConstKind::Unevaluated` into a struct

r? `@oli-obk`
2021-03-21 02:01:36 +01:00
Dylan DPC
3a113f18f8
Rollup merge of #82707 - BoxyUwU:errooaaar, r=oli-obk
const_evaluatable_checked: Stop eagerly erroring in `is_const_evaluatable`

Fixes #82279

We don't want to be emitting errors inside of is_const_evaluatable because we may call this during selection where it should be able to fail silently

There were two errors being emitted in `is_const_evaluatable`. The one causing the compile error in #82279 was inside the match arm for `FailureKind::MentionsParam` but I moved the other error being emitted too since it made things cleaner imo

The `NotConstEvaluatable` enum \*should\* have a fourth variant for when we fail to evaluate a concrete const, e.g. `0 - 1` but that cant happen until #81339

cc `@oli-obk` `@lcnr`
r? `@nikomatsakis`
2021-03-21 02:01:34 +01:00
Camelid
dc240faed5 Cleanup LLVM debuginfo module docs
* Use Markdown list syntax and unindent a bit to prevent Markdown
  interpreting the nested lists as code blocks
* A few more small typographical cleanups
2021-03-20 14:38:49 -07:00
Camelid
a2e9374048 Move debuginfo docs from doc.rs module to doc.md file
And use `#[doc = include_str!("doc.md")]` in `mod.rs` so the docs are
rendered as if they were inline in the root module.
2021-03-20 14:38:49 -07:00
lcnr
7c9b5b4ce0 update const_eval_resolve 2021-03-20 17:22:24 +01:00
lcnr
43ebac119b extract ConstKind::Unevaluated into a struct 2021-03-20 17:21:44 +01:00
bors
61edfd591c Auto merge of #83314 - Aaron1011:print-unstable-value, r=lcnr
Debug-print result when an unstable fingerprint is detected

Helps with issues like #83311

I had previously tried to do this in https://github.com/rust-lang/rust/pull/80692, but it had a significant performance impact (even though the code was never actually run). Hopefully, this will be better now that https://github.com/rust-lang/rust/pull/79100 has been merged.
2021-03-20 16:20:21 +00:00
bors
41b315a470 Auto merge of #83271 - SparrowLii:simd_neg, r=Amanieu
Add simd_neg platform intrinsic

Stdarch needs to add simd_neg to support the implementation of vneg neon instructions. Look [here](https://github.com/rust-lang/stdarch/pull/1087)
2021-03-20 09:01:35 +00:00
bors
eb9ec31168 Auto merge of #82919 - bstrie:stabchar, r=dtolnay
Stabilize `assoc_char_funcs` and `assoc_char_consts`

Stabilizes the following associated items on `char`:

* [`char::MAX`](https://doc.rust-lang.org/std/primitive.char.html#associatedconstant.MAX)
* [`char::REPLACEMENT_CHARACTER`](https://doc.rust-lang.org/std/primitive.char.html#associatedconstant.REPLACEMENT_CHARACTER)
* [`char::UNICODE_VERSION`](https://doc.rust-lang.org/std/primitive.char.html#associatedconstant.UNICODE_VERSION)
* [`char::decode_utf16`](https://doc.rust-lang.org/std/primitive.char.html#method.decode_utf16)
* [`char::from_u32`](https://doc.rust-lang.org/std/primitive.char.html#method.from_u32)
* [`char::from_u32_unchecked`](https://doc.rust-lang.org/std/primitive.char.html#method.from_u32_unchecked)
* [`char::from_digit`](https://doc.rust-lang.org/std/primitive.char.html#method.from_digit)

Closes #71763.
2021-03-20 06:36:42 +00:00
bors
cd82e451a8 Auto merge of #83293 - osa1:82436_perf, r=varkor
Revert performance-sensitive change in #82436

This change was done in #82436, as an "optimization". Unfortunately I
missed that this code is not always executed, because of the "continue"
in the conditional above it.

This commit should solve the perf regressions introduced by #82436 as I
think there isn't anything else that could affect runtime performance in
that PR. The `Pick` type grows only one word, which I doubt can cause up
to 8.8% increase in RSS in some of the benchmarks.

---

Could someone with the rights start a perf job please?
2021-03-20 03:49:10 +00:00
bstrie
567f0e1a39
Stabilize assoc_char_funcs and assoc_char_consts 2021-03-19 20:35:08 -07:00
Aaron Hill
443cef5618
Debug-print result when an unstable fingerprint is detected 2021-03-19 21:47:57 -04:00
Tomasz Miąsko
43cadc99b7 Extend comment in UsedLocals::visit_lhs 2021-03-20 00:00:00 +00:00
Dylan DPC
51a29cbb23
Rollup merge of #83297 - oli-obk:why_bug_today_if_you_can_delay_to_tomorrow, r=petrochenkov
Do not ICE on ty::Error as an error must already have been reported

fixes #83253
2021-03-19 23:01:42 +01:00
Dylan DPC
90e52a1ad2
Rollup merge of #83277 - spastorino:early_otherwise-opt-unsound, r=oli-obk
Mark early otherwise optimization unsound

r? `@oli-obk`
cc `@tmiasko`

Related to #78496 and #82905

Should I also bump this one to level 3 or 4 or given that is unsound it doesn't matter?.
Probably need to adjust some tests.
2021-03-19 23:01:40 +01:00
Aaron Hill
f6a35d7df2
Extend proc_macro_back_compat lint to js-sys
With this PR, we now lint for all cases where we perform some kind of
proc-macro back-compat hack.

The `js-sys` had an internal fix made to properly handle
`None`-delimited groups, so we need to manually check the version in the
filename. As a result, we no longer apply the back-compat hack to cases
where the version number is missing file the file path. This should not
affect any users of the `crates.io` crate.
2021-03-19 14:40:20 -04:00
Camille GILLOT
11b3409b5d Remove FingerprintEncoder/Decoder. 2021-03-19 19:36:05 +01:00
Camille GILLOT
09a638820e Move raw bytes handling to Encoder/Decoder. 2021-03-19 19:35:22 +01:00
bors
cebc8fef5f Auto merge of #82951 - sexxi-goose:wr-mir-replace-methods2, r=nikomatsakis
Replace closures_captures and upvar_capture with closure_min_captures

Removed all uses of closures_captures and upvar_capture and refactored code to work with closure_min_captures. This also involved removing functions that were no longer needed like the bridge.

Closes https://github.com/rust-lang/project-rfc-2229/issues/18
r? `@nikomatsakis`
2021-03-19 18:23:44 +00:00
Dylan DPC
23128c4183
Rollup merge of #83236 - cjgillot:memmap, r=joshtriplett
Upgrade memmap to memmap2

memmap is no longer maintained. memmap2 is a fork that is still maintained. https://rustsec.org/advisories/RUSTSEC-2020-0077.html

The remaining use of memmap is through measureme.
2021-03-19 15:03:28 +01:00
Dylan DPC
827ad66801
Rollup merge of #83230 - jyn514:remove-macros, r=joshtriplett
Remove unnecessary `forward_inner_docs` hack

and replace it with `extended_key_value_attributes` feature.

This is https://github.com/rust-lang/rust/pull/79150, but for compiler/.
2021-03-19 15:03:27 +01:00
Dylan DPC
37b7031078
Rollup merge of #83197 - jyn514:cfg-test-dead-code, r=joshtriplett
Move some test-only code to test files

Split out from https://github.com/rust-lang/rust/pull/83185.
2021-03-19 15:03:24 +01:00
Dylan DPC
75571a5ac0
Rollup merge of #83179 - Aaron1011:actix-web-lint, r=petrochenkov
Extend `proc_macro_back_compat` lint to `actix-web`

Unlike the other cases of this lint, there's no simple way to detect if
an old version of the relevant crate (`syn`) is in use. The `actix-web`
crate only depends on `pin-project` v1.0.0, so checking the version of
`actix-web` does not guarantee that a new enough version of
`pin-project` (and therefore `syn`) is in use.

Instead, we rely on the fact that virtually all of the regressed crates
are pinned to a pre-1.0 version of `pin-project`. When this is the case,
bumping the `actix-web` dependency will pull in the *latest* version of
`pin-project`, which has an explicit dependency on a newer v dependency
on a newer version of `syn`.

The lint message tells users to update `actix-web`, since that's what
they're most likely to have control over. We could potentially tell them
to run `cargo update -p syn`, but I think it's more straightforward to
suggest an explicit change to the `Cargo.toml`

The `actori-web` fork had its last commit over a year ago, and appears
to just be a renamed fork of `actix-web`. Therefore, I've removed the
`actori-web` check entirely - any crates that actually get broken can
simply update `syn` themselves.
2021-03-19 15:03:23 +01:00
Dylan DPC
61372e1af6
Rollup merge of #82846 - GuillaumeGomez:doc-alias-list, r=jyn514
rustdoc: allow list syntax for #[doc(alias)] attributes

Fixes https://github.com/rust-lang/rust/issues/81205.

It now allows to have:

```rust
#[doc(alias = "x")]
// and:
#[doc(alias("y", "z"))]
```

cc ``@jplatte``
r? ``@jyn514``
2021-03-19 15:03:21 +01:00
Dylan DPC
29609711a5
Rollup merge of #82759 - m-ou-se:remove-unwrap-none, r=petrochenkov
Remove unwrap_none/expect_none from compiler/.

We're not going to stabilize `Option::{unwrap_none, expect_none}`. (See https://github.com/rust-lang/rust/issues/62633.) This removes the usage of those unstable methods from `compiler/`.
2021-03-19 15:03:20 +01:00
Oli Scherer
430c0d1d95 Do not ICE on ty::Error as an error must already have been reported 2021-03-19 11:46:27 +00:00
Ömer Sinan Ağacan
f9257576db Revert performance-sensitive change in #82436
This change was done in #82436, as an "optimization". Unfortunately I
missed that this code is not always executed, because of the "continue"
in the conditional above it.

This commit should solve the perf regressions introduced by #82436 as I
think there isn't anything else that could affect runtime performance in
that PR. The `Pick` type grows only one word, which I doubt can cause up
to 8.8% increase in RSS in some of the benchmarks.
2021-03-19 11:37:52 +03:00
Aman Arora
88db752e57 Hash hir_owner in typeck results 2021-03-19 00:39:39 -04:00
Jennifer Wills
52dba13e41 Replace closures_captures and upvar_capture with closure_min_captures
make changes to liveness to use closure_min_captures

use different span

borrow check uses new structures

rename to CapturedPlace

stop using upvar_capture in regionck

remove the bridge

cleanup from rebase + remove the upvar_capture reference from mutability_errors.rs

remove line from livenes test

make our unused var checking more consistent

update tests

adding more warnings to the tests

move is_ancestor_or_same_capture to rustc_middle/ty

update names to reflect the closures

add FIXME

check that all captures are immutable borrows before returning

add surrounding if statement like the original

move var out of the loop and rename

Co-authored-by: Logan Mosier <logmosier@gmail.com>
Co-authored-by: Roxane Fruytier <roxane.fruytier@hotmail.com>
2021-03-18 20:45:49 -04:00
Santiago Pastorino
778e1978d5
Mark early otherwise optimization unsound 2021-03-18 20:57:44 -03:00
SparrowLii
b93590e5d8 correct macro names 2021-03-19 03:47:13 +08:00
Camille GILLOT
e5d09fbbe9 Simplify IntEncodedWithFixedSize. 2021-03-18 20:09:00 +01:00
Camille GILLOT
5003b3dc31 Move IntEncodedWithFixedSize to rustc_serialize. 2021-03-18 20:09:00 +01:00
SparrowLii
0fa158b38f Add simd_neg platform intrinsic 2021-03-19 02:16:21 +08:00
Camille GILLOT
458d044c5b Upgrade memmap to memmap2 in other crates. 2021-03-18 18:36:55 +01:00
Aaron Hill
390d1ef6d0
Extend proc_macro_back_compat lint to actix-web
Unlike the other cases of this lint, there's no simple way to detect if
an old version of the relevant crate (`syn`) is in use. The `actix-web`
crate only depends on `pin-project` v1.0.0, so checking the version of
`actix-web` does not guarantee that a new enough version of
`pin-project` (and therefore `syn`) is in use.

Instead, we rely on the fact that virtually all of the regressed crates
are pinned to a pre-1.0 version of `pin-project`. When this is the case,
bumping the `actix-web` dependency will pull in the *latest* version of
`pin-project`, which has an explicit dependency on a newer v dependency
on a newer version of `syn`.

The lint message tells users to update `actix-web`, since that's what
they're most likely to have control over. We could potentially tell them
to run `cargo update -p syn`, but I think it's more straightforward to
suggest an explicit change to the `Cargo.toml`

The `actori-web` fork had its last commit over a year ago, and appears
to just be a renamed fork of `actix-web`. Therefore, I've removed the
`actori-web` check entirely - any crates that actually get broken can
simply update `syn` themselves.
2021-03-18 12:09:14 -04:00