about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@posteo.net>2017-02-06 03:56:58 -0500
committerMichael Woerister <michaelwoerister@posteo.net>2017-02-06 03:56:58 -0500
commitab3c8269f4d73d4760e99aca82411f954a11e571 (patch)
tree58e685a36091bb65528e5731aa382341244ea348
parent14191eed41a815cb016e4705c6f11303687a0de5 (diff)
Add comment about why the regular unused-attributes infrastructure
is not used for #[rustc_dirty]/#[rustc_clean].
-rw-r--r--src/librustc_incremental/persist/dirty_clean.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/librustc_incremental/persist/dirty_clean.rs b/src/librustc_incremental/persist/dirty_clean.rs
index 2b6fd25e110..3da126bc1a0 100644
--- a/src/librustc_incremental/persist/dirty_clean.rs
+++ b/src/librustc_incremental/persist/dirty_clean.rs
@@ -89,6 +89,9 @@ pub fn check_dirty_clean_annotations<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
     };
     intravisit::walk_crate(&mut all_attrs, krate);
 
+    // Note that we cannot use the existing "unused attribute"-infrastructure
+    // here, since that is running before trans. This is also the reason why
+    // all trans-specific attributes are `Whitelisted` in syntax::feature_gate.
     all_attrs.report_unchecked_attrs(&dirty_clean_visitor.checked_attrs);
 }
 
@@ -237,6 +240,9 @@ pub fn check_dirty_clean_metadata<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
         };
         intravisit::walk_crate(&mut all_attrs, krate);
 
+        // Note that we cannot use the existing "unused attribute"-infrastructure
+        // here, since that is running before trans. This is also the reason why
+        // all trans-specific attributes are `Whitelisted` in syntax::feature_gate.
         all_attrs.report_unchecked_attrs(&dirty_clean_visitor.checked_attrs);
     });
 }