-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 6 pull requests #125817
Rollup of 6 pull requests #125817
Commits on May 28, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 077a821 - Browse repository at this point
Copy the full SHA 077a821View commit details -
Make drop-use fact collection simpler for
polonius
This shunts all the complexity of siphoning off the drop-use facts into `LivenessResults::add_extra_drop_facts()`, which may or may not be a good approach.
Configuration menu - View commit details
-
Copy full SHA for e155646 - Browse repository at this point
Copy the full SHA e155646View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8066ebc - Browse repository at this point
Copy the full SHA 8066ebcView commit details
Commits on May 30, 2024
-
Configuration menu - View commit details
-
Copy full SHA for dabd05b - Browse repository at this point
Copy the full SHA dabd05bView commit details -
Configuration menu - View commit details
-
Copy full SHA for fa563c1 - Browse repository at this point
Copy the full SHA fa563c1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 20174e6 - Browse repository at this point
Copy the full SHA 20174e6View commit details -
coverage: Instrument the RHS value of lazy logical operators
When a lazy logical operator (`&&` or `||`) occurs outside of an `if` condition, it normally doesn't have any associated control-flow branch, so we don't have an existing way to track whether it was true or false. This patch adds special code to handle this case, by inserting extra MIR blocks in a diamond shape after evaluating the RHS. This gives us a place to insert the appropriate marker statements, which can then be given their own counters.
Configuration menu - View commit details
-
Copy full SHA for 35a8746 - Browse repository at this point
Copy the full SHA 35a8746View commit details
Commits on May 31, 2024
-
We do this for `&*` and `&mut*` already; might as well do it for raw pointers too.
Configuration menu - View commit details
-
Copy full SHA for 4b96e44 - Browse repository at this point
Copy the full SHA 4b96e44View commit details -
run-make-support: add
#[must_use]
and drop bombs for command wrappersEspecially for command wrappers like `Rustc`, it's very easy to build up a command invocation but forget to actually execute it, e.g. by using `run()`. This commit adds "drop bombs" to command wrappers, which are armed on command wrapper construction, and only defused if the command is executed (through `run`, `run_fail` or `run_fail_assert_exit_code`). If the test writer forgets to execute the command, the drop bomb will "explode" and panic with an error message. This is so that tests don't silently pass with constructed-but-not-executed command wrappers. We don't add `#[must_use]` for command wrapper helper methods because they return `&mut Self` and can be annoying e.g. if a helper method is conditionally called, such as ``` if condition { cmd.arg("-Cprefer-dynamic"); // <- unused_must_use fires } cmd.run(); // <- even though cmd is eventually executed ``` We also add `#[must_use]` attributes to functions in the support library where suitable to help catch unintentionally discarded values.
Configuration menu - View commit details
-
Copy full SHA for be572a8 - Browse repository at this point
Copy the full SHA be572a8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 288c2de - Browse repository at this point
Copy the full SHA 288c2deView commit details -
Configuration menu - View commit details
-
Copy full SHA for a77a5f4 - Browse repository at this point
Copy the full SHA a77a5f4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7867fb7 - Browse repository at this point
Copy the full SHA 7867fb7View commit details -
Add an alternate
--demangle
mode to coverage-dumpThe coverage-dump tool already needs `rustc_demangle` for its own purposes, so the amount of extra code needed for a demangle mode is very small.
Configuration menu - View commit details
-
Copy full SHA for 9abfebd - Browse repository at this point
Copy the full SHA 9abfebdView commit details -
Use
coverage-dump --demangle
as the demangler for coverage-run testsThis avoids the need to build `rust-demangler` when running coverage tests, since we typically need to build `coverage-dump` anyway.
Configuration menu - View commit details
-
Copy full SHA for 10ffc22 - Browse repository at this point
Copy the full SHA 10ffc22View commit details -
Use
Builder::tool_exe
to build the coverage-dump toolThis appears to be the canonical way to build a tool with the stage 0 compiler.
Configuration menu - View commit details
-
Copy full SHA for feb8f3c - Browse repository at this point
Copy the full SHA feb8f3cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 54b6849 - Browse repository at this point
Copy the full SHA 54b6849View commit details -
Rollup merge of rust-lang#125652 - amandasystems:you-dropped-somethin…
…g, r=oli-obk Revert propagation of drop-live information from Polonius rust-lang#64749 introduced a flow of drop-use data from Polonius to `LivenessResults::add_extra_drop_facts()`, which makes `LivenessResults` agree with Polonius on liveness in the presence of free regions that may be dropped. Later changes accidentally removed this flow. This PR restores it.
Configuration menu - View commit details
-
Copy full SHA for ff13ca1 - Browse repository at this point
Copy the full SHA ff13ca1View commit details -
Rollup merge of rust-lang#125730 - mu001999-contrib:clippy-fix, r=oli…
…-obk Apply `x clippy --fix` and `x fmt` on Rustc <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> --> Just run `x clippy --fix` and `x fmt`, and remove some changes like `impl Default`.
Configuration menu - View commit details
-
Copy full SHA for c8fefc3 - Browse repository at this point
Copy the full SHA c8fefc3View commit details -
Rollup merge of rust-lang#125752 - jieyouxu:kaboom, r=Kobzol
run-make: enforce `#[must_use]` and arm command wrappers with drop bombs This PR is one in a series of cleanups to run-make tests and the run-make-support library. ### Summary It's easy to forget to actually executed constructed command wrappers, e.g. `rustc().input("foo.rs")` but forget the `run()`, so to help catch these mistakes, we: - Add `#[must_use]` annotations to functions where suitable and compile rmake.rs recipes with `-Dunused_must_use`. - Arm command wrappers with drop bombs on construction to force them to be executed by test code. ### Details Especially for command wrappers like `Rustc`, it's very easy to build up a command invocation but forget to actually execute it, e.g. by using `run()`. This commit adds "drop bombs" to command wrappers, which are armed on command wrapper construction, and only defused if the command is executed (through `run`, `run_fail` or `run_fail_assert_exit_code`). If the test writer forgets to execute the command, the drop bomb will "explode" and panic with an error message. This is so that tests don't silently pass with constructed-but-not-executed command wrappers. We don't add `#[must_use]` for command wrapper helper methods because they return `&mut Self` and can be annoying e.g. if a helper method is conditionally called, such as ``` if condition { cmd.arg("-Cprefer-dynamic"); // <- unused_must_use fires } cmd.run(); // <- even though cmd is eventually executed ``` This PR is best reviewed commit-by-commit. Fixes rust-lang#125703. Because `command_output()` doesn't defuse the drop bomb, it also fixes rust-lang#125617.
Configuration menu - View commit details
-
Copy full SHA for 58bd71e - Browse repository at this point
Copy the full SHA 58bd71eView commit details -
Rollup merge of rust-lang#125756 - Zalathar:branch-on-bool, r=oli-obk
coverage: Optionally instrument the RHS of lazy logical operators (This is an updated version of rust-lang#124644 and rust-lang#124402. Fixes rust-lang#124120.) When `||` or `&&` is used outside of a branching context (such as the condition of an `if`), the rightmost value does not directly influence any branching decision, so branch coverage instrumentation does not treat it as its own true-or-false branch. That is a correct and useful interpretation of “branch coverage”, but might be undesirable in some contexts, as described at rust-lang#124120. This PR therefore adds a new coverage level `-Zcoverage-options=condition` that behaves like branch coverage, but also adds additional branch instrumentation to the right-hand-side of lazy boolean operators. --- As discussed at rust-lang#124120 (comment), this is mainly intended as an intermediate step towards fully-featured MC/DC instrumentation. It's likely that we'll eventually want to remove this coverage level (rather than stabilize it), either because it has been incorporated into MC/DC instrumentation, or because it's getting in the way of future MC/DC work. The main appeal of landing it now is so that work on tracking conditions can proceed concurrently with other MC/DC-related work. ``@rustbot`` label +A-code-coverage
Configuration menu - View commit details
-
Copy full SHA for e8a8f62 - Browse repository at this point
Copy the full SHA e8a8f62View commit details -
Rollup merge of rust-lang#125796 - scottmcm:more-inst-simplify, r=oli…
…-obk Also InstSimplify `&raw*` We do this for `&*` and `&mut*` already; might as well do it for raw pointers too. r? mir-opt
Configuration menu - View commit details
-
Copy full SHA for 0cc6c33 - Browse repository at this point
Copy the full SHA 0cc6c33View commit details -
Rollup merge of rust-lang#125816 - Zalathar:demangler, r=oli-obk
Don't build the `rust-demangler` binary for coverage tests The coverage-run tests invoke `llvm-cov`, which requires us to specify a command-line demangler that it can use to demangle Rust symbol names. Historically this used `src/tools/rust-demangler`, which means that we currently build two different command-line tools to help with the coverage tests (`rust-demangler` and `coverage-dump`). However, it occurred to me that if we add a demangler mode to `coverage-dump` (which is only a handful of lines and no extra dependencies), then we only need to build one helper binary for the coverage tests, and there is no need for tests to build `rust-demangler` at all. --- Note that the `rust-demangler` binary is separate from the `rustc-demangle` crate (which both `rust-demangler` and `coverage-dump` use as a dependency to do the actual demangling). --- So the main benefits/motivations here are: - Slightly faster builds after a fresh checkout or bootstrap bump. - Making it clear that currently no tests actually need the `rust-demangler` binary, since the coverage tests can use their own tool instead.
Configuration menu - View commit details
-
Copy full SHA for 7082681 - Browse repository at this point
Copy the full SHA 7082681View commit details