Skip to content
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

Merged
merged 35 commits into from
Dec 14, 2024
Merged

Rollup of 7 pull requests #134269

merged 35 commits into from
Dec 14, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

RalfJung and others added 30 commits December 9, 2024 09:27
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.
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.
@rustbot rustbot added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Dec 13, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented Dec 13, 2024

📌 Commit 8cce32a has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 13, 2024
@bors
Copy link
Contributor

bors commented Dec 13, 2024

⌛ Testing commit 8cce32a with merge fd6360b...

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 13, 2024
…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
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-distcheck failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
   Compiling rustc_log v0.0.0 (/checkout/compiler/rustc_log)
[RUSTC-TIMING] tracing_subscriber test:false 20.505
   Compiling rustc-main v0.0.0 (/checkout/compiler/rustc)
[RUSTC-TIMING] build_script_build test:false 0.255
rustc: /checkout/src/llvm-project/llvm/include/llvm/ADT/DenseMap.h:665: bool llvm::DenseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT>::LookupBucketFor(const LookupKeyT&, const BucketT*&) const [with LookupKeyT = unsigned int; DerivedT = llvm::DenseMap<unsigned int, unsigned int>; KeyT = unsigned int; ValueT = unsigned int; KeyInfoT = llvm::DenseMapInfo<unsigned int>; BucketT = llvm::detail::DenseMapPair<unsigned int, unsigned int>]: Assertion `!KeyInfoT::isEqual(Val, EmptyKey) && !KeyInfoT::isEqual(Val, TombstoneKey) && "Empty/Tombstone value shouldn't be inserted into map!"' failed.
[RUSTC-TIMING] rustc_log test:false 6.478
rustc exited with signal: 6 (SIGABRT) (core dumped)

Caused by:
Caused by:
  process didn't exit successfully: `/checkout/obj/build/tmp/distcheck/build/bootstrap/debug/rustc /checkout/obj/build/tmp/distcheck/build/bootstrap/debug/rustc --crate-name rustc_log --edition=2021 compiler/rustc_log/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C debug-assertions=on --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("max_level_info"))' -C metadata=2e28c369854b3826 -C extra-filename=-2e28c369854b3826 --out-dir /checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps --extern tracing=/checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libtracing-b2f6e5ab60ea67d5.rmeta --extern tracing_core=/checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libtracing_core-74737551f0ee2bd1.rmeta --extern tracing_subscriber=/checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libtracing_subscriber-310c3a2bb7504f1a.rmeta --extern tracing_tree=/checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libtracing_tree-3af1fc9c5c0df5ce.rmeta --cfg=windows_raw_dylib -Csymbol-mangling-version=v0 -Zunstable-options '--check-cfg=cfg(bootstrap)' '--check-cfg=cfg(llvm_enzyme)' -Zmacro-backtrace -Csplit-debuginfo=off '-Wrustc::internal' '-Drustc::symbol_intern_string_literal' -Wkeyword_idents_2024 -Wunsafe_op_in_unsafe_fn -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Zon-broken-pipe=kill -Z binary-dep-depinfo` (exit status: 254)
[RUSTC-TIMING] stable_mir test:false 11.670
[RUSTC-TIMING] time test:false 10.552
[RUSTC-TIMING] rustc_parse test:false 85.717
[RUSTC-TIMING] rustc_expand test:false 65.933
[RUSTC-TIMING] rustc_expand test:false 65.933
[RUSTC-TIMING] rustc_builtin_macros test:false 47.002
[RUSTC-TIMING] rustc_middle test:false 119.423
Build completed unsuccessfully in 0:17:23
make: *** [Makefile:49: check] Error 1
Command has failed. Rerun with -v to see more details.
  local time: Fri Dec 13 19:41:02 UTC 2024
  network time: Fri, 13 Dec 2024 19:41:02 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

@bors
Copy link
Contributor

bors commented Dec 13, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 13, 2024
@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 13, 2024
@matthiaskrgr matthiaskrgr added the A-spurious Area: Spurious failures in builds (spuriously == for no apparent reason) label Dec 13, 2024
@bors
Copy link
Contributor

bors commented Dec 13, 2024

⌛ Testing commit 8cce32a with merge 4a204bebdfd5cbc3e7edabf41cda3c3ff8b74917...

@bors
Copy link
Contributor

bors commented Dec 14, 2024

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 4a204be to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 14, 2024
@bors bors merged commit 4a204be into rust-lang:master Dec 14, 2024
7 checks passed
@rustbot rustbot added this to the 1.85.0 milestone Dec 14, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#133900 Advent of tests/ui (misc cleanups and improvements) [1/N] 1d7329f3674c16836138c3e280042d2500193c3d (link)
#133937 Keep track of parse errors in mods and don't emit resolve… 45b0e9cbaccf6fdf0149d1c31bb97609ecf0c149 (link)
#133938 rustc_mir_dataflow cleanups, including some renamings 40de4987b193aaba03ac11811f8b8d799357962c (link)
#134058 interpret: reduce usage of TypingEnv::fully_monomorphized 5231bba251972d9500394c94af105ee8e7103706 (link)
#134130 Stop using driver queries in the public API d1a8421d6812147f3077fa4a58292d9eeb12fa50 (link)
#134140 Add AST support for unsafe binders 52edea838d17af6404fcd6b79ead948092962f53 (link)
#134229 Fix typos in docs on provenance 0db955a40c77f397d8ae936fc063bb3aa5f3b941 (link)

previous master: 327c7ee436

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4a204be): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 1
All ❌✅ (primary) - - 0

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.

mean range count
Regressions ❌
(primary)
2.1% [2.1%, 2.2%] 2
Regressions ❌
(secondary)
3.4% [1.0%, 6.0%] 10
Improvements ✅
(primary)
-3.0% [-3.0%, -3.0%] 1
Improvements ✅
(secondary)
-2.4% [-5.1%, -1.2%] 6
All ❌✅ (primary) 0.4% [-3.0%, 2.2%] 3

Cycles

Results (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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.7% [-4.3%, -1.9%] 12
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 769.449s -> 768.546s (-0.12%)
Artifact size: 331.04 MiB -> 333.11 MiB (0.63%)

@klensy
Copy link
Contributor

klensy commented Dec 14, 2024

Wow, +2 mb rustc_driver.so

flip1995 pushed a commit to flip1995/rust that referenced this pull request Dec 15, 2024
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-spurious Area: Spurious failures in builds (spuriously == for no apparent reason) merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.