summary refs log tree commit diff
path: root/compiler/rustc_span/src
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2024-01-01 19:10:42 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2024-01-01 19:11:50 +0000
commit8fb8e6eefb27313523be937ff9de557dd3bcf4fe (patch)
tree53fdd47302d2d5cb8273472b216cb979c2387391 /compiler/rustc_span/src
parent3d9eebc21f4ec00e75fc5dd23f66835634b2e77b (diff)
downloadrust-8fb8e6eefb27313523be937ff9de557dd3bcf4fe.tar.gz
rust-8fb8e6eefb27313523be937ff9de557dd3bcf4fe.zip
Add comments sugested by reviewer
Diffstat (limited to 'compiler/rustc_span/src')
-rw-r--r--compiler/rustc_span/src/lib.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs
index 9bd3cabcc85..7f7f05b7978 100644
--- a/compiler/rustc_span/src/lib.rs
+++ b/compiler/rustc_span/src/lib.rs
@@ -1025,6 +1025,8 @@ rustc_index::newtype_index! {
     pub struct AttrId {}
 }
 
+/// This trait is used to allow encoder specific encodings of certain types.
+/// It is similar to rustc_type_ir's TyEncoder.
 pub trait SpanEncoder: Encoder {
     fn encode_span(&mut self, span: Span);
     fn encode_symbol(&mut self, symbol: Symbol);
@@ -1117,6 +1119,9 @@ impl<E: SpanEncoder> Encodable<E> for AttrId {
         // A fresh id will be generated when decoding
     }
 }
+
+/// This trait is used to allow decoder specific encodings of certain types.
+/// It is similar to rustc_type_ir's TyDecoder.
 pub trait SpanDecoder: Decoder {
     fn decode_span(&mut self) -> Span;
     fn decode_symbol(&mut self) -> Symbol;