aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-31 11:30:45 +0100
committerGitHub <[email protected]>2021-03-31 11:30:45 +0100
commitb6e21a4ca45087b0a0bbe10948a4b9f11e5ee7fb (patch)
tree6bec0d5e665425ddea41e698e54937b41c2fb0e2
parent55d7d715902a5b71ded8aac6a33a3f1697f2e51e (diff)
parent5c0c09c9c32231843b22a17a467c4170530bd220 (diff)
Merge #8269
8269: internal: document semantics for missing names r=flodiebold a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
-rw-r--r--crates/hir_expand/src/name.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/hir_expand/src/name.rs b/crates/hir_expand/src/name.rs
index cd691b1d2..203ebbe85 100644
--- a/crates/hir_expand/src/name.rs
+++ b/crates/hir_expand/src/name.rs
@@ -55,6 +55,15 @@ impl Name {
55 } 55 }
56 } 56 }
57 57
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.
58 pub fn missing() -> Name { 67 pub fn missing() -> Name {
59 Name::new_text("[missing name]".into()) 68 Name::new_text("[missing name]".into())
60 } 69 }