diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2023-08-23 20:16:22 +0200 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2023-08-23 20:16:22 +0200 |
| commit | 246a6a6589b118c0a08e449f981bb4ae07bc089a (patch) | |
| tree | 81d5740c9c8973cf38f534deabb8bb4b39417f3f | |
| parent | e41240e45b58ea1bcf42fe5503cafec4c9dca1a8 (diff) | |
| download | rust-246a6a6589b118c0a08e449f981bb4ae07bc089a.tar.gz rust-246a6a6589b118c0a08e449f981bb4ae07bc089a.zip | |
Extend comment on assertion
| -rw-r--r-- | compiler/rustc_span/src/hygiene.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_span/src/hygiene.rs b/compiler/rustc_span/src/hygiene.rs index 37ec2f0801c..ab57d5c6803 100644 --- a/compiler/rustc_span/src/hygiene.rs +++ b/compiler/rustc_span/src/hygiene.rs @@ -1410,8 +1410,12 @@ pub fn decode_syntax_context<D: Decoder, F: FnOnce(&mut D, u32) -> SyntaxContext &mut hygiene_data.syntax_context_data[ctxt.as_u32() as usize], ctxt_data, ); - // Make sure nothing weird happening while `decode_data` was running if cfg!(not(parallel_compiler)) { + // Make sure nothing weird happened while `decode_data` was running. + // We used `kw::Empty` for the dummy value and we expect nothing to be + // modifying the dummy entry. + // This does not hold for the parallel compiler as another thread may + // have inserted the fully decoded data. assert_eq!(dummy.dollar_crate_name, kw::Empty); } }); |
