about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2020-10-05Record `expansion_that_defined` into crate metadataAaron Hill-2/+66
Fixes #77523 Now that hygiene serialization is implemented, we also need to record `expansion_that_defined` so that we properly handle a foreign `SyntaxContext`.
2020-10-05Auto merge of #77543 - Mark-Simulacrum:rsp-quoting, r=eddybbors-0/+6
Force posix-style quoting on lld, independent of host platform This just blindly applies the logic from `@eddyb's` comment here: https://github.com/rust-lang/rust/issues/76466#issuecomment-699024973 Hopefully, this fixed #76466 -- I cannot test this though.
2020-10-05Instruct lld that our @ files are posix-style, not WindowsMark Rousskov-0/+6
An upstream LLVM change changed behavior here to respect the host system quoting rules; previously the posix-style format was always used for @files.
2020-10-05Auto merge of #77549 - tmiasko:simplify-branch-same-fix, r=oli-obkbors-1/+23
Fix miscompile in SimplifyBranchSame Cherry-picked from #77486, but with a different test case that used to be compiled incorrectly on both master & beta branches.
2020-10-05Auto merge of #77552 - ecstatic-morse:body-def-id, r=lcnrbors-273/+201
Replace `(Body, DefId)` with `Body` where possible Follow-up to #77430. I `grep`-ed for parameter lists in which a `Body` appeared within a few lines of a `DefId`, so it's possible that I missed some cases, but this should be pretty complete. Most of these changes were mechanical, but there's a few places where I started calling things "caller" and "callee" when multiple `DefId`s were in-scope at once. Also, we should probably have a helper function on `Body` that returns a `LocalDefId`. I can do that in this PR or in a follow-up.
2020-10-05Auto merge of #77557 - Dylan-DPC:rollup-aib9ptp, r=Dylan-DPCbors-661/+1645
Rollup of 11 pull requests Successful merges: - #75853 (Use more intra-doc-links in `core::fmt`) - #75928 (Remove trait_selection error message in specific case) - #76329 (Add check for doc alias attribute at crate level) - #77219 (core::global_allocator docs link to std::alloc::GlobalAlloc) - #77395 (BTreeMap: admit the existence of leaf edges in comments) - #77407 (Improve build-manifest to work with the improved promote-release) - #77426 (Include scope id in SocketAddrV6::Display) - #77439 (Fix missing diagnostic span for `impl Trait` with const generics, and add various tests for `min_const_generics` and `const_generics`) - #77471 (BTreeMap: refactoring around edges, missed spots) - #77512 (Allow `Abort` terminators in all const-contexts) - #77514 (Replace some once(x).chain(once(y)) with [x, y] IntoIter) Failed merges: r? `@ghost`
2020-10-05Auto merge of #77466 - Aaron1011:reland-drop-tree, r=matthewjasperbors-2748/+2504
Re-land PR #71840 (Rework MIR drop tree lowering) PR https://github.com/rust-lang/rust/pull/71840 was reverted in https://github.com/rust-lang/rust/pull/72989 to fix an LLVM error (https://github.com/rust-lang/rust/issues/72470). That LLVM error no longer occurs with the recent upgrade to LLVM 11 (https://github.com/rust-lang/rust/pull/73526), so let's try re-landing this PR. I've cherry-picked the commits from the original PR (with the exception of the commit blessing test output), making as few modifications as possible. I addressed the rebase fallout in separate commits on top of those. r? `@matthewjasper`
2020-10-05Rollup merge of #77514 - scottmcm:less-once-chain-once, r=estebankDylan DPC-9/+11
Replace some once(x).chain(once(y)) with [x, y] IntoIter Now that we have by-value array iterators that are [already used](https://github.com/rust-lang/rust/blob/25c8c53dd994acb3f4f7c02fe6bb46076393f8b0/compiler/rustc_hir/src/def.rs#L305-L307)... For example, ```diff - once(self.type_ns).chain(once(self.value_ns)).chain(once(self.macro_ns)).filter_map(|it| it) + IntoIter::new([self.type_ns, self.value_ns, self.macro_ns]).filter_map(|it| it) ```
2020-10-05Rollup merge of #77512 - ecstatic-morse:const-checking-allow-abort, r=RalfJungDylan DPC-17/+62
Allow `Abort` terminators in all const-contexts We never unwind during const-eval, so we basically have these semantics already. Also I just figured out that these only appear along the cleanup path, which doesn't get const-checked. In other words, this doesn't actually change behavior: the `check-pass` test I added compiles just fine on nightly. r? @RalfJung cc @rust-lang/wg-const-eval
2020-10-05Rollup merge of #77471 - ssomers:btree_cleanup_3, r=Mark-SimulacrumDylan DPC-7/+7
BTreeMap: refactoring around edges, missed spots Tweaks from #77244 (and more) that are really inconsistencies in #77005. r? @Mark-Simulacrum
2020-10-05Rollup merge of #77439 - varkor:min_const_generics-tests, r=lcnr,estebankDylan DPC-66/+628
Fix missing diagnostic span for `impl Trait` with const generics, and add various tests for `min_const_generics` and `const_generics` Closes https://github.com/rust-lang/rust/issues/61410. Adds `min_const_generics` tests for: - https://github.com/rust-lang/rust/issues/73727 - https://github.com/rust-lang/rust/issues/72293 - https://github.com/rust-lang/rust/issues/67375 - https://github.com/rust-lang/rust/issues/75153 - https://github.com/rust-lang/rust/issues/71922 - https://github.com/rust-lang/rust/issues/69913 - https://github.com/rust-lang/rust/issues/67945 - https://github.com/rust-lang/rust/issues/69239 Adds `const_generics` tests for: - https://github.com/rust-lang/rust/issues/67375 - https://github.com/rust-lang/rust/issues/75153 - https://github.com/rust-lang/rust/issues/71922 - https://github.com/rust-lang/rust/issues/69913 - https://github.com/rust-lang/rust/issues/67945 - https://github.com/rust-lang/rust/issues/69239 (I only added separate `min_const_generics` and `const_generics` tests if they were handled differently by the two features.) We need to figure out how to deduplicate when `const_generics` is stabilised, but we can discuss that later. For now, we should be checking neither feature breaks, so require regression tests for both. I've given them identical names when I've added both, which should make it easier to spot them later. r? @lcnr
2020-10-05Rollup merge of #77426 - tamird:sockaddr-scope-id, r=dtolnayDylan DPC-3/+19
Include scope id in SocketAddrV6::Display r? @tmandry I couldn't find any unit tests for these functions. cc @ghanan94 @brunowonka
2020-10-05Rollup merge of #77407 - pietroalbini:less-build-manifest, r=Mark-SimulacrumDylan DPC-130/+334
Improve build-manifest to work with the improved promote-release This PR makes some changes to build-manifest to have it work better with the other improvements I'm making to [promote-release](https://github.com/rust-lang/promote-release). A new way to invoke the tool was added: `./x.py run src/tools/build-manifest`. The new invocation disables the generation of `.sha256` files and the generation of GPG signatures, as those steps are not tied to the Rust version we're building the manifest of: handling them in `promote-release` will improve the maintenability of our release process. Invocations through the old command (`./x.py dist hash-and-sign`) are referred inside the source code as "legacy". The new invocation also enables internal parallelism, disabled on legacy to avoid overloading our old server. Improvements were also made on how the checksums included in the manifest are generated: * The manifest is first generated with placeholder checksums, and then a function walks through the manifes and calculates only the needed hashes. Before this PR, all the hashes were calculated beforehand, including the hashes of unused files. * Calculating the hashes is now done in parallel with rayon, to better utilize all the available disk bandwidth. * The `sha2` crate is now used instead of the `sha256sum` CLI tool: this avoids the overhead of calling another process, but more importantly enables hardware acceleration whenever available (the `sha256sum` CLI tool doesn't support it at all). r? @Mark-Simulacrum This PR is best reviewed commit-by-commit.
2020-10-05Rollup merge of #77395 - ssomers:btree_love_the_leaf_edge_comments, ↵Dylan DPC-22/+12
r=Mark-Simulacrum BTreeMap: admit the existence of leaf edges in comments The btree code is ambiguous about leaf edges (i.e., edges within leaf nodes). Iteration relies on them heavily, but some of the comments suggest there are no leaf edges (extracted from #77025) r? @Mark-Simulacrum
2020-10-05Rollup merge of #77219 - mightyiam:issue_77100, r=jyn514Dylan DPC-0/+2
core::global_allocator docs link to std::alloc::GlobalAlloc Closes #77100
2020-10-05Rollup merge of #76329 - GuillaumeGomez:doc-alias-crate-level, r=matthewjasperDylan DPC-404/+547
Add check for doc alias attribute at crate level Fixes #76298, #64734, #69365. r? @ollie27
2020-10-05Rollup merge of #75928 - JulianKnodt:non_utf8, r=estebankDylan DPC-0/+20
Remove trait_selection error message in specific case In the case that a trait is not implemented for an ADT with type errors, cancel the error. Fixes #75627
2020-10-05Rollup merge of #75853 - LeSeulArtichaut:core-intra-docs-3, r=jyn514Dylan DPC-3/+3
Use more intra-doc-links in `core::fmt` This is a follow-up to #75819, which encountered some broken links due to #75176, so this PR contains the links that are blocked on #75176. r? @jyn514
2020-10-04Remove `DefId` from `MirBorrowckCtxt`Dylan MacKenzie-26/+27
2020-10-04nll: solveDylan MacKenzie-2/+2
2020-10-04Replace `(Body, WithOptConstParam)` with `Body` where possibleDylan MacKenzie-11/+10
2020-10-04clippy: `(Body, DefId)` -> `Body`Dylan MacKenzie-3/+4
2020-10-04Replace `(Body, DefId)` with `Body` where possibleDylan MacKenzie-232/+159
A `Body` now contains its `MirSource`, which in turn contains the `DefId` of the item associated with the `Body`.
2020-10-04Auto merge of #77023 - HeroicKatora:len-missed-optimization, r=Mark-Simulacrumbors-3/+51
Hint the maximum length permitted by invariant of slices One of the safety invariants of references, and in particular of references to slices, is that they may not cover more than `isize::MAX` bytes. The unsafe `from_raw_parts` constructors of slices explicitly requires the caller to guarantee this fact. Violating it would also be UB with regards to the semantics of generated llvm code. This effectively bounds the length of a (non-ZST) slice from above by a compile time constant. But when the length is loaded from a function argument it appears llvm is not aware of this requirement. The additional value range assertions allow some further elision of code branches, including overflow checks, especially in the presence of artithmetic on the indices. This may have a performance impact, adding more code to a common method but allowing more optimization. I'm not quite sure, is the Rust side of const-prop strong enough to elide the irrelevant match branches? Fixes: #67186
2020-10-04Use more intra-doc-links in `core::fmt`LeSeulArtichaut-3/+3
2020-10-04But whateverecstatic-morse-0/+1
2020-10-04Add comment to `Abort` match armecstatic-morse-0/+1
Co-authored-by: Ralf Jung <post@ralfj.de>
2020-10-04Bless more test outputAaron Hill-973/+639
2020-10-04Assume slice len is bounded by allocation sizeAndreas Molzer-3/+51
Uses assume to check the length against a constant upper bound. The inlined result then informs the optimizer of the sound value range. This was tried with unreachable_unchecked before which introduces a branch. This has the advantage of not being executed in sound code but complicates basic blocks. It resulted in ~2% increased compile time in some worst cases. Add a codegen test for the assumption, testing the issue from #67186
2020-10-04Auto merge of #77430 - ecstatic-morse:mir-source-in-body, r=lcnrbors-380/+327
Store a `MirSource` inside every `Body` Resolves #77427. r? `@ghost`
2020-10-04HACK: Overwrite the MIR's source with the correct const paramDylan MacKenzie-1/+7
There's a cleaner way of doing this, but it involves passing `WithOptConstParam` around in more places. We're going to try to explore different approaches before committing to that.
2020-10-04Remember the `MirSource` for each `Body`Dylan MacKenzie-346/+281
2020-10-04Move `MirSource` to `rustc_middle`Dylan MacKenzie-28/+35
2020-10-04Miscellaneous import formattingDylan MacKenzie-5/+4
2020-10-04Discuss cleanup blocks and `span_bug` on `Abort`Dylan MacKenzie-6/+11
2020-10-04Auto merge of #77527 - jonas-schievink:rollup-szgq5he, r=jonas-schievinkbors-318/+438
Rollup of 8 pull requests Successful merges: - #77072 (Minor `hash_map` doc adjustments + item attribute orderings) - #77368 (Backport LLVM apfloat commit to rustc_apfloat) - #77445 (BTreeMap: complete the compile-time test_variance test case) - #77504 (Support vectors with fewer than 8 elements for simd_select_bitmask) - #77513 (Change DocFragments from enum variant fields to structs with a nested enum) - #77518 (Only use Fira Sans for the first `td` in item lists) - #77521 (Move target feature whitelist from cg_llvm to cg_ssa) - #77525 (Enable RenameReturnPlace MIR optimization on mir-opt-level >= 2) Failed merges: r? `@ghost`
2020-10-04Rollup merge of #77525 - tmiasko:nrvo-2, r=jonas-schievinkJonas Schievink-6/+0
Enable RenameReturnPlace MIR optimization on mir-opt-level >= 2 The destination propagation as currently implemented does not supersede the NRVO, e.g., the destination propagation never applies if either local has an address taken, while NRVO might. Additionally, the issue with failing assertions had been already resolved. Continue running both optimizations at mir-opt-level >= 2.
2020-10-04Rollup merge of #77521 - bjorn3:target_feature_whitelist, r=lcnrJonas Schievink-154/+155
Move target feature whitelist from cg_llvm to cg_ssa These target features have to be supported or at least emulated by alternative codegen backends anyway as they are used by common crates. By moving this list to cg_ssa, other codegen backends don't have to copy this code.
2020-10-04Rollup merge of #77518 - camelid:rustdoc-use-correct-link-font, r=GuillaumeGomezJonas Schievink-1/+1
Only use Fira Sans for the first `td` in item lists Fixes #77516. Fixes an issue where links in the one-line version of an item's docs would be in Fira Sans, while the rest would be in a serifed font.
2020-10-04Rollup merge of #77513 - jyn514:refactor-doc-fragments, r=GuillaumeGomezJonas Schievink-88/+48
Change DocFragments from enum variant fields to structs with a nested enum This makes the code a lot easier to work with. It also makes it easier to add new fields without updating each variant and `match` individually. - Name the `Kind` variant after `DocFragmentKind` from `collapse_docs` - Remove unneeded impls Progress towards https://github.com/rust-lang/rust/issues/77254. r? @GuillaumeGomez
2020-10-04Rollup merge of #77504 - Amanieu:select_simd_bitmask, r=ecstatic-morseJonas Schievink-8/+37
Support vectors with fewer than 8 elements for simd_select_bitmask Resolves the issue raised here: https://github.com/rust-lang/stdarch/issues/310#issuecomment-693730094
2020-10-04Rollup merge of #77445 - ssomers:btree_cleanup_7, r=Mark-SimulacrumJonas Schievink-27/+118
BTreeMap: complete the compile-time test_variance test case Some of the items added to the new `test_sync` belonged in the old `test_variance` as well. And fixed inconsistent paths to nearby modules. r? @Mark-Simulacrum
2020-10-04Rollup merge of #77368 - est31:apfloat_fix, r=varkorJonas Schievink-14/+59
Backport LLVM apfloat commit to rustc_apfloat Backports LLVM commit: https://github.com/llvm/llvm-project/commit/e34bd1e0b03d20a506ada156d87e1b3a96d82fa2 Fixes #69532
2020-10-04Rollup merge of #77072 - sharnoff:hash-docs, r=LukasKalbertodtJonas Schievink-20/+20
Minor `hash_map` doc adjustments + item attribute orderings This PR is really a couple visual changes glued together: 1. Some of the doc comments for items in `std::collections::hash_map` referenced the names of types without escaping their formatting (e.g. using "VacantEntry" instead of "`VacantEntry`") - the ones I could find were changed to the latter 2. The vast majority of pre-item attributes seem to place doc comments as the first attribute (instead of things like `#[feature(...)]`), so the few that had the other order were changed. 3. Also ordering related: the general trend seems to be that `#[feature]` attributes follow `#[inline]`, so I swapped the two lines in places where that ordering was reversed. This is primarily a change based on stylistic continuity and aesthetics - I'm not sure how important that actually is / should be. I figured this would be pretty uncontroversial, but some of these might have been intentional for reasons I don't know about - if so, I'd be happy to remove the relevant changes. Of these, the final set of changes is probably the most unnecessary, so it also might be better to leave those out (in favor of reducing code churn).
2020-10-04Include scope id in SocketAddrV6::DisplayTamir Duberstein-3/+19
2020-10-04Apply suggestions from reviewAaron Hill-3/+3
Co-authored-by: matthewjasper <20113453+matthewjasper@users.noreply.github.com>
2020-10-04Bless mir-opt testsAaron Hill-1003/+827
2020-10-04Fix broken linkAaron Hill-1/+1
2020-10-04Add regression test for issue #72470Aaron Hill-0/+241
This was fixed with the upgrade to LLVM 11 in #73526. It seems extremely unlikey that this exact issue will ever reoccur, since slight modifications to the code caused the crash to stop happening. However, it can't hurt to have a test for it.
2020-10-04Fix rebase falloutAaron Hill-12/+7