Skip to content

[pull] master from rust-lang:master#104

Merged
pull[bot] merged 3 commits into
Arstman:masterfrom
rust-lang:master
Apr 13, 2026
Merged

[pull] master from rust-lang:master#104
pull[bot] merged 3 commits into
Arstman:masterfrom
rust-lang:master

Conversation

@pull

@pull pull Bot commented Apr 13, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

traviscross and others added 3 commits April 4, 2026 19:53
The `self` keyword in a use brace (e.g., `use m::{self}`) creates a
binding for the parent entity.  The note in `items.use.self.intro`
says that `self` "means the current module of the parent segment", but
there's no rule restricting what the parent can be.

The parent path must resolve to a module, enumeration, or trait --
i.e., entities that act as modules for name resolution.  Using `self`
with other entities such as structs or unions is rejected by the
compiler (as of rust-lang/rust#152996).

Let's add a rule to make this restriction explicit.
In the prior commit, we added a link reference definition for "brace
syntax". Let's update the other use in the chapter to use that.
Clarify that `{self}` imports require a module parent
@pull pull Bot locked and limited conversation to collaborators Apr 13, 2026
@pull pull Bot added the ⤵️ pull label Apr 13, 2026
@pull pull Bot merged commit e7c0021 into Arstman:master Apr 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants