about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2020-11-09Support inlining diverging function callsTomasz Miąsko-0/+180
Additionally introduce storage markers for all temporaries created by the inliner. The temporary introduced for destination rebrorrow, didn't use them previously.
2020-11-09inliner: Break inlining cyclesTomasz Miąsko-0/+134
When examining candidates for inlining, reject those that are determined to be recursive either because of self-recursive calls or calls to any instances already inlined.
2020-11-09Rollup merge of #78868 - notriddle:master, r=GuillaumeGomezDylan DPC-2/+3
Fix tab focus on restyled switches Setting a checkbox to `display:none` makes it impossible to tab onto it, which makes the rustdoc settings page completely keyboard inaccessible.
2020-11-09Rollup merge of #78748 - fanzier:tuple-assignment, r=petrochenkovDylan DPC-55/+214
Implement destructuring assignment for tuples This is the first step towards implementing destructuring assignment (RFC: https://github.com/rust-lang/rfcs/pull/2909, tracking issue: #71126). This PR is the first part of #71156, which was split up to allow for easier review. Quick summary: This change allows destructuring the LHS of an assignment if it's a (possibly nested) tuple. It is implemented via a desugaring (AST -> HIR lowering) as follows: ```rust (a,b) = (1,2) ``` ... becomes ... ```rust { let (lhs0,lhs1) = (1,2); a = lhs0; b = lhs1; } ``` Thanks to `@varkor` who helped with the implementation, particularly around default binding modes. r? `@petrochenkov`
2020-11-09Rollup merge of #78674 - tmiasko:inline-substs-for-mir-body, r=oli-obkDylan DPC-0/+91
inliner: Use substs_for_mir_body Changes from 68965 extended the kind of instances that are being inlined. For some of those, the `instance_mir` returns a MIR body that is already expressed in terms of the types found in substitution array, and doesn't need further substitution. Use `substs_for_mir_body` to take that into account. Resolves #78529. Resolves #78560.
2020-11-09Rollup merge of #78228 - pietroalbini:finally, r=Mark-SimulacrumDylan DPC-20/+12
Promote aarch64-unknown-linux-gnu to Tier 1 This PR promotes the `aarch64-unknown-linux-gnu` target to Tier 1, as proposed by [RFC 2959]: * The `aarch64-gnu` CI job is moved from `auto-fallible` to `auto`. * The platform support documentation is updated, uplifting the target to Tiert 1 with a note about missing stack probes support. * Building the documentation is enabled for the target, as we produce the `rust-docs` component for all Tier 1 platforms. [RFC 2959]: https://github.com/rust-lang/rfcs/pull/2959
2020-11-09Rollup merge of #78114 - jyn514:private, r=oli-obkDylan DPC-5/+6
Recognize `private_intra_doc_links` as a lint Previously, trying to allow this would give another error! ``` warning: unknown lint: `private_intra_doc_links` --> private.rs:1:10 | 1 | #![allow(private_intra_doc_links)] | ^^^^^^^^^^^^^^^^^^^^^^^ help: did you mean: `broken_intra_doc_links` | = note: `#[warn(unknown_lints)]` on by default warning: public documentation for `DocMe` links to private item `DontDocMe` --> private.rs:2:11 | 2 | /// docs [DontDocMe] | ^^^^^^^^^ this item is private | = note: `#[warn(private_intra_doc_links)]` on by default = note: this link will resolve properly if you pass `--document-private-items` ``` Fixes the issue found in https://github.com/rust-lang/rust/pull/77249#issuecomment-712339227. r? ````````@Manishearth```````` Does anyone know why this additional step is necessary? It seems weird this has to be declared in 3 different places.
2020-11-08Auto merge of #78712 - petrochenkov:visitok, r=Aaron1011bors-0/+121
rustc_ast: Visit tokens stored in AST nodes in mutable visitor After #77271 token visiting is enabled only for one visitor in `rustc_expand\src\mbe\transcribe.rs` which applies hygiene marks to tokens produced by declarative macros (`macro_rules` or `macro`), so this change doesn't affect anything else. When a macro has some interpolated token from an outer macro in its output ```rust macro inner() { $interpolated } ``` we can use the usual interpretation of interpolated tokens in token-based model - a None-delimited group - to write this macro in an equivalent form ```rust macro inner() { ⟪ a b c d ⟫ } ``` When we are expanding the macro `inner` we need to apply hygiene marks to all tokens produced by it, including the tokens inside the group. Before this PR we did this by visiting the AST piece inside the interpolated token and applying marks to all spans in it. I'm not sure this is 100% correct (ideally we should apply the marks to tokens and then re-parse the AST from tokens), but it's a very good approximation at least. We didn't however apply the marks to actual tokens stored in the nonterminal, so if we used the nonterminal as a token rather than as an AST piece (e.g. passed it to a proc macro), then we got hygiene bugs. This PR applies the marks to tokens in addition to the AST pieces thus fixing the issue. r? `@Aaron1011`
2020-11-08Auto merge of #78874 - m-ou-se:rollup-3jp1ijj, r=m-ou-sebors-45/+169
Rollup of 19 pull requests Successful merges: - #76097 (Stabilize hint::spin_loop) - #76227 (Stabilize `Poll::is_ready` and `is_pending` as const) - #78065 (make concurrency helper more pleasant to read) - #78570 (Remove FIXME comment in print_type_sizes ui test suite) - #78572 (Use SOCK_CLOEXEC and accept4() on more platforms.) - #78658 (Add a tool to run `x.py` from any subdirectory) - #78706 (Fix run-make tests running when LLVM is disabled) - #78728 (Constantify `UnsafeCell::into_inner` and related) - #78775 (Bump Rustfmt and RLS) - #78788 (Correct unsigned equivalent of isize to be usize) - #78811 (Make some std::io functions `const`) - #78828 (use single char patterns for split() (clippy::single_char_pattern)) - #78841 (Small cleanup in `TypeFoldable` derive macro) - #78842 (Honor the rustfmt setting in config.toml) - #78843 (Less verbose debug logging from inlining integrator) - #78852 (Convert a bunch of intra-doc links) - #78860 (rustc_resolve: Use `#![feature(format_args_capture)]`) - #78861 (typo and formatting) - #78865 (Don't fire `CONST_ITEM_MUTATION` lint when borrowing a deref) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2020-11-08Rollup merge of #78865 - Aaron1011:fix/const-item-mut-reborrow, r=varkorMara Bos-12/+17
Don't fire `CONST_ITEM_MUTATION` lint when borrowing a deref Fixes #78819 This extends the check for dereferences added in PR #77324 to cover mutable borrows, as well as direct writes. If we're operating on a dereference of a `const` item, we shouldn't be firing the lint.
2020-11-08Rollup merge of #78842 - shepmaster:bootstrap-rustfmt, r=Mark-SimulacrumMara Bos-5/+12
Honor the rustfmt setting in config.toml Prior to this, setting the rustfmt configuration was ignored: ``` % mkdir example % cd example % ../configure --set build.rustfmt=/usr/bin/true % ../x.py fmt ./x.py fmt is not supported on this channel failed to run: /Users/shep/Projects/rust/example/build/bootstrap/debug/bootstrap fmt Build completed unsuccessfully in 0:00:01 ``` And after: ``` % ../x.py fmt Build completed successfully in 0:00:11 ``` r? `@Mark-Simulacrum`
2020-11-08Rollup merge of #78775 - ghedo:bump-rustfmt-rls, r=Mark-SimulacrumMara Bos-5/+6
Bump Rustfmt and RLS Should hopefully fix #78341 and fix #78340.
2020-11-08Rollup merge of #78706 - bjorn3:fix_run_make_without_llvm, r=Mark-SimulacrumMara Bos-11/+15
Fix run-make tests running when LLVM is disabled The `--cc`, `--cxx`, `--cflags` and `--ar` flags were only passed to compiletest when `builder.config.llvm_enabled()` returned true. This is preventing me from running the tests on cg_clif.
2020-11-08Rollup merge of #78658 - casey:x, r=Mark-SimulacrumMara Bos-0/+107
Add a tool to run `x.py` from any subdirectory This adds a binary called `x` in `src/tools/x`. All it does is check the current directory and its ancestors for a file called `x.py`, and if it finds one, runs it. By installing x, you can easily run `x.py` from any subdirectory, and only need to type `x`. It can be installed with `cargo install --path src/tools/x` This is a copy of a [binary I've been using myself when working on rust](https://github.com/casey/bootstrap), currently published to crates.io as `bootstrap`. It could be changed to avoid indirecting through `x.py`, and instead call the bootstrap module directly. However, this seemed like the simplest thing possible, and won't break if the details of how the bootstrap module is invoked change.
2020-11-08Rollup merge of #78570 - sasurau4:test/check-pass-print-type-size, r=jyn514Mara Bos-12/+12
Remove FIXME comment in print_type_sizes ui test suite ## Overview Helps with #62277 > The type sizes are likely only printed when the actual layout is computed. For generic types, this only happens during codegen. ref: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Codegen.20process.20question/near/215836807 Some tests like `multiple_types.rs` are passed even if using `check-pass`. But tests should be agnostic to when the actual layout is computed. The `build-pass` is intentionally used for them. I remove FIXME comments.
2020-11-08Auto merge of #78410 - lcnr:revert75443, r=nikomatsakisbors-27/+0
revert #75443, update mir validator This PR reverts rust-lang#75443 to fix rust-lang#75992 and instead uses rust-lang#75419 to fix rust-lang#75313. Adapts rust-lang#75419 to correctly deal with unevaluated constants as otherwise some `feature(const_evaluatable_checked)` tests would ICE. Note that rust-lang#72793 was also fixed by rust-lang#75443, but as that issue only concerns `feature(type_alias_impl_trait)` I deleted that test case for now and would reopen that issue. rust-lang#75443 may have also allowed some other code to now successfully compile which would make this revert a breaking change after 2 stable versions, but I hope that this is a purely theoretical concern. See https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/generator.20upvars/near/214617274 for more reasoning about this. r? `@nikomatsakis` `@eddyb` `@RalfJung`
2020-11-07Fix tab focus on restyled switchesMichael Howell-2/+3
Setting a checkbox to `display:none` makes it impossible to tab onto it, which makes the rustdoc settings page completely keyboard inaccessible.
2020-11-07Use a semicolon instead of a dash in lint noteAaron Hill-4/+4
2020-11-07Don't fire `CONST_ITEM_MUTATION` lint when borrowing a derefAaron Hill-8/+13
Fixes #78819 This extends the check for dereferences added in PR #77324 to cover mutable borrows, as well as direct writes. If we're operating on a dereference of a `const` item, we shouldn't be firing the lint.
2020-11-07Auto merge of #78784 - Mark-Simulacrum:revert-77421, r=petrochenkovbors-24/+5
Revert "Revert "resolve: Avoid "self-confirming" import resolutions in one more case"" Specifically, this reverts commit b20bce8ce54ea9d47c2e3eb0b17cbb6baf916ae2 from #77421 to fix #77586. The lang team has decided that for the time being we want to avoid the breakage here (perhaps for a future edition; though almost certainly not the upcoming one), though a future PR may want to add a lint around this case (and perhaps others) which are unlikely to be readable code. r? `@petrochenkov` to confirm this is the right way to fix #77586.
2020-11-07Honor the rustfmt setting in config.tomlJake Goulding-5/+12
Prior to this, setting the rustfmt configuration was ignored: ``` % mkdir example % cd example % ../configure --set build.rustfmt=/usr/bin/true % ../x.py fmt ./x.py fmt is not supported on this channel failed to run: /Users/shep/Projects/rust/example/build/bootstrap/debug/bootstrap fmt Build completed unsuccessfully in 0:00:01 ``` And after: ``` % ../x.py fmt Build completed successfully in 0:00:11 ```
2020-11-07Auto merge of #75199 - Mark-Simulacrum:debug-asserts, r=pietroalbinibors-37/+0
Re-enable debug and LLVM assertions Historically we've disabled these assertions on a number of platforms with the goal of speeding up CI. Now, though, having migrated to GitHub actions, CI is already pretty fast, and these debug assertions do bring us some value. This does leave in some debug assertions that are performance-related: macOS currently hovers at just under 2 hours. There are also some other builders which have debug and LLVM assertions disabled: llvm-8, PR builder: In one view, this builder tests our support for older LLVMs. But in reality, a lot of our tests already disable themselves on older LLVMs, and I think our general stance is that we really only support the in-tree LLVM. Plus, we really want CI times on this builder to be really low, as it's run on *every* PR -- that's a lot of CI time. test-various: This disables debug asserts still -- as noted in the Dockerfile, we test code size, and we need debug asserts off for that to work well. Helps with #59637 -- but doesn't close it, macOS still has asserts off. r? `@pietroalbini`
2020-11-07Implement destructuring assignment for tuplesFabian Zaiser-55/+214
Co-authored-by: varkor <github@varkor.com>
2020-11-07remove FIXME comment of #62277 in print_type_sizez ui testsDaiki Ihara-12/+12
2020-11-07Auto merge of #78817 - RalfJung:miri, r=RalfJungbors-6/+6
update Miri Fixes https://github.com/rust-lang/rust/issues/78741 Cc `@rust-lang/miri` r? `@ghost`
2020-11-06update MiriRalf Jung-6/+6
2020-11-06Add debug asserts to PR builderMark Rousskov-6/+0
This is helpful to catch slightly more bugs before things hit main CI, and doesn't cost too much extra CI time.
2020-11-06Re-enable debug and LLVM assertionsMark Rousskov-31/+0
Historically we've disabled these assertions on a number of platforms with the goal of speeding up CI. Now, though, having migrated to GitHub actions, CI is already pretty fast, and these debug assertions do bring us some value. This does leave in some debug assertions that are performance-related: macOS currently hovers at just under 2 hours. There are also some other builders which have debug and LLVM assertions disabled: llvm-8, PR builder: In one view, this builder tests our support for older LLVMs. But in reality, a lot of our tests already disable themselves on older LLVMs, and I think our general stance is that we really only support the in-tree LLVM. Plus, we really want CI times on this builder to be really low, as it's run on *every* PR -- that's a lot of CI time. test-various: This disables debug asserts still -- as noted in the Dockerfile, we test code size, and we need debug asserts off for that to work well.
2020-11-06Auto merge of #75778 - AndyGauge:75521-rustdoc-book-improvements, r=jyn514bors-31/+283
75521 rustdoc book improvements Added some guidelines about documenting with rustdoc Fixes #75521
2020-11-06Bump Rustfmt and RLSAlessandro Ghedini-5/+6
Should hopefully fix #78341 and #78340.
2020-11-06Revert "Revert "resolve: Avoid "self-confirming" import resolutions in one ↵Mark Rousskov-24/+5
more case"" This reverts commit b20bce8ce54ea9d47c2e3eb0b17cbb6baf916ae2. It retains the test added in that commit as a check-pass test, intended to prevent future (unintentional) regressions.
2020-11-07Rollup merge of #78798 - ankushduacodes:fixing-typo, r=jonas-schievinkYuki Okushi-4/+4
Fixing Spelling Typos Fixing #78787
2020-11-07Rollup merge of #78726 - GuillaumeGomez:back-link-to-main-website, ↵Yuki Okushi-1/+2
r=steveklabnik Add link to rust website Fixes #30838 This doesn't fix the issue as suggested but it at least adds a link to allow to go back to the rust website. r? `@steveklabnik`
2020-11-07Rollup merge of #78705 - Mark-Simulacrum:nicer-failure-compiletest, r=jyn514Yuki Okushi-2/+36
Print a summary of which test suite failed Especially on CI, where cross-compiling is common and single builder may end up with multiple hosts and multiple targets, it can be annoying to scroll back to the nearest start of test marker. This prints out a summary of the test suite being run directly in compiletest. For example, on a mir-opt failure, this would show something like this: ``` failures: [mir-opt] mir-opt/while-storage.rs test result: FAILED. 140 passed; 1 failed; 2 ignored; 0 measured; 0 filtered out Some tests failed in compiletest suite=mir-opt mode=mir-opt host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu ``` Fixes #78517
2020-11-07Rollup merge of #78666 - sasurau4:fix/shellcheck-error, r=jyn514Yuki Okushi-19/+42
Fix shellcheck error ## Overview Helps with #77290 This pr fix only errors of shellcheck, the result of `git ls-files '*.sh' | xargs shellcheck --severity=error`. Fixing error are following. - https://github.com/koalaman/shellcheck/wiki/SC2148 - https://github.com/koalaman/shellcheck/wiki/SC1008 Disable error following. - https://github.com/koalaman/shellcheck/wiki/SC2068
2020-11-07Rollup merge of #78514 - jyn514:setup-number, r=Mark-SimulacrumYuki Okushi-6/+9
Allow using 1/2/3/4 for `x.py setup` options This undocumented feature allows you to typo 'a' as '1'. r? ```@Mark-Simulacrum``` cc ```@Lokathor```
2020-11-07Rollup merge of #78167 - Nadrieril:fix-76836_, r=varkorYuki Okushi-5/+18
Fix unreachable sub-branch detection in or-patterns The previous implementation was too eager to avoid unnecessary "unreachable pattern" warnings. I feel more confident about this implementation than I felt about the previous one. Fixes https://github.com/rust-lang/rust/issues/76836. ``@rustbot`` modify labels: +A-exhaustiveness-checking
2020-11-06ignore shellcheck error SC2068Daiki Ihara-1/+2
2020-11-06fix shellcheck error of SC2068Daiki Ihara-20/+20
2020-11-06fix shellcheck error of SC1008Daiki Ihara-0/+1
2020-11-06fix shellcheck error of SC2148Daiki Ihara-0/+21
2020-11-06Auto merge of #77351 - jyn514:clippy-sysroot, r=Mark-Simulacrumbors-19/+76
Fix `x.py clippy` I don't think this ever worked. Fixes https://github.com/rust-lang/rust/issues/77309. `--fix` support is a work in progress, but works for a very small subset of `libtest`. This works by using the host `cargo-clippy` driver; it does not use `stage0.txt` at all. To mitigate confusion from this, it gives an error if you don't have `rustc +nightly` as the default rustc in `$PATH`. Additionally, it means that bootstrap can't set `RUSTC`; this makes it no longer possible for clippy to detect the sysroot itself. Instead, bootstrap passes the sysroot to cargo. r? `@ghost`
2020-11-06Auto merge of #78267 - richkadel:llvm-coverage-counters-2.0.3r1, r=tmandrybors-737/+10006
Working expression optimization, and some improvements to branch-level source coverage This replaces PR #78040 after reorganizing the original commits (by request) into a more logical sequence of major changes. Most of the work is in the MIR `transform/coverage/` directory (originally, `transform/instrument_coverage.rs`). Note this PR includes some significant additional debugging capabilities, to help myself and any future developer working on coverage improvements or issues. In particular, there's a new Graphviz (.dot file) output for the coverage graph (the `BasicCoverageBlock` control flow graph) that provides ways to get some very good insight into the relationships between the MIR, the coverage graph BCBs, coverage spans, and counters. (There are also some cool debugging options, available via environment variable, to alter how some data in the graph appears.) And the code for this Graphviz view is actually generic... it can be used by any implementation of the Rust `Graph` traits. Finally (for now), I also now output information from `llvm-cov` that shows the actual counters and spans it found in the coverage map, and their counts (from the `--debug` flag). I found this to be enormously helpful in debugging some coverage issues, so I kept it in the test results as well for additional context. `@tmandry` `@wesleywiser` r? `@tmandry` Here's an example of the new coverage graph: * Within each `BasicCoverageBlock` (BCB), you can see each `CoverageSpan` and its contributing statements (MIR `Statement`s and/or `Terminator`s) * Each `CoverageSpan` has a `Counter` or and `Expression`, and `Expression`s show their Add/Subtract operation with nested operations. (This can be changed to show the Counter and Expression IDs instead, or in addition to, the BCB.) * The terminators of all MIR `BasicBlock`s in the BCB, including one final `Terminator` * If an "edge counter" is required (because we need to count an edge between blocks, in some cases) the edge's Counter or Expression is shown next to its label. (Not shown in the example below.) (FYI, Edge Counters are converted into a new MIR `BasicBlock` with `Goto`) <img width="1116" alt="Screen Shot 2020-10-17 at 12 23 29 AM" src="https://user-images.githubusercontent.com/3827298/96331095-616cb480-100f-11eb-8212-60f2d433e2d8.png"> r? `@tmandry` FYI: `@wesleywiser`
2020-11-05Disable the spanview tests on MacOS for nowRich Kadel-0/+20
And even though CI should now pass for MacOS, the llvm-cov show --debug flag does not work when developing outside of CI, so I'm disabling it for MacOS by default.
2020-11-06Auto merge of #77856 - GuillaumeGomez:automatic-links-lint, r=jyn514,ollie27bors-4/+377
Add non_autolinks lint Part of #77501. r? `@jyn514`
2020-11-06Fixing Spelling Typosankushduacodes-4/+4
2020-11-05Fix sed command for MacRich Kadel-1/+1
add -e between -i and quoted script I had tested on my mac but forgot I had aliased sed=gsed. My bad.
2020-11-05rename some tests to avoid exceeding windows path limitsRich Kadel-819/+847
And restored missing error message from llvm-cov show And since some CI builds disable LLVM assertions (which disables the --debug option in llvm-cov show), I check to see if LLVM assertions are disabled, and if so, I don't add --debug and don't check the counter file diffs.
2020-11-05fix cross-platform test bugsRich Kadel-40/+17
More portable way to make python 2/3 portable. Strip Args line (with hardcoded paths) from debug counters output. Ignore diff failures from llvm-cov debug output files ("counters" files), since generic function instantiations will appear in those files with mangled names. (Sadly, the demangler is apparently not applied to the debug output.)
2020-11-05Responded to all feedback as of 2020-10-30Rich Kadel-0/+6