Record all declared features.

Currently `rust_20XX_preview` features aren't recorded as declared even
when they are explicit declared. Similarly, redundant edition-dependent
features (e.g. `test_2018_feature`) aren't recorded as declared.

This commit marks them as recorded. There is no detectable functional
change, but it makes things more consistent.
This commit is contained in:
Nicholas Nethercote 2023-10-05 16:24:31 +11:00
parent eb209057b1
commit 95d1aa075f

View File

@ -124,6 +124,8 @@ pub fn features(sess: &Session, krate_attrs: &[Attribute]) -> Features {
edition,
});
}
features.declared_lang_features.push((name, mi.span(), None));
features.declared_features.insert(name);
continue;
}
@ -137,6 +139,8 @@ pub fn features(sess: &Session, krate_attrs: &[Attribute]) -> Features {
feature: name,
edition: features_edition,
});
features.declared_lang_features.push((name, mi.span(), None));
features.declared_features.insert(name);
continue;
}