Skip to content

tests/ui/union: add annotations for reference rules#152826

Open
DanielEScherzer wants to merge 1 commit into
rust-lang:mainfrom
DanielEScherzer:test-references-unions
Open

tests/ui/union: add annotations for reference rules#152826
DanielEScherzer wants to merge 1 commit into
rust-lang:mainfrom
DanielEScherzer:test-references-unions

Conversation

@DanielEScherzer

Copy link
Copy Markdown
Contributor

r? lang-docs

@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. labels Feb 18, 2026
@JohnTitor

Copy link
Copy Markdown
Member

r? @ehuss

@rustbot rustbot assigned ehuss and unassigned JohnTitor Feb 18, 2026
@Kivooeo

Kivooeo commented Feb 18, 2026

Copy link
Copy Markdown
Member

wondering like what's the point in adding references in ui tests?

@DanielEScherzer

Copy link
Copy Markdown
Contributor Author

To make it easier to confirm which rules are tested (I guess - I just found this as a place that I can help out, I'm not sure if that is the reasoning behind the initial addition of the tracking)

@wesleywiser wesleywiser removed the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 16, 2026
@DanielEScherzer

Copy link
Copy Markdown
Contributor Author

@rustbot label +A-docs

@rustbot rustbot added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label Apr 21, 2026
@Enselic

This comment was marked as outdated.

@Enselic

Enselic commented Jul 10, 2026

Copy link
Copy Markdown
Member

For reference: rust-lang/compiler-team#783

r? spec

@rustbot rustbot added the T-spec Relevant to the spec team. label Jul 10, 2026
@rustbot

This comment was marked as outdated.

@Enselic

Enselic commented Jul 10, 2026

Copy link
Copy Markdown
Member

Trying again:

r? spec

@rustbot rustbot assigned traviscross and unassigned ehuss Jul 10, 2026

@traviscross traviscross left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for adding these annotations.

View changes since this review

//@ run-pass
//@ reference: items.union.common-storage
//@ reference: items.union.fields.read
//@ reference: type.union.constraint

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In what sense is this file testing type.union.constraint?

@@ -1,4 +1,8 @@
//@ run-pass
//@ reference: items.union.pattern

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
//@ reference: items.union.pattern

The cite of the parent rule should be dropped; the child rules are cited and the tooling flags this.

@@ -1,3 +1,4 @@
//@ reference: items.union.init.intro

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thoughts on items.union.pattern.one-field, patterns.struct.constraint-union, and expr.struct.field.union-constraint?

Comment on lines +2 to +3
//@ reference: safety.unsafe-union-access
//@ reference: type.union.safety

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thoughts on items.union.fields.write-safety and items.union.pattern.safety?

Comment on lines +3 to +5
//@ reference: items.union.pattern.intro
//@ reference: items.union.pattern.safety
//@ reference: items.union.pattern.subpattern

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thoughts on patterns.struct.refutable?

Comment on lines +1 to +6
//@ reference: items.union.field-restrictions
//@ reference: items.union.field-copy
//@ reference: items.union.field-references
//@ reference: items.union.field-manually-drop
//@ reference: items.union.field-tuple
//@ reference: type.union.constraint

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thoughts on items.union.drop?

@@ -1,4 +1,5 @@
//@ run-pass
//@ reference: items.union.drop

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thoughts on destructors.manually-suppressing?

//@ reference: items.union.pattern
//@ reference: items.union.pattern.intro
//@ reference: items.union.pattern.safety
//@ reference: items.union.pattern.subpattern

@ehuss ehuss Jul 13, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

items.union.pattern.subpattern has been deleted in rust-lang/reference#2303.

View changes since the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-spec Relevant to the spec team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants