Skip to content

Conversation

@joshlf
Copy link
Member

@joshlf joshlf commented Feb 7, 2026


Latest Update: v33 — Compare vs v32

📚 Full Patch History

Links show the diff between the row version and the column version.

Version v32 v31 v30 v29 v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v33 v32 v31 v30 v29 v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v32 v31 v30 v29 v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v31 v30 v29 v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v30 v29 v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v29 v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v8 v7 v6 v5 v4 v3 v2 v1 Base
v7 v6 v5 v4 v3 v2 v1 Base
v6 v5 v4 v3 v2 v1 Base
v5 v4 v3 v2 v1 Base
v4 v3 v2 v1 Base
v3 v2 v1 Base
v2 v1 Base
v1 Base
⬇️ Download this PR

Branch

git fetch origin refs/heads/G93b59d9ea956b7e2e06b2e91c45dea803a391801 && git checkout -b pr-G93b59d9ea956b7e2e06b2e91c45dea803a391801 FETCH_HEAD

Checkout

git fetch origin refs/heads/G93b59d9ea956b7e2e06b2e91c45dea803a391801 && git checkout FETCH_HEAD

Cherry Pick

git fetch origin refs/heads/G93b59d9ea956b7e2e06b2e91c45dea803a391801 && git cherry-pick FETCH_HEAD

Pull

git pull origin refs/heads/G93b59d9ea956b7e2e06b2e91c45dea803a391801

Stacked PRs enabled by GHerrit.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @joshlf, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the hermes tool by enabling it to discover and collect mod foo; declarations within Rust source code. This is achieved through a refactoring of the parsing logic, which now identifies these module declarations during the Abstract Syntax Tree (AST) traversal. The relevant information, such as the module name and any #[path] attributes, is stored in a newly introduced UnloadedModule struct. This foundational change provides hermes with a more comprehensive understanding of a Rust project's module structure, paving the way for future features that may rely on module resolution or cross-file analysis.

Highlights

  • Module Declaration Discovery: The hermes tool can now identify and collect mod foo; declarations in Rust source files, which was not previously supported.
  • New UnloadedModule Struct: A new data structure UnloadedModule has been introduced to represent these discovered module declarations, capturing their name, optional #[path] attribute, and source span.
  • Refactored Parsing API: The core parsing functions have been renamed (e.g., visit_hermes_items to scan_compilation_unit) and updated to return or accept callbacks for UnloadedModule instances, alongside the existing ParsedLeanItem processing.
  • Path Attribute Extraction: A new utility function extract_path_attr was added to correctly parse #[path = "..."] attributes associated with module declarations.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • tools/hermes/src/main.rs
    • Updated the call to the parsing function from read_file_and_visit_hermes_items to read_file_and_scan_compilation_unit.
    • Adjusted to handle the new return type of the parsing function, which now includes a list of UnloadedModules.
  • tools/hermes/src/parse.rs
    • Introduced UnloadedModule struct to represent mod foo; declarations.
    • Renamed visit_hermes_items to scan_compilation_unit and read_file_and_visit_hermes_items to read_file_and_scan_compilation_unit.
    • Modified parsing functions to collect and return UnloadedModule instances.
    • Updated HermesVisitor to accept a new callback for UnloadedModules and to detect mod foo; declarations during AST traversal.
    • Added extract_path_attr function to parse #[path = "..."] attributes.
    • Updated internal test calls to reflect the new function names and signatures.
  • tools/hermes/src/shadow.rs
    • Added a TODO comment regarding the timing of directory removal.
  • tools/hermes/src/transform.rs
    • Updated the call to the parsing function from visit_hermes_items to scan_compilation_unit.
  • tools/hermes/src/ui_test_shim.rs
    • Updated the call to the parsing function from read_file_and_visit_hermes_items to read_file_and_scan_compilation_unit.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the parsing logic to discover mod foo; declarations, in addition to items with lean doc-blocks. The changes are well-structured, renaming several functions to better reflect their new purpose of scanning a full compilation unit. My review includes a critical fix for error handling where the program could panic instead of returning an error, a suggestion to improve code readability by flattening nested conditionals, and a note on an unused variable.

where
F: FnMut(&str, Result<ParsedLeanItem, HermesError>),
{
let source = fs::read_to_string(path).expect("Failed to read file");
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The function is declared to return a Result<..., io::Error>, but .expect() will cause a panic on file read failure instead of propagating the io::Error. Using the ? operator will correctly propagate the error, aligning with the function's signature and preventing a potential crash.

Suggested change
let source = fs::read_to_string(path).expect("Failed to read file");
let source = fs::read_to_string(path)?;

});

let source = res.unwrap_or_else(|e| {
let (source, unloaded_modules) = res.unwrap_or_else(|e| {
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The unloaded_modules variable is not used after being assigned. This will cause a compiler warning. If it's intended for use in a future change, consider prefixing it with an underscore to suppress the warning.

Suggested change
let (source, unloaded_modules) = res.unwrap_or_else(|e| {
let (source, _unloaded_modules) = res.unwrap_or_else(|e| {

Comment on lines +367 to +377
for attr in attrs {
if attr.path().is_ident("path") {
if let Meta::NameValue(nv) = &attr.meta {
if let Expr::Lit(expr_lit) = &nv.value {
if let Lit::Str(lit_str) = &expr_lit.lit {
return Some(lit_str.value());
}
}
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The nested if let statements make the code harder to read. This can be refactored using let-else statements to flatten the structure and improve readability.

    for attr in attrs {
        if !attr.path().is_ident("path") {
            continue;
        }
        let Meta::NameValue(nv) = &attr.meta else { continue; };
        let Expr::Lit(expr_lit) = &nv.value else { continue; };
        let Lit::Str(lit_str) = &expr_lit.lit else { continue; };
        return Some(lit_str.value());
    }

@codecov-commenter
Copy link

codecov-commenter commented Feb 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.87%. Comparing base (755b70a) to head (b5601de).

Additional details and impacted files
@@                            Coverage Diff                             @@
##           G48b27aa33306f1b4bae6f7996a68c1a1869d0a9a    #3008   +/-   ##
==========================================================================
  Coverage                                      91.87%   91.87%           
==========================================================================
  Files                                             20       20           
  Lines                                           6057     6057           
==========================================================================
  Hits                                            5565     5565           
  Misses                                           492      492           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@joshlf
Copy link
Member Author

joshlf commented Feb 7, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the capability to discover mod foo; declarations within Rust source files. This is a key step towards understanding the full module structure of a crate. The implementation involves renaming several parsing functions for better clarity, enhancing the HermesVisitor to identify module declarations without a body, and introducing a new UnloadedModule struct. The changes are logical and well-executed. I have a couple of minor suggestions to handle unused variables, which will prevent compiler warnings.

});

let source = res.unwrap_or_else(|e| {
let (source, unloaded_modules) = res.unwrap_or_else(|e| {
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The unloaded_modules variable is captured but not used within this function, which will trigger a compiler warning. Since this is likely intended for use in a future change in this PR stack, you can prefix the variable with an underscore to indicate it's intentionally unused for now.

Suggested change
let (source, unloaded_modules) = res.unwrap_or_else(|e| {
let (source, _unloaded_modules) = res.unwrap_or_else(|e| {

gherrit-pr-id: G93b59d9ea956b7e2e06b2e91c45dea803a391801
@joshlf joshlf force-pushed the G93b59d9ea956b7e2e06b2e91c45dea803a391801 branch from 030bb4e to b5601de Compare February 11, 2026 18:52
@joshlf joshlf force-pushed the G48b27aa33306f1b4bae6f7996a68c1a1869d0a9a branch from 4d110ea to 755b70a Compare February 11, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants