Skip to content

Commit

Permalink
Add comments sugested by reviewer
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Jan 1, 2024
1 parent 3d9eebc commit 8fb8e6e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compiler/rustc_span/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 8fb8e6e

Please sign in to comment.