diff options
| -rw-r--r-- | compiler/rustc_span/src/lib.rs | 5 |
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; |
