Ease the transition to requiring features by just warning if there's no feature list

while we could make this change (it's all unstable after all), there are crates.io crates that use the feature and that the compiler depends upon. We can instead roll out this feature while still supporting the old way.
This commit is contained in:
Oliver Scherer 2019-02-03 13:57:03 +01:00
parent d3c212c552
commit 33bf81eec0
3 changed files with 20 additions and 10 deletions

View file

@ -387,7 +387,10 @@ impl Span {
/// `#[allow_internal_unstable]`).
pub fn allows_unstable(&self, feature: &str) -> bool {
match self.ctxt().outer().expn_info() {
Some(info) => info.allow_internal_unstable.iter().any(|&f| f == feature),
Some(info) => info
.allow_internal_unstable
.iter()
.any(|&f| f == feature || f == "allow_internal_unstable_backcompat_hack"),
None => false,
}
}