Skip to content

Commit b6e21a4

Browse files
bors[bot]matklad
andauthored
Merge #8269
8269: internal: document semantics for missing names r=flodiebold a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
2 parents 55d7d71 + 5c0c09c commit b6e21a4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

crates/hir_expand/src/name.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ impl Name {
5555
}
5656
}
5757

58+
/// A fake name for things missing in the source code.
59+
///
60+
/// For example, `impl Foo for {}` should be treated as a trait impl for a
61+
/// type with a missing name. Similarly, `struct S { : u32 }` should have a
62+
/// single field with a missing name.
63+
///
64+
/// Ideally, we want a `gensym` semantics for missing names -- each missing
65+
/// name is equal only to itself. It's not clear how to implement this in
66+
/// salsa though, so we punt on that bit for a moment.
5867
pub fn missing() -> Name {
5968
Name::new_text("[missing name]".into())
6069
}

0 commit comments

Comments
 (0)