Skip to content

Commit 9f3be46

Browse files
committed
auto merge of #10866 : ktt3ja/rust/edit-doc, r=huonw
A comment that I previously added to ast::DefStruct is incorrect. Here's the modification.
2 parents 898d2c3 + 1f80ec4 commit 9f3be46

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/libsyntax/ast.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,14 @@ pub enum Def {
254254
NodeId, // expr node that creates the closure
255255
NodeId), // id for the block/body of the closure expr
256256

257-
/// Note that if it's a tuple struct's definition, the node id
258-
/// of the DefId refers to the struct_def.ctor_id (whereas normally it
259-
/// refers to the item definition's id).
257+
/// Note that if it's a tuple struct's definition, the node id of the DefId
258+
/// may either refer to the item definition's id or the struct_def.ctor_id.
259+
///
260+
/// The cases that I have encountered so far are (this is not exhaustive):
261+
/// - If it's a ty_path referring to some tuple struct, then DefMap maps
262+
/// it to a def whose id is the item definition's id.
263+
/// - If it's an ExprPath referring to some tuple struct, then DefMap maps
264+
/// it to a def whose id is the struct_def.ctor_id.
260265
DefStruct(DefId),
261266
DefTyParamBinder(NodeId), /* struct, impl or trait with ty params */
262267
DefRegion(NodeId),

0 commit comments

Comments
 (0)