Skip to content

Commit

Permalink
Add comment about why the regular unused-attributes infrastructure
Browse files Browse the repository at this point in the history
is not used for #[rustc_dirty]/#[rustc_clean].
  • Loading branch information
michaelwoerister committed Feb 6, 2017
1 parent 14191ee commit ab3c826
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/librustc_incremental/persist/dirty_clean.rs
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
});
}
Expand Down

0 comments on commit ab3c826

Please sign in to comment.