Skip to content

Commit

Permalink
Mark has_global_allocator query as eval_always
Browse files Browse the repository at this point in the history
Fixes #84252

This query reads from untracked global state in `CStore`.
  • Loading branch information
Aaron1011 committed Apr 16, 2021
1 parent 0cc00c4 commit 169a221
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_middle/src/query/mod.rs
Expand Up @@ -1055,6 +1055,8 @@ rustc_queries! {
desc { "checking if the crate is_compiler_builtins" }
}
query has_global_allocator(_: CrateNum) -> bool {
// This query depends on untracked global state in CStore
eval_always
fatal_cycle
desc { "checking if the crate has_global_allocator" }
}
Expand Down
12 changes: 12 additions & 0 deletions src/test/incremental/issue-84252-global-alloc.rs
@@ -0,0 +1,12 @@
// revisions: cfail1 cfail2
// build-pass

#![crate_type="lib"]
#![crate_type="cdylib"]

#[allow(unused_imports)]
use std::alloc::System;

#[cfg(cfail1)]
#[global_allocator]
static ALLOC: System = System;

0 comments on commit 169a221

Please sign in to comment.