diff options
| author | lcnr <rust@lcnr.de> | 2022-05-02 09:31:56 +0200 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2022-05-10 12:07:35 +0200 |
| commit | 6c8265dc56d221dce7f3535ecf8cdee6b9d2d618 (patch) | |
| tree | 7200aad6861c9464113121f124b093c69038c2cb /compiler/rustc_incremental/src | |
| parent | fc128b67647533258e0bc52cc935438e6480732d (diff) | |
| download | rust-6c8265dc56d221dce7f3535ecf8cdee6b9d2d618.tar.gz rust-6c8265dc56d221dce7f3535ecf8cdee6b9d2d618.zip | |
only_local: always check for misuse
Diffstat (limited to 'compiler/rustc_incremental/src')
| -rw-r--r-- | compiler/rustc_incremental/src/persist/dirty_clean.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/rustc_incremental/src/persist/dirty_clean.rs b/compiler/rustc_incremental/src/persist/dirty_clean.rs index aaf24636598..424164d8760 100644 --- a/compiler/rustc_incremental/src/persist/dirty_clean.rs +++ b/compiler/rustc_incremental/src/persist/dirty_clean.rs @@ -183,10 +183,7 @@ pub struct DirtyCleanVisitor<'tcx> { impl<'tcx> DirtyCleanVisitor<'tcx> { /// Possibly "deserialize" the attribute into a clean/dirty assertion fn assertion_maybe(&mut self, item_id: LocalDefId, attr: &Attribute) -> Option<Assertion> { - if !attr.has_name(sym::rustc_clean) { - // skip: not rustc_clean/dirty - return None; - } + assert!(attr.has_name(sym::rustc_clean)); if !check_config(self.tcx, attr) { // skip: not the correct `cfg=` return None; @@ -384,7 +381,7 @@ impl<'tcx> DirtyCleanVisitor<'tcx> { fn check_item(&mut self, item_id: LocalDefId) { let item_span = self.tcx.def_span(item_id.to_def_id()); let def_path_hash = self.tcx.def_path_hash(item_id.to_def_id()); - for attr in self.tcx.get_attrs(item_id.to_def_id()).iter() { + for attr in self.tcx.get_attrs(item_id.to_def_id(), sym::rustc_clean) { let Some(assertion) = self.assertion_maybe(item_id, attr) else { continue; }; |
