Skip to content

Commit

Permalink
Rollup merge of #81297 - bjorn3:no_extern_backend_optimization_level_…
Browse files Browse the repository at this point in the history
…query_provider, r=cjgillot

Don't provide backend_optimization_level query for extern crates

Fixes #71291
  • Loading branch information
jonas-schievink authored Jan 24, 2021
2 parents 70be327 + 794880c commit 9089dd2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_codegen_ssa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit 9089dd2

Please sign in to comment.