Skip to content

fix(doc): double-reexport can lead to empty module#11665

Merged
asterite merged 5 commits intomasterfrom
ab/nargo-doc-double-reexport-bug
Mar 5, 2026
Merged

fix(doc): double-reexport can lead to empty module#11665
asterite merged 5 commits intomasterfrom
ab/nargo-doc-double-reexport-bug

Conversation

@asterite
Copy link
Collaborator

Description

Problem

Resolves an issue mentioned in AztecProtocol/aztec-packages#20747

Summary

The bug happened in code like this:

mod one {
    pub mod two {
        mod empty {
            pub struct Empty {}
        }
        pub use empty::Empty;
    }
}

pub use one::two;

The way the doc generator works is by checking re-exports, first in submodules:

  1. The re-export pub use empty::Empty in two is found. That causes the module two to be changed in a way that pub struct Empty is put inside two. That way two ends up having Empty as a direct children.
  2. The re-export pub use one::two is found. Here we do the same, by placing two directly under one.

The problem was that the two that was found was the one before point 1, where it didn't have Empty directly inside it. This happened because of the way we link things (we store them in a map, and when something referenced in that map changed, we didn't update the map accordingly).

Additional Context

  1. I also added some Debug derives because otherwise it was kind of hard to debug this
  2. It would be nice to have tests for these things but I'm still not sure what's the best way to do that

User Documentation

Check one:

  • No user documentation needed.
  • Changes in docs/ included in this PR.
  • [For Experimental Features] Changes in docs/ to be submitted in a separate PR.

PR Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Brillig Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: b328bb5 Previous: 7ae460f Ratio
rollup-tx-merge 0.002 s 0.001 s 2

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

@asterite asterite requested a review from a team February 23, 2026 22:09
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 281f266 Previous: 7ae460f Ratio
rollup-checkpoint-merge 0.003 s 0.002 s 1.50

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Test Suite Duration'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: b328bb5 Previous: 7ae460f Ratio
test_report_zkpassport_noir_rsa_ 2 s 1 s 2

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

@asterite asterite enabled auto-merge February 26, 2026 01:14
@asterite asterite added this pull request to the merge queue Mar 5, 2026
Merged via the queue into master with commit 85aae28 Mar 5, 2026
137 checks passed
@asterite asterite deleted the ab/nargo-doc-double-reexport-bug branch March 5, 2026 16:10
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