Skip to content

Commit

Permalink
Auto merge of rust-lang#109001 - matthiaskrgr:rollup-a3agnwp, r=matth…
Browse files Browse the repository at this point in the history
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#105798 (Relax ordering rules for `asm!` operands)
 - rust-lang#105962 (Stabilize path_as_mut_os_str)
 - rust-lang#106085 (use problem matchers for tidy CI)
 - rust-lang#107711 (Stabilize movbe target feature)
 - rust-lang#108017 (Add `--no-undefined-version` link flag and fix associated breakage)
 - rust-lang#108891 (Remove an extraneous include)
 - rust-lang#108902 (no more do while :<)
 - rust-lang#108912 (Document tool lints)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Mar 11, 2023
2 parents be445e1 + b23a3a3 commit 7e23d77
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions src/allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use crate::prelude::*;

use rustc_ast::expand::allocator::{AllocatorKind, AllocatorTy, ALLOCATOR_METHODS};
use rustc_codegen_ssa::base::allocator_kind_for_codegen;
use rustc_session::config::OomStrategy;
use rustc_span::symbol::sym;

Expand All @@ -13,24 +14,15 @@ pub(crate) fn codegen(
module: &mut impl Module,
unwind_context: &mut UnwindContext,
) -> bool {
let any_dynamic_crate = tcx.dependency_formats(()).iter().any(|(_, list)| {
use rustc_middle::middle::dependency_format::Linkage;
list.iter().any(|&linkage| linkage == Linkage::Dynamic)
});
if any_dynamic_crate {
false
} else if let Some(kind) = tcx.allocator_kind(()) {
codegen_inner(
module,
unwind_context,
kind,
tcx.alloc_error_handler_kind(()).unwrap(),
tcx.sess.opts.unstable_opts.oom,
);
true
} else {
false
}
let Some(kind) = allocator_kind_for_codegen(tcx) else { return false };
codegen_inner(
module,
unwind_context,
kind,
tcx.alloc_error_handler_kind(()).unwrap(),
tcx.sess.opts.unstable_opts.oom,
);
true
}

fn codegen_inner(
Expand Down

0 comments on commit 7e23d77

Please sign in to comment.