Skip to content

fix: correct visibility and defaultness order on associated impl type alias - #7064

Merged
jieyouxu merged 1 commit into
rust-lang:mainfrom
ytmimi:issue_7057
Aug 25, 2026
Merged

fix: correct visibility and defaultness order on associated impl type alias#7064
jieyouxu merged 1 commit into
rust-lang:mainfrom
ytmimi:issue_7057

Conversation

@ytmimi

@ytmimi ytmimi commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Fixes #7057

@rustbot rustbot added the S-waiting-on-review Status: awaiting review from the assignee but also interested parties. label Aug 24, 2026
Comment thread src/items.rs
Comment on lines -1730 to +1731
rewrite_ty(rw_info, Some(bounds), ty_opt, rhs_hi, vis)
}?;
match defaultness {
ast::Defaultness::Default(..) => Ok(format!("default {result}")),
_ => Ok(result),
rewrite_ty(rw_info, Some(bounds), ty_opt, rhs_hi, vis, defaultness)

@ytmimi ytmimi Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is where the bug originally was. We were always adding default before the visibility.

View changes since the review

@jieyouxu jieyouxu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@jieyouxu
jieyouxu added this pull request to the merge queue Aug 25, 2026
@jieyouxu jieyouxu added F-impacts-stable-but-broken-formatting Expected formatting impact: affects stable formatting but where broken code was produced F-impacts-unstable-language Expected formatting impact: only affects code involving unstable language features and removed F-impacts-stable-but-broken-formatting Expected formatting impact: affects stable formatting but where broken code was produced labels Aug 25, 2026
Merged via the queue into rust-lang:main with commit 138684c Aug 25, 2026
27 checks passed
@rustbot rustbot added release-notes Needs an associated changelog entry and removed S-waiting-on-review Status: awaiting review from the assignee but also interested parties. labels Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-impacts-unstable-language Expected formatting impact: only affects code involving unstable language features release-notes Needs an associated changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rustfmt turns default pub into pub default which is invalid

3 participants