Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 12 pull requests #90137

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
aa3bf01
Cleanup LLVM multi-threading checks
tmiasko Oct 12, 2021
4333091
Update E0637 description to mention `&` w/o an explicit lifetime name
JohnTitor Oct 15, 2021
d2470e7
rustc_ast: Turn `MutVisitor::token_visiting_enabled` into a constant
petrochenkov Oct 17, 2021
7581bae
Fix const qualification when executed after promotion
tmiasko Oct 19, 2021
c97cf7f
Reject closures in patterns
tmiasko Oct 18, 2021
21d02bf
Add a regression test for issue-83479
JohnTitor Oct 20, 2021
396a4f4
Increase `ROOT_ENTRY_LIMIT` to 1331
JohnTitor Oct 20, 2021
fe060bf
Change `Duration::from_secs_*` underflow error
mbartlett21 Oct 16, 2021
6469fba
Trait objects
BoxyUwU Oct 20, 2021
a81e489
Return pos impl trait
BoxyUwU Oct 20, 2021
83a1834
Wfness
BoxyUwU Oct 20, 2021
8f23779
Inference
BoxyUwU Oct 20, 2021
7a8bd2d
add fixme
BoxyUwU Oct 20, 2021
c75d8cb
Ordering
BoxyUwU Oct 20, 2021
e7a9e82
*dust dust*
BoxyUwU Oct 20, 2021
74c6636
Verify that only NeedsNonConstDrop expects promoteds
tmiasko Oct 21, 2021
e1e273f
CI: make cache download attempt time out after 10 minutes
hkratz Oct 21, 2021
838e673
Debug output before loading docker images as that might hang.
hkratz Oct 21, 2021
ab44e46
Add test for issue #78561
samlich Oct 20, 2021
d50832b
triagebot: Treat `I-*nominated` like `I-nominated`
joshtriplett Oct 21, 2021
04c1ec5
Clarify undefined behaviour for binary heap, btree and hashset
Wilfred Jul 28, 2021
07e2bbe
Rollup merge of #87537 - Wilfred:improve-min-heap-docs, r=Mark-Simula…
JohnTitor Oct 21, 2021
1625f14
Rollup merge of #89808 - tmiasko:llvm-multithreaded, r=nagisa
JohnTitor Oct 21, 2021
bb8c62d
Rollup merge of #89922 - JohnTitor:update-e0637, r=jackh726
JohnTitor Oct 21, 2021
60613fc
Rollup merge of #89944 - mbartlett21:patch-2, r=Mark-Simulacrum
JohnTitor Oct 21, 2021
ebc8159
Rollup merge of #89991 - petrochenkov:visitok2, r=jackh726
JohnTitor Oct 21, 2021
b678d34
Rollup merge of #90028 - tmiasko:structural-match-closure, r=spastorino
JohnTitor Oct 21, 2021
6395764
Rollup merge of #90069 - tmiasko:promoted-const-qualif, r=oli-obk
JohnTitor Oct 21, 2021
2d16346
Rollup merge of #90078 - JohnTitor:test-83479, r=Mark-Simulacrum
JohnTitor Oct 21, 2021
ae1c1ff
Rollup merge of #90114 - BoxyUwU:cg_defaults_tests, r=lcnr
JohnTitor Oct 21, 2021
48aa942
Rollup merge of #90115 - samlich:test-issue-78561, r=oli-obk
JohnTitor Oct 21, 2021
7a2b460
Rollup merge of #90122 - rusticstuff:ci_curl_max_time, r=Mark-Simulacrum
JohnTitor Oct 21, 2021
e394367
Rollup merge of #90129 - joshtriplett:triagebot-nominated, r=Mark-Sim…
JohnTitor Oct 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/llvm/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1770,7 +1770,7 @@ extern "C" {

pub fn LLVMDisposeMessage(message: *mut c_char);

pub fn LLVMStartMultithreaded() -> Bool;
pub fn LLVMIsMultithreaded() -> Bool;

/// Returns a string describing the last error caused by an LLVMRust* call.
pub fn LLVMRustGetLastError() -> *const c_char;
Expand Down
20 changes: 5 additions & 15 deletions compiler/rustc_codegen_llvm/src/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,25 @@ use std::path::Path;
use std::ptr;
use std::slice;
use std::str;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Once;

static POISONED: AtomicBool = AtomicBool::new(false);
static INIT: Once = Once::new();

pub(crate) fn init(sess: &Session) {
unsafe {
// Before we touch LLVM, make sure that multithreading is enabled.
if llvm::LLVMIsMultithreaded() != 1 {
bug!("LLVM compiled without support for threads");
}
INIT.call_once(|| {
if llvm::LLVMStartMultithreaded() != 1 {
// use an extra bool to make sure that all future usage of LLVM
// cannot proceed despite the Once not running more than once.
POISONED.store(true, Ordering::SeqCst);
}

configure_llvm(sess);
});

if POISONED.load(Ordering::SeqCst) {
bug!("couldn't enable multi-threaded LLVM");
}
}
}

fn require_inited() {
INIT.call_once(|| bug!("llvm is not initialized"));
if POISONED.load(Ordering::SeqCst) {
bug!("couldn't enable multi-threaded LLVM");
if !INIT.is_completed() {
bug!("LLVM is not initialized");
}
}

Expand Down