8269: internal: document semantics for missing names r=flodiebold a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2021-03-31 10:30:45 +00:00 committed by GitHub
commit b6e21a4ca4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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