Commit graph

125928 commits

Author SHA1 Message Date
Valerii Lashmanov
507dd1d918 Intorduced MiniMap - a tiny small storage optimized map implementation
This makes everything about 1% faster in rustc-perf,
mostly negating performance hit of previous commit.
2020-10-03 10:38:58 -04:00
Valerii Lashmanov
87022d00b2 Better handling for exponential-sized types in misc places
Mostly to fix ui/issues/issue-37311-type-length-limit/issue-37311.rs.

Most parts of the compiler can handle deeply nested types with a lot
of duplicates just fine, but some parts still attempt to naively
traverse type tree.

Before such problems were caught by type length limit check,
but now these places will have to be changed to handle
duplicated types gracefully.
2020-10-03 10:38:58 -04:00
Valerii Lashmanov
7c4c96c095 Only visit types once when walking the type tree
This fixes #72408.

Nested closures were resulting in exponential compilation time.

As a performance optimization this change introduces MiniSet,
which is a simple small storage optimized set.
2020-10-03 10:12:00 -04:00
bors
6d3dc317a8 Auto merge of #77456 - Mark-Simulacrum:revert-76605, r=pietroalbini
[beta] Revert "Promote missing_fragment_specifier to hard error #75516"

This reverts "Promote missing_fragment_specifier to hard error #75516" on just beta. I would like us to explore a more principled fix, perhaps along the lines `@petrochenkov` suggested in #76605, on master when we have more time to test it but I don't want us shipping the breakage in the meantime. I don't personally feel comfortable immediately backporting anything more than a revert here.

cc `@matklad`
2020-10-03 05:15:46 +00:00
Mark Rousskov
2b214e6bb7 Revert "Remove broken clap versions from cargotest"
This reverts commit eb4d6b520b.
2020-10-02 11:43:29 -04:00
Mark Rousskov
e846a863ac Revert "Remove missing_fragment_specifier lint"
This reverts commit 5ba961018c.
2020-10-02 11:43:28 -04:00
Mark Rousskov
ab80426df0 Revert "Promote missing_fragment_specifier to hard error"
This reverts commit 02eae432e7.
2020-10-02 11:43:26 -04:00
Mark Rousskov
bdc9e15b76 Revert "Move macro test to ui/macros"
This reverts commit 84fcd0dc99.
2020-10-02 11:43:23 -04:00
bors
e28d2bd093 Auto merge of #77403 - flip1995:beta, r=pietroalbini
[beta][clippy] backport multiple FP fixes for a warn-by-default lint

This backports the PR https://github.com/rust-lang/rust-clippy/pull/6016 fixing multiple FPs:

https://github.com/rust-lang/rust-clippy/issues/5902
https://github.com/rust-lang/rust-clippy/issues/5979
https://github.com/rust-lang/rust-clippy/issues/5985

We didn't have any complaints about this lint, since me merged this PR.

cc `@ebroto` (sorry I forgot about this, since we talked about the backport 3 weeks ago 😐)

r? `@pietroalbini`
2020-10-01 20:32:41 +00:00
flip1995
4a9109865c
Merge commit 'd28211ddb6' into beta 2020-10-01 16:48:53 +02:00
flip1995
d28211ddb6
Fix rustup fallout 2020-10-01 16:40:59 +02:00
bors
9f0e6fa94b Auto merge of #77308 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
[beta] backports

This backports the following:
 *  revert const_type_id stabilization #77083
 * [mir-opt] Disable the `ConsideredEqual` logic in SimplifyBranchSame opt #76837
 * Rename Iterator::get_unchecked #77201 (manually, because of file renaming and other issues on master causing literal cherry-pick to fail)
 *  Rebase LLVM onto 11.0.0-rc3 #77063 (bumping direct to master, see https://github.com/rust-lang/rust/pull/77063#issuecomment-700231036).

The last two have not yet been approved by compiler team, but I'm posting this now and going to go ahead and approve as I expect both to get approved and we want testing as much as possible before release in ~2 weeks.

r? `@ghost`
2020-09-29 00:31:57 +00:00
Mark Rousskov
656fa79bf0 Rename Iterator::get_unchecked -> Iterator::__iterator_get_unchecked
Backport of #77201, manually done because of file renaming.
2020-09-28 16:19:08 -04:00
Ashley Mannix
aac490adcc update tracking issue for const_type_id 2020-09-28 15:20:57 -04:00
Ashley Mannix
bf812bd870 revert const_type_id stabilization
This reverts commit e3856616ee.
2020-09-28 15:20:50 -04:00
Wesley Wiser
db5f6df46b [mir-opt] Disable the ConsideredEqual logic in SimplifyBranchSame opt
The logic is currently broken and we need to disable it to fix a beta
regression (see #76803)
2020-09-28 15:20:20 -04:00
Josh Stone
2e91e4d9c3 Rebase LLVM onto 11.0.0-rc3 2020-09-28 15:17:23 -04:00
bors
755064bef6 Auto merge of #76852 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
[beta] backports

* Ignore rustc_private items from std docs #76571
* Fix HashMap visualizers in Visual Studio (Code) #76389
* Account for version number in NtIdent hack #76331
* Account for async functions when suggesting new named lifetime #75867
* Fix loading pretty-printers in rust-lldb script #76015

This also bumps to the released stable compiler.
2020-09-17 22:30:51 +00:00
Mark Rousskov
557e2bc101 Bump to stable release 2020-09-17 16:22:27 -04:00
Esteban Küber
94dc25b5af Account for async functions when suggesting new named lifetime
Fix #75850.
2020-09-17 16:20:12 -04:00
Aaron Hill
169b83ce16 Account for version number in NtIdent hack
Issue #74616 tracks a backwards-compatibility hack for certain macros.
This has is implemented by hard-coding the filenames and macro names of
certain code that we want to continue to compile.

However, the initial implementation of the hack was based on the
directory structure when building the crate from its repository (e.g.
`js-sys/src/lib.rs`). When the crate is build as a dependency, it will
include a version number from the clone from the cargo registry (e.g.
`js-sys-0.3.17/src/lib.rs`), which would fail the check.

This commit modifies the backwards-compatibility hack to check that
desired crate name (`js-sys` or `time-macros-impl`) is a prefix of the
proper part of the path.

See https://github.com/rust-lang/rust/issues/76070#issuecomment-687215646
for more details.
2020-09-17 16:19:40 -04:00
ortem
ed2eb80fff Fix loading pretty-printers in rust-lldb script 2020-09-17 16:18:23 -04:00
MaulingMonkey
02fb8ae0fe Fix HashMap visualizers in Visual Studio (Code)
CDB doesn't care that you're using static_cast between unrelated types.
VS(C) does.  These should've been reinterpret_cast or C casts.
Cast is from e.g. `u8*` to `tuple<$T1, $T2>*`
2020-09-17 16:17:34 -04:00
Lzu Tao
55754204fa Ignore rustc_private items from std docs
Apply suggestions from code review

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-09-17 16:17:00 -04:00
Lzu Tao
cbaf066339 Add ui test for 74672 and 76571
These tests will fall without the next commit.
2020-09-17 16:16:52 -04:00
Takayuki Nakata
730ca457f5
Address items_after_statement 2020-09-10 18:05:04 +02:00
Takayuki Nakata
2972ad3ef6
Refactoring: tests in same_item_push 2020-09-10 18:05:04 +02:00
Takayuki Nakata
14faebe20e
Add some tests to same_item_push
Add tests in which the variable is initialized with a match expression and function call
2020-09-10 18:05:04 +02:00
Takayuki Nakata
b80576fba6
Some refactoring 2020-09-10 18:05:04 +02:00
Takayuki Nakata
0117ea2b01
Refactoring: use inner function 2020-09-10 18:05:04 +02:00
Takayuki Nakata
1778a1ec46
Restrict same_item_push to suppress false positives
It emits a lint when the pushed item is a literal, a constant and an immutable binding that are initialized with those.
2020-09-10 18:05:01 +02:00
bors
aa30bf3442 Auto merge of #76175 - ehuss:update-beta-cargo, r=Mark-Simulacrum
[beta] Update cargo

1 commits in 51b66125ba97d2906f461b3f4e0408f206299bb6..f3c7e066ad66e05439cf8eab165a2de580b41aaf
2020-08-19 20:22:52 +0000 to 2020-08-28 19:37:58 +0000
- [beta] Fix LTO with doctests. (rust-lang/cargo#8658)
2020-09-10 00:10:49 +00:00
Eric Huss
6922feb874 [beta] Update cargo 2020-08-31 10:58:14 -07:00
bors
84b047bf64 Auto merge of #76032 - jyn514:lint-backport, r=Mark-Simulacrum
[beta] Backport fix for swapped stability attributes

This backports the only commit in https://github.com/rust-lang/rust/pull/75953/, fixing one unstable lint which ran on stable and one stable lint which only ran on nightly. This change can be replicated with
```
git fetch origin
git checkout origin/beta
git cherry-pick 29399fad5f
```
2020-08-28 19:03:22 +00:00
Joshua Nelson
adc747e9ee Fix swapped stability attributes
This fixes a regression introduced in
https://github.com/rust-lang/rust/pull/74855.
2020-08-28 12:11:32 -04:00
bors
0f91f5c284 Auto merge of #75921 - pietroalbini:beta-next, r=Mark-Simulacrum
[beta] Prepare beta 1.47.0

Also backported the release notes change.

r? @Mark-Simulacrum
2020-08-25 23:13:44 +00:00
Pietro Albini
0343877fb7
releases: include last-minute compatibility notes for 1.46.0 2020-08-25 23:05:37 +02:00
Pietro Albini
ca26640e7f
this is beta 1.47.0 2020-08-25 23:04:02 +02:00
bors
8ba22504e8 Auto merge of #74275 - wesleywiser:break_up_partitioning_rs, r=pnkfelix
Refactor the partitioning module to make it easier to introduce new algorithms

I've split the `librustc_mir::monomorphize::partitioning` module into a few files and introduced a `Partitioner` trait which allows us to decouple the partitioning algorithm from the code which integrates it into the query system. This should allow us to introduce new partitioning algorithms much more easily. I've also gone ahead and added a `-Z` flag to control which algorithm is used (currently there is only the `default`).

I left a few comments in places where things might be improved further.

r? @pnkfelix cc @rust-lang/wg-incr-comp
2020-08-25 18:52:11 +00:00
bors
ba4c4468f5 Auto merge of #75908 - pietroalbini:ci-bump-llvm, r=Mark-Simulacrum
Bump LLVM on CI to 10.0.0

This PR bumps the LLVM version we use on our macOS and Windows CI to 10.0.0, fixing a breakage we noticed today:

```
2020-08-25T14:24:28.5939568Z FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/AMDGPUMetadata.cpp.obj
2020-08-25T14:24:28.5940317Z D:\a\rust\rust\build\bootstrap\debug\sccache-plus-cl.exe  /nologo -TP -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib\Support -ID:\a\rust\rust\src\llvm-project\llvm\lib\Support -Iinclude -ID:\a\rust\rust\src\llvm-project\llvm\include -nologo -MT -Brepro --target=x86_64-pc-windows-msvc /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /Brepro /W4  -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wno-noexcept-type -Wno-comment /Gw /MT /O2 /Ob2 -UNDEBUG -std:c++14  /EHs-c- /GR- /showIncludes /Folib\Support\CMakeFiles\LLVMSupport.dir\AMDGPUMetadata.cpp.obj /Fdlib\Support\CMakeFiles\LLVMSupport.dir\LLVMSupport.pdb -c D:\a\rust\rust\src\llvm-project\llvm\lib\Support\AMDGPUMetadata.cpp
2020-08-25T14:24:28.5940861Z clang-cl: warning: argument unused during compilation: '-Brepro' [-Wunused-command-line-argument]
2020-08-25T14:24:28.5941076Z clang-cl: warning: argument unused during compilation: '-Brepro' [-Wunused-command-line-argument]
2020-08-25T14:24:28.5941321Z In file included from D:\a\rust\rust\src\llvm-project\llvm\lib\Support\AMDGPUMetadata.cpp:15:
2020-08-25T14:24:28.5941545Z In file included from D:\a\rust\rust\src\llvm-project\llvm\include\llvm/ADT/Twine.h:12:
2020-08-25T14:24:28.5941774Z In file included from D:\a\rust\rust\src\llvm-project\llvm\include\llvm/ADT/SmallVector.h:16:
2020-08-25T14:24:28.5942016Z In file included from D:\a\rust\rust\src\llvm-project\llvm\include\llvm/ADT/iterator_range.h:21:
2020-08-25T14:24:28.5942257Z In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.27.29110\include\iterator:9:
2020-08-25T14:24:28.5942542Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.27.29110\include\yvals_core.h(494,2): error: STL1000: Unexpected compiler version, expected Clang 10.0.0 or newer.
```

I uploaded both the new tarballs to our mirrors bucket.
2020-08-25 15:44:03 +00:00
Pietro Albini
2c011096d2
ci: fix macOS target name for LLVM 10 2020-08-25 17:41:50 +02:00
Pietro Albini
61d4f0e876
ci: bump LLVM source tarball on Linux to 10.0.0 2020-08-25 17:27:43 +02:00
Pietro Albini
951f7576e9
ci: bump prebuilt LLVM on macOS and Windows to 10.0.0 2020-08-25 17:19:41 +02:00
bors
5890563859 Auto merge of #75838 - mati865:profiler-atomics, r=Amanieu
Profiler: reenable atomics after #65214
2020-08-25 11:53:07 +00:00
bors
c35007dbbe Auto merge of #75773 - matklad:snapshot-tests, r=Mark-Simulacrum
Introduce expect snapshot testing library into rustc

Snapshot testing is a technique for writing maintainable unit tests.
Unlike usual `assert_eq!` tests, snapshot tests allow
to *automatically* upgrade expected values on test failure.
In a sense, snapshot tests are inline-version of our beloved
UI-tests.

Example:

![expect](https://user-images.githubusercontent.com/1711539/90888810-3bcc8180-e3b7-11ea-9626-d06e89e1a0bb.gif)

A particular library we use, `expect_test` provides an `expect!`
macro, which creates a sort of self-updating string literal (by using
`file!` macro). Self-update is triggered by setting `UPDATE_EXPECT`
environmental variable (this info is printed during the test failure).
This library was extracted from rust-analyzer, where we use it for
most of our tests.

There are some other, more popular snapshot testing libraries:

* https://github.com/mitsuhiko/insta
* https://github.com/aaronabramov/k9

The main differences of `expect` are:

* first-class snapshot objects (so, tests can be written as functions,
  rather than as macros)
* focus on inline-snapshots (but file snapshots are also supported)
* restricted feature set (only `assert_eq` and `assert_debug_eq`)
* no extra runtime (ie, no `cargo insta`)

See rust-analyzer/rust-analyzer#5101 for a
an extended comparison.

It is unclear if this testing style will stick with rustc in the long
run. At the moment, rustc is mainly tested via integrated UI tests.
But in the library-ified world, unit-tests will become somewhat more
important (that's why use use `rustc_lexer` library-ified library as
an example in this PR). Given that the cost of removal shouldn't be
too high, it probably makes sense to just see if this flies!
2020-08-25 09:36:23 +00:00
bors
3d6a3ed158 Auto merge of #75364 - rylev:libpanic-abort-failfast, r=alexcrichton
Call into fastfail on abort in libpanic_abort on Windows x86(_64)

This partially resolves #73215 though this is only for x86 targets. This code is directly lifted from [libstd](13290e83a6/library/std/src/sys/windows/mod.rs (L315)). `__fastfail` is the preferred way to abort a process on Windows as it will hook into debugger toolchains.

Other platforms expose a `_rust_abort` symbol which wraps `std::sys::abort_internal`. This would also work on Windows, but is a slightly largely change as we'd need to make sure that the symbol is properly exposed to the linker. I'm inlining the call to the `__fastfail`, but the indirection through `rust_abort` might be a cleaner approach.

 A different instruction must be used on ARM architectures. I'd like to verify this works first before tackling ARM.
2020-08-25 07:36:52 +00:00
bors
c30341ddec Auto merge of #75132 - scottmcm:stabilize-range-is-empty, r=dtolnay
Stabilize Range[Inclusive]::is_empty

I would like to propose these two simple methods for stabilization:
- Knowing that a range is exhausted isn't otherwise trivial
- Clippy would like to suggest them, but had to do extra work to disable that path <https://github.com/rust-lang/rust-clippy/issues/3807> because they're unstable
- These work on `PartialOrd`, consistently with the stable `contains` method, and are thus more general than iterator-based approaches that need `Step`
- They've been unchanged for some time, and have picked up uses in the compiler
- Stabilizing them doesn't block any future iterator-based `is_empty` plans, as these inherent ones are preferred in name resolution

https://doc.rust-lang.org/nightly/std/ops/struct.Range.html#method.is_empty
https://doc.rust-lang.org/nightly/std/ops/struct.RangeInclusive.html#method.is_empty

Closes #48111
2020-08-25 05:24:30 +00:00
bors
ee541284bf Auto merge of #75764 - workingjubilee:tidy-up-cargo-metadata, r=Mark-Simulacrum
bump tidy to cargo_metadata 0.11

Updates cargo_metadata in tidy's Cargo.toml from 0.9.1 to 0.11
Real version change 0.9.11 -> 0.11.1
https://github.com/oli-obk/cargo_metadata/compare/v0.9.1...v0.11.1
2020-08-25 03:33:10 +00:00
bors
3e041cec75 Auto merge of #75666 - davidtwco:tidy-lang-items, r=varkor
hir: consistent use and naming of lang items

This PR adjusts the naming of various lang items so that they are consistent and don't include prefixes containing the target or "LangItem". In addition, lang item variants are no longer exported from the `lang_items` module.

This is certainly subjective and while I think this is an improvement, if many in the team don't then we can just close this.
2020-08-25 01:06:16 +00:00
Scott McMurray
d6185f9314 Unbreak the clippy test 2020-08-24 16:29:03 -07:00