Skip to content

Document import_trait_associated_functions feature - #2312

Open
camsteffen wants to merge 1 commit into
rust-lang:masterfrom
camsteffen:patch-1
Open

Document import_trait_associated_functions feature#2312
camsteffen wants to merge 1 commit into
rust-lang:masterfrom
camsteffen:patch-1

Conversation

@camsteffen

Copy link
Copy Markdown

@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Jul 13, 2026
@ehuss ehuss added the S-waiting-on-stabilization Waiting for a stabilization PR to be merged in the main Rust repository label Jul 28, 2026

r[items.use.path.disallowed]
They cannot import [associated items], [generic parameters], [local variables], paths with [`Self`], or [tool attributes]. More restrictions are described below.
They cannot import associated items of structs or enums, [generic parameters], [local variables], paths with [`Self`], or [tool attributes]. More restrictions are described below.

@DanielEScherzer DanielEScherzer Jul 28, 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.

also not from unions, right?

maybe instead

Suggested change
They cannot import associated items of structs or enums, [generic parameters], [local variables], paths with [`Self`], or [tool attributes]. More restrictions are described below.
They cannot import associated items (other than associated items of traits), [generic parameters], [local variables], paths with [`Self`], or [tool attributes]. More restrictions are described below.

so that if some other thing with associated items is added later we don't need to update the list here again?

View changes since the review

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good catch. I think we may as well list them out. But the sentence structure gets pretty unwieldy so we could split it into two sentences.

Suggested change
They cannot import associated items of structs or enums, [generic parameters], [local variables], paths with [`Self`], or [tool attributes]. More restrictions are described below.
They cannot import associated items of structs, enums or unions. They cannot import [generic parameters], [local variables], paths with [`Self`], or [tool attributes]. More restrictions are described below.

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

Labels

S-waiting-on-review Status: The marked PR is awaiting review from a maintainer S-waiting-on-stabilization Waiting for a stabilization PR to be merged in the main Rust repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants