Skip to content

Commit 53add5d

Browse files
committed
Add support for feature attributes on macros
1 parent 1209891 commit 53add5d

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/librustc/middle/lib_features.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,5 +171,8 @@ pub fn collect<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) -> LibFeatures {
171171
}
172172
collector.collect_from_attrs(&tcx.hir.krate().attrs);
173173
tcx.hir.krate().visit_all_item_likes(&mut collector);
174+
for exported_macro in &tcx.hir.krate().exported_macros {
175+
collector.collect_from_attrs(&exported_macro.attrs);
176+
}
174177
collector.lib_features
175178
}

src/librustc/middle/stability.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -840,10 +840,6 @@ pub fn check_unused_or_stable_features<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
840840
// FIXME(varkor): we don't properly handle lib features behind `cfg` attributes yet,
841841
// but it happens just to affect `libc`, so we're just going to hard-code it for now.
842842
remaining_lib_features.remove(&Symbol::intern("libc"));
843-
// FIXME(varkor): we have a problem gathering features on macros right now, so we're
844-
// going to hard-code some features here for now.
845-
remaining_lib_features.remove(&Symbol::intern("await_macro"));
846-
remaining_lib_features.remove(&Symbol::intern("unstable_macros"));
847843

848844
for (feature, stable) in tcx.lib_features().iter() {
849845
if let Some(since) = stable {

0 commit comments

Comments
 (0)