Skip to content

Commit cd9b305

Browse files
committed
Auto merge of #84260 - Aaron1011:global-alloc-eval-always, r=cjgillot
Mark `has_global_allocator` query as `eval_always` Fixes #84252 This query reads from untracked global state in `CStore`.
2 parents 03301ef + 169a221 commit cd9b305

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

compiler/rustc_middle/src/query/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,8 @@ rustc_queries! {
10551055
desc { "checking if the crate is_compiler_builtins" }
10561056
}
10571057
query has_global_allocator(_: CrateNum) -> bool {
1058+
// This query depends on untracked global state in CStore
1059+
eval_always
10581060
fatal_cycle
10591061
desc { "checking if the crate has_global_allocator" }
10601062
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// revisions: cfail1 cfail2
2+
// build-pass
3+
4+
#![crate_type="lib"]
5+
#![crate_type="cdylib"]
6+
7+
#[allow(unused_imports)]
8+
use std::alloc::System;
9+
10+
#[cfg(cfail1)]
11+
#[global_allocator]
12+
static ALLOC: System = System;

0 commit comments

Comments
 (0)