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

Convert the rest of the visitors to use VisitorResult #121576

Merged
merged 4 commits into from
Mar 5, 2024

Conversation

Jarcho
Copy link
Contributor

@Jarcho Jarcho commented Feb 25, 2024

Continuing from #121256.

@rustbot
Copy link
Collaborator

rustbot commented Feb 25, 2024

r? @wesleywiser

rustbot has assigned @wesleywiser.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative labels Feb 25, 2024
@rustbot
Copy link
Collaborator

rustbot commented Feb 25, 2024

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

Some changes occurred in const_evaluatable.rs

cc @BoxyUwU

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@@ -47,6 +47,83 @@ use std::ops::ControlFlow;

use crate::{self as ty, BoundVars, Interner, IntoKind, Lrc, TypeFlags};

/// Similar to the `Try` trait, but also implemented for `()`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to rustc_data_structures, so you can avoid all the new crate dependencies (even if you have to add some, they'll already be there transitively)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rustc_type_ir is already a transitive dependency for all of them via rustc_ast (or rustc_hir, which depends on rustc_ast).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh. Why does ast depend on type_ir

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah

# For Mutability and Movability, which could be uplifted into a common crate.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's avoid adding more direct deps and instead move this new trait and macros to data structures. It's not type system specific after all

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's with the nightly feature on rustc_type_ir and all the optional dependencies? Should I just ignore those or make the whole visit module depend on a feature?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I see your point. That's annoying. I guess it's the same with the movability and the mutability enums. If you feel really motivated rn, you could split those out into a new crate and get rid of the ast->type_ir dep

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just pulling them into their own crate is easy. Doing it in a way that's actually nice is probably going to be a fair bit of work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The split is done. Please move it to rustc_ast_ir and adjust the dependencies. Where useful, reexports could help reduce the amount of direct dependencies on rustc_ast_ir

Copy link
Contributor

@oli-obk oli-obk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the impls lgtm

@bors
Copy link
Contributor

bors commented Feb 26, 2024

☔ The latest upstream changes (presumably #119106) made this pull request unmergeable. Please resolve the merge conflicts.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 27, 2024
…-errors

Split rustc_type_ir to avoid rustc_ast from depending on it

unblocks rust-lang#121576

and resolves a FIXME in `rustc_ast`'s `Cargo.toml`

The new crate is tiny, but it will get bigger in rust-lang#121576
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 27, 2024
…-errors

Split rustc_type_ir to avoid rustc_ast from depending on it

unblocks rust-lang#121576

and resolves a FIXME in `rustc_ast`'s `Cargo.toml`

The new crate is tiny, but it will get bigger in rust-lang#121576
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Feb 28, 2024
…-errors

Split rustc_type_ir to avoid rustc_ast from depending on it

unblocks rust-lang#121576

and resolves a FIXME in `rustc_ast`'s `Cargo.toml`

The new crate is tiny, but it will get bigger in rust-lang#121576
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Feb 28, 2024
…-errors

Split rustc_type_ir to avoid rustc_ast from depending on it

unblocks rust-lang#121576

and resolves a FIXME in `rustc_ast`'s `Cargo.toml`

The new crate is tiny, but it will get bigger in rust-lang#121576
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 28, 2024
Rollup merge of rust-lang#121695 - oli-obk:split_ty_utils, r=compiler-errors

Split rustc_type_ir to avoid rustc_ast from depending on it

unblocks rust-lang#121576

and resolves a FIXME in `rustc_ast`'s `Cargo.toml`

The new crate is tiny, but it will get bigger in rust-lang#121576
@wesleywiser wesleywiser added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 28, 2024
@rust-log-analyzer

This comment has been minimized.

@Jarcho
Copy link
Contributor Author

Jarcho commented Mar 2, 2024

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 2, 2024
@@ -15,8 +15,8 @@

use crate::ast::*;

use core::ops::ControlFlow;

use rustc_ast_ir::visit::VisitorResult;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
use rustc_ast_ir::visit::VisitorResult;
pub use rustc_ast_ir::visit::VisitorResult;

And then get rid of all the direct dependencies on rustc_ast_ir

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@oli-obk
Copy link
Contributor

oli-obk commented Mar 4, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Mar 4, 2024

📌 Commit e1e02a2 has been approved by oli-obk

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 Mar 4, 2024
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Mar 4, 2024
Convert the rest of the visitors to use `VisitorResult`

Continuing from rust-lang#121256.
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 4, 2024
…llaumeGomez

Rollup of 9 pull requests

Successful merges:

 - rust-lang#120976 (constify a couple thread_local statics)
 - rust-lang#121576 (Convert the rest of the visitors to use `VisitorResult`)
 - rust-lang#121826 (Use root obligation on E0277 for some cases)
 - rust-lang#121928 (Extract an arguments struct for `Builder::then_else_break`)
 - rust-lang#121958 (Fix redundant import errors for preload extern crate)
 - rust-lang#121959 (Removing absolute path in proc-macro)
 - rust-lang#121968 (Don't run test_get_os_named_thread on win7)
 - rust-lang#121977 (Doc: Fix incorrect reference to integer in Atomic{Ptr,Bool}::as_ptr.)
 - rust-lang#121978 (Fix duplicated path in the "not found dylib" error)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Mar 5, 2024

☔ The latest upstream changes (presumably #122012) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 5, 2024
@oli-obk
Copy link
Contributor

oli-obk commented Mar 5, 2024

@bors p=1 bitrotty

please rebase, we'll land with priority next time

@oli-obk
Copy link
Contributor

oli-obk commented Mar 5, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Mar 5, 2024

📌 Commit 228eb38 has been approved by oli-obk

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 5, 2024
@bors
Copy link
Contributor

bors commented Mar 5, 2024

⌛ Testing commit 228eb38 with merge b6d2d84...

@bors
Copy link
Contributor

bors commented Mar 5, 2024

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing b6d2d84 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 5, 2024
@bors bors merged commit b6d2d84 into rust-lang:master Mar 5, 2024
12 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Mar 5, 2024
@bors bors mentioned this pull request Mar 5, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b6d2d84): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

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

Max RSS (memory usage)

Results

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)
-3.7% [-3.7%, -3.7%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -3.7% [-3.7%, -3.7%] 1

Cycles

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

Binary size

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

Bootstrap: 644.259s -> 646.18s (0.30%)
Artifact size: 175.02 MiB -> 175.03 MiB (0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants