Auto merge of #113559 - matthiaskrgr:rollup-jrqyctc, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #113386 (style-guide: Expand example of combinable expressions to include arrays) - #113523 (Reuse LLVMConstInBoundsGEP2) - #113528 (Dynamically size sigaltstk in rustc) - #113543 (Remove `rustc_llvm` from llvm-stamp nags) - #113548 (Update books) - #113551 (bootstrap: Don't print "Skipping" twice) - #113556 (Don't use serde-derive in the rls shim) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
fcaf04e715
@ -3021,7 +3021,6 @@ dependencies = [
|
||||
name = "rls"
|
||||
version = "2.0.0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
|
@ -290,7 +290,7 @@ fn scalar_to_backend(&self, cv: Scalar, layout: abi::Scalar, llty: &'ll Type) ->
|
||||
}
|
||||
};
|
||||
let llval = unsafe {
|
||||
llvm::LLVMRustConstInBoundsGEP2(
|
||||
llvm::LLVMConstInBoundsGEP2(
|
||||
self.type_i8(),
|
||||
self.const_bitcast(base_addr, self.type_i8p_ext(base_addr_space)),
|
||||
&self.const_usize(offset.bytes()),
|
||||
@ -320,7 +320,7 @@ fn const_bitcast(&self, val: &'ll Value, ty: &'ll Type) -> &'ll Value {
|
||||
|
||||
fn const_ptr_byte_offset(&self, base_addr: Self::Value, offset: abi::Size) -> Self::Value {
|
||||
unsafe {
|
||||
llvm::LLVMRustConstInBoundsGEP2(
|
||||
llvm::LLVMConstInBoundsGEP2(
|
||||
self.type_i8(),
|
||||
self.const_bitcast(base_addr, self.type_i8p()),
|
||||
&self.const_usize(offset.bytes()),
|
||||
|
@ -1155,7 +1155,7 @@ pub fn LLVMConstArray<'a>(
|
||||
pub fn LLVMConstVector(ScalarConstantVals: *const &Value, Size: c_uint) -> &Value;
|
||||
|
||||
// Constant expressions
|
||||
pub fn LLVMRustConstInBoundsGEP2<'a>(
|
||||
pub fn LLVMConstInBoundsGEP2<'a>(
|
||||
ty: &'a Type,
|
||||
ConstantVal: &'a Value,
|
||||
ConstantIndices: *const &'a Value,
|
||||
|
@ -1453,13 +1453,13 @@ extern "C" fn print_stack_trace(_: libc::c_int) {
|
||||
/// When an error signal (such as SIGABRT or SIGSEGV) is delivered to the
|
||||
/// process, print a stack trace and then exit.
|
||||
pub(super) fn install() {
|
||||
use std::alloc::{alloc, Layout};
|
||||
|
||||
unsafe {
|
||||
const ALT_STACK_SIZE: usize = libc::MINSIGSTKSZ + 64 * 1024;
|
||||
let alt_stack_size: usize = min_sigstack_size() + 64 * 1024;
|
||||
let mut alt_stack: libc::stack_t = std::mem::zeroed();
|
||||
alt_stack.ss_sp =
|
||||
std::alloc::alloc(std::alloc::Layout::from_size_align(ALT_STACK_SIZE, 1).unwrap())
|
||||
as *mut libc::c_void;
|
||||
alt_stack.ss_size = ALT_STACK_SIZE;
|
||||
alt_stack.ss_sp = alloc(Layout::from_size_align(alt_stack_size, 1).unwrap()).cast();
|
||||
alt_stack.ss_size = alt_stack_size;
|
||||
libc::sigaltstack(&alt_stack, std::ptr::null_mut());
|
||||
|
||||
let mut sa: libc::sigaction = std::mem::zeroed();
|
||||
@ -1469,6 +1469,23 @@ pub(super) fn install() {
|
||||
libc::sigaction(libc::SIGSEGV, &sa, std::ptr::null_mut());
|
||||
}
|
||||
}
|
||||
|
||||
/// Modern kernels on modern hardware can have dynamic signal stack sizes.
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
fn min_sigstack_size() -> usize {
|
||||
const AT_MINSIGSTKSZ: core::ffi::c_ulong = 51;
|
||||
let dynamic_sigstksz = unsafe { libc::getauxval(AT_MINSIGSTKSZ) };
|
||||
// If getauxval couldn't find the entry, it returns 0,
|
||||
// so take the higher of the "constant" and auxval.
|
||||
// This transparently supports older kernels which don't provide AT_MINSIGSTKSZ
|
||||
libc::MINSIGSTKSZ.max(dynamic_sigstksz as _)
|
||||
}
|
||||
|
||||
/// Not all OS support hardware where this is needed.
|
||||
#[cfg(not(any(target_os = "linux", target_os = "android")))]
|
||||
fn min_sigstack_size() -> usize {
|
||||
libc::MINSIGSTKSZ
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(all(unix, any(target_env = "gnu", target_os = "macos"))))]
|
||||
|
@ -1616,17 +1616,6 @@ extern "C" void LLVMRustSetLinkage(LLVMValueRef V,
|
||||
LLVMSetLinkage(V, fromRust(RustLinkage));
|
||||
}
|
||||
|
||||
// FIXME: replace with LLVMConstInBoundsGEP2 when bumped minimal version to llvm-14
|
||||
extern "C" LLVMValueRef LLVMRustConstInBoundsGEP2(LLVMTypeRef Ty,
|
||||
LLVMValueRef ConstantVal,
|
||||
LLVMValueRef *ConstantIndices,
|
||||
unsigned NumIndices) {
|
||||
ArrayRef<Constant *> IdxList(unwrap<Constant>(ConstantIndices, NumIndices),
|
||||
NumIndices);
|
||||
Constant *Val = unwrap<Constant>(ConstantVal);
|
||||
return wrap(ConstantExpr::getInBoundsGetElementPtr(unwrap(Ty), Val, IdxList));
|
||||
}
|
||||
|
||||
extern "C" bool LLVMRustConstIntGetZExtValue(LLVMValueRef CV, uint64_t *value) {
|
||||
auto C = unwrap<llvm::ConstantInt>(CV);
|
||||
if (C->getBitWidth() > 64)
|
||||
|
@ -13,7 +13,7 @@
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
use crate::cache::{Cache, Interned, INTERNER};
|
||||
use crate::config::{SplitDebuginfo, TargetSelection};
|
||||
use crate::config::{DryRun, SplitDebuginfo, TargetSelection};
|
||||
use crate::doc;
|
||||
use crate::flags::{Color, Subcommand};
|
||||
use crate::install;
|
||||
@ -281,11 +281,15 @@ fn maybe_run(&self, builder: &Builder<'_>, pathsets: Vec<PathSet>) {
|
||||
|
||||
fn is_excluded(&self, builder: &Builder<'_>, pathset: &PathSet) -> bool {
|
||||
if builder.config.exclude.iter().any(|e| pathset.has(&e, builder.kind)) {
|
||||
println!("Skipping {:?} because it is excluded", pathset);
|
||||
if !matches!(builder.config.dry_run, DryRun::SelfCheck) {
|
||||
println!("Skipping {:?} because it is excluded", pathset);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if !builder.config.exclude.is_empty() {
|
||||
if !builder.config.exclude.is_empty()
|
||||
&& !matches!(builder.config.dry_run, DryRun::SelfCheck)
|
||||
{
|
||||
builder.verbose(&format!(
|
||||
"{:?} not skipped for {:?} -- not in {:?}",
|
||||
pathset, self.name, builder.config.exclude
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 21cf840842bdf768a798869f06373c96c1cc5122
|
||||
Subproject commit 668c64760b5c7ea654facb4ba5fe9faddfda27cc
|
@ -1 +1 @@
|
||||
Subproject commit f63e578b92ff43e8cc38fcaa257b660f45c8a8c2
|
||||
Subproject commit 2751bdcef125468ea2ee006c11992cd1405aebe5
|
@ -1 +1 @@
|
||||
Subproject commit f2aed2fe8e9f55508c86ba3aa4b6789b18a08a22
|
||||
Subproject commit 1e5556dd1b864109985d5871616ae6b9164bcead
|
@ -1 +1 @@
|
||||
Subproject commit c369e4b489332f8721fbae630354fa83385d457d
|
||||
Subproject commit 302b995bcb24b70fd883980fd174738c3a10b705
|
@ -1 +1 @@
|
||||
Subproject commit 5ca365eac678cb0d41a20b3204546d6ed70c7171
|
||||
Subproject commit 1ea0178266b3f3f613b0fabdaf16a83961c99cdb
|
@ -1 +1 @@
|
||||
Subproject commit 57636d6926762861f34e030d52ca25a71e95e5bf
|
||||
Subproject commit 8a87926a985ce32ca1fad1be4008ee161a0b91eb
|
@ -1 +1 @@
|
||||
Subproject commit 17fe3e948498c50e208047a750f17d6a8d89669b
|
||||
Subproject commit b5a12d95e32ae53791cc6ab44417774667ed2ac6
|
@ -803,6 +803,16 @@ foo(|param| {
|
||||
action();
|
||||
foo(param)
|
||||
})
|
||||
|
||||
let x = combinable([
|
||||
an_expr,
|
||||
another_expr,
|
||||
]);
|
||||
|
||||
let arr = [combinable(
|
||||
an_expr,
|
||||
another_expr,
|
||||
)];
|
||||
```
|
||||
|
||||
Such behaviour should extend recursively, however, tools may choose to limit the
|
||||
|
@ -5,5 +5,4 @@ edition = "2021"
|
||||
license = "Apache-2.0/MIT"
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0.143", features = ["derive"] }
|
||||
serde_json = "1.0.83"
|
||||
|
@ -3,7 +3,7 @@
|
||||
//! This is a small stub that replaces RLS to alert the user that RLS is no
|
||||
//! longer available.
|
||||
|
||||
use serde::Deserialize;
|
||||
use serde_json::Value;
|
||||
use std::error::Error;
|
||||
use std::io::BufRead;
|
||||
use std::io::Write;
|
||||
@ -21,7 +21,6 @@ fn main() {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct Message {
|
||||
method: Option<String>,
|
||||
}
|
||||
@ -88,8 +87,10 @@ fn read_message_raw<R: BufRead>(reader: &mut R) -> Result<String, Box<dyn Error>
|
||||
|
||||
fn read_message<R: BufRead>(reader: &mut R) -> Result<Message, Box<dyn Error>> {
|
||||
let m = read_message_raw(reader)?;
|
||||
match serde_json::from_str(&m) {
|
||||
Ok(m) => Ok(m),
|
||||
match serde_json::from_str::<Value>(&m) {
|
||||
Ok(message) => Ok(Message {
|
||||
method: message.get("method").and_then(|value| value.as_str().map(String::from)),
|
||||
}),
|
||||
Err(e) => Err(format!("failed to parse message {m}\n{e}").into()),
|
||||
}
|
||||
}
|
||||
|
@ -486,10 +486,6 @@ message = "This PR changes src/bootstrap/defaults/config.codegen.toml. If approp
|
||||
|
||||
[mentions."src/bootstrap/llvm.rs"]
|
||||
message = "This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp."
|
||||
[mentions."compiler/rustc_llvm/build.rs"]
|
||||
message = "This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp."
|
||||
[mentions."compiler/rustc_llvm/llvm-wrapper"]
|
||||
message = "This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp."
|
||||
|
||||
[mentions."tests/ui/deriving/deriving-all-codegen.stdout"]
|
||||
message = "Changes to the code generated for builtin derived traits."
|
||||
|
Loading…
Reference in New Issue
Block a user