Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Document association of generic arguments in path segments

未关闭
#2,275 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
55/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
冷清
技术栈
rust
领域
documentation

调研方向

首先比较 issue 中的两个枚举变体表达式,以及 Rust Reference PR 2165 提议的泛型参数相关内容和相关的 Rust PR 154971。确定这些形式是否等价,并识别其他路径段情况;完成的标准是在 Reference 中记录已确认的关联规则和示例。

由索引模型根据 Issue 内容生成。

描述

A-generics

There are some subtle behaviors around where generic arguments can appear in a path, particularly with enum variants. For example:

enum E<T> {
    V1 { x: T },
}

fn main() {
    // These seem to be the same.
    E::V1::<i32> { x: 1 };
    E::<i32>::V1 { x: 1 };
}

Are these exactly the same? I'm wondering if there are other oddities like this? This came up when looking at https://github.com/rust-lang/rust/pull/154971.

https://github.com/rust-lang/reference/pull/2165 is adding more documentation on generic arguments and how they are associated, but I don't think it covers this.

主要语言
Rust
星标
1.6k
派生
614
平均合并
20 小时 25 分钟
30 天内合并 PR
9

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

rust-lang/reference 的其他 Issue

查看 rust-lang/reference 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。