-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 7 pull requests #134269
Rollup of 7 pull requests #134269
Conversation
They are only present because it's currently defined in terms of the domains of `Borrows` and `MaybeUninitializedPlaces` and `EverInitializedPlaces` via associated types. This commit introduces typedefs for those domains, avoiding the lifetimes.
Via the `Analysis::Domain` associated types, instead of the direct type name.
Currently they are called (most common) `state`, or `trans`, or (rare) `on_entry`. I think `trans` is short for "transfer function", which perhaps made more sense when `GenKillAnalysis` existed. Using `state` everywhere now is more consistent.
"Set" doesn't make much sense here, we refer to domain values as "state" everywhere else. (This name confused me for a while.)
It uses `MaybeInitializedPlaces` and `MaybeUninitializedPlaces`, but calls the results `live` and `dead`. This is very confusing given that there are also analyses called `MaybeLiveLocals` and `MaybeStorageLive` and `MaybeStorageDead`. This commit changes it to use `maybe_init` and `maybe_uninit`.
The words "before" and "after" have an obvious temporal meaning, e.g. `seek_before_primary_effect`, `visit_statement_{before,after}_primary_effect`. But "before" is also used to name the effect that occurs before the primary effect of a statement/terminator; this is `Effect::Before`. This leads to the confusing possibility of talking about things happening "before/after the before event". This commit removes this awkward overloading of "before" by renaming `Effect::Before` as `Effect::Early`. It also renames some of the `Analysis` and `ResultsVisitor` methods to be more consistent. Here are the before and after names: - `Effect::{Before,Primary}` -> `Effect::{Early,Primary}` - `apply_before_statement_effect` -> `apply_early_statement_effect` - `apply_statement_effect` -> `apply_primary_statement_effect` - `visit_statement_before_primary_effect` -> `visit_after_early_statement_effect` - `visit_statement_after_primary_effect` -> `visit_after_primary_statement_effect` (And s/statement/terminator/ for all the terminator events.)
In most places, the `early` method is listed before the corresponding `primary` method, like you'd expect. This commit fixes two places where that isn't the case.
- Document and tidy up `alias-uninit-value.rs` - Move `alias-uninit-value.rs` to `tests/ui/codegen/`
- Document `allow-non-lint-warnings.rs` - Move `allow-non-lint-warnings.rs` under `tests/ui/diagnostic-flags/` - Improve the test to use two *differential* revisions: 1. One revision checks that without `-A warnings` the code sample actually emits a warning. 2. The other revision checks that `-A warnings` suppresses the warning. This makes sure that if the code sample no longer warns, the test doesn't silently pass but fail to check its intended purpose.
- Document `anonymous-higher-ranked-lifetime.rs` - Move `anonymous-higher-ranked-lifetime.rs` to `tests/ui/higher-ranked`
- Document `artificial-block.rs` - Move `artificial-block.rs` under `tests/ui/reachable`
- Document `as-precedence.rs` - Move `as-precedence.rs` under `tests/ui/parser/`
…r paths involving them When we expand a `mod foo;` and parse `foo.rs`, we now track whether that file had an unrecovered parse error that reached the end of the file. If so, we keep that information around. When resolving a path like `foo::bar`, we do not emit any errors for "`bar` not found in `foo`", as we know that the parse error might have caused `bar` to not be parsed and accounted for. When this happens in an existing project, every path referencing `foo` would be an irrelevant compile error. Instead, we now skip emitting anything until `foo.rs` is fixed. Tellingly enough, we didn't have any test for errors caused by `mod` expansion. Fix rust-lang#97734.
…rs` has parse errors
Advent of `tests/ui` (misc cleanups and improvements) [1/N] Part of rust-lang#133895. Misc improvements to some ui tests immediately under `tests/ui/`. Best reviewed commit-by-commit. Thanks `@clubby789` for PR title suggestion 😸. r? compiler
…om-mod-with-parse-errors, r=davidtwco Keep track of parse errors in `mod`s and don't emit resolve errors for paths involving them When we expand a `mod foo;` and parse `foo.rs`, we now track whether that file had an unrecovered parse error that reached the end of the file. If so, we keep that information around in the HIR and mark its `DefId` in the `Resolver`. When resolving a path like `foo::bar`, we do not emit any errors for "`bar` not found in `foo`", as we know that the parse error might have caused `bar` to not be parsed and accounted for. When this happens in an existing project, every path referencing `foo` would be an irrelevant compile error. Instead, we now skip emitting anything until `foo.rs` is fixed. Tellingly enough, we didn't have any test for errors caused by expansion of `mod`s with parse errors. Fix rust-lang#97734.
@bors r+ rollup=never p=7 |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#133900 (Advent of `tests/ui` (misc cleanups and improvements) [1/N]) - rust-lang#133937 (Keep track of parse errors in `mod`s and don't emit resolve errors for paths involving them) - rust-lang#133938 (`rustc_mir_dataflow` cleanups, including some renamings) - rust-lang#134058 (interpret: reduce usage of TypingEnv::fully_monomorphized) - rust-lang#134130 (Stop using driver queries in the public API) - rust-lang#134140 (Add AST support for unsafe binders) - rust-lang#134229 (Fix typos in docs on provenance) r? `@ghost` `@rustbot` modify labels: rollup
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
⌛ Testing commit 8cce32a with merge 4a204bebdfd5cbc3e7edabf41cda3c3ff8b74917... |
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR:
previous master: 327c7ee436 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Finished benchmarking commit (4a204be): comparison URL. Overall result: ❌✅ regressions and improvements - no action needed@rustbot label: -perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 0.4%, secondary 1.2%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary -2.7%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 769.449s -> 768.546s (-0.12%) |
Wow, +2 mb rustc_driver.so |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#133900 (Advent of `tests/ui` (misc cleanups and improvements) [1/N]) - rust-lang#133937 (Keep track of parse errors in `mod`s and don't emit resolve errors for paths involving them) - rust-lang#133938 (`rustc_mir_dataflow` cleanups, including some renamings) - rust-lang#134058 (interpret: reduce usage of TypingEnv::fully_monomorphized) - rust-lang#134130 (Stop using driver queries in the public API) - rust-lang#134140 (Add AST support for unsafe binders) - rust-lang#134229 (Fix typos in docs on provenance) r? `@ghost` `@rustbot` modify labels: rollup
Successful merges:
tests/ui
(misc cleanups and improvements) [1/N] #133900 (Advent oftests/ui
(misc cleanups and improvements) [1/N])mod
s and don't emit resolve errors for paths involving them #133937 (Keep track of parse errors inmod
s and don't emit resolve errors for paths involving them)rustc_mir_dataflow
cleanups, including some renamings #133938 (rustc_mir_dataflow
cleanups, including some renamings)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup