Don't provide backend_optimization_level query for extern crates

This commit is contained in:
bjorn3 2021-01-23 11:11:51 +01:00
parent bbc01bb624
commit 794880c6b5
2 changed files with 2 additions and 3 deletions

View File

@ -783,7 +783,7 @@ impl CrateInfo {
}
}
pub fn provide_both(providers: &mut Providers) {
pub fn provide(providers: &mut Providers) {
providers.backend_optimization_level = |tcx, cratenum| {
let for_speed = match tcx.sess.opts.optimize {
// If globally no optimisation is done, #[optimize] has no effect.

View File

@ -160,13 +160,12 @@ pub struct CodegenResults {
pub fn provide(providers: &mut Providers) {
crate::back::symbol_export::provide(providers);
crate::base::provide_both(providers);
crate::base::provide(providers);
crate::target_features::provide(providers);
}
pub fn provide_extern(providers: &mut Providers) {
crate::back::symbol_export::provide_extern(providers);
crate::base::provide_both(providers);
}
/// Checks if the given filename ends with the `.rcgu.o` extension that `rustc`