Use the query system to allocate.

This commit is contained in:
Camille GILLOT 2020-03-27 20:26:20 +01:00
parent bd42ef6e4f
commit e56c400432
25 changed files with 137 additions and 204 deletions

View file

@ -347,15 +347,12 @@ pub fn provide(providers: &mut Providers<'_>) {
if tcx.sess.opts.actually_rustdoc {
// rustdoc needs to be able to document functions that use all the features, so
// whitelist them all
tcx.arena
.alloc(llvm_util::all_known_features().map(|(a, b)| (a.to_string(), b)).collect())
llvm_util::all_known_features().map(|(a, b)| (a.to_string(), b)).collect()
} else {
tcx.arena.alloc(
llvm_util::target_feature_whitelist(tcx.sess)
.iter()
.map(|&(a, b)| (a.to_string(), b))
.collect(),
)
llvm_util::target_feature_whitelist(tcx.sess)
.iter()
.map(|&(a, b)| (a.to_string(), b))
.collect()
}
};
@ -387,7 +384,7 @@ pub fn provide_extern(providers: &mut Providers<'_>) {
}));
}
tcx.arena.alloc(ret)
ret
};
}