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"
|
name = "rls"
|
||||||
version = "2.0.0"
|
version = "2.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
|
||||||
"serde_json",
|
"serde_json",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -290,7 +290,7 @@ impl<'ll, 'tcx> ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
let llval = unsafe {
|
let llval = unsafe {
|
||||||
llvm::LLVMRustConstInBoundsGEP2(
|
llvm::LLVMConstInBoundsGEP2(
|
||||||
self.type_i8(),
|
self.type_i8(),
|
||||||
self.const_bitcast(base_addr, self.type_i8p_ext(base_addr_space)),
|
self.const_bitcast(base_addr, self.type_i8p_ext(base_addr_space)),
|
||||||
&self.const_usize(offset.bytes()),
|
&self.const_usize(offset.bytes()),
|
||||||
@ -320,7 +320,7 @@ impl<'ll, 'tcx> ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> {
|
|||||||
|
|
||||||
fn const_ptr_byte_offset(&self, base_addr: Self::Value, offset: abi::Size) -> Self::Value {
|
fn const_ptr_byte_offset(&self, base_addr: Self::Value, offset: abi::Size) -> Self::Value {
|
||||||
unsafe {
|
unsafe {
|
||||||
llvm::LLVMRustConstInBoundsGEP2(
|
llvm::LLVMConstInBoundsGEP2(
|
||||||
self.type_i8(),
|
self.type_i8(),
|
||||||
self.const_bitcast(base_addr, self.type_i8p()),
|
self.const_bitcast(base_addr, self.type_i8p()),
|
||||||
&self.const_usize(offset.bytes()),
|
&self.const_usize(offset.bytes()),
|
||||||
|
@ -1155,7 +1155,7 @@ extern "C" {
|
|||||||
pub fn LLVMConstVector(ScalarConstantVals: *const &Value, Size: c_uint) -> &Value;
|
pub fn LLVMConstVector(ScalarConstantVals: *const &Value, Size: c_uint) -> &Value;
|
||||||
|
|
||||||
// Constant expressions
|
// Constant expressions
|
||||||
pub fn LLVMRustConstInBoundsGEP2<'a>(
|
pub fn LLVMConstInBoundsGEP2<'a>(
|
||||||
ty: &'a Type,
|
ty: &'a Type,
|
||||||
ConstantVal: &'a Value,
|
ConstantVal: &'a Value,
|
||||||
ConstantIndices: *const &'a Value,
|
ConstantIndices: *const &'a Value,
|
||||||
|
@ -1453,13 +1453,13 @@ mod signal_handler {
|
|||||||
/// When an error signal (such as SIGABRT or SIGSEGV) is delivered to the
|
/// When an error signal (such as SIGABRT or SIGSEGV) is delivered to the
|
||||||
/// process, print a stack trace and then exit.
|
/// process, print a stack trace and then exit.
|
||||||
pub(super) fn install() {
|
pub(super) fn install() {
|
||||||
|
use std::alloc::{alloc, Layout};
|
||||||
|
|
||||||
unsafe {
|
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();
|
let mut alt_stack: libc::stack_t = std::mem::zeroed();
|
||||||
alt_stack.ss_sp =
|
alt_stack.ss_sp = alloc(Layout::from_size_align(alt_stack_size, 1).unwrap()).cast();
|
||||||
std::alloc::alloc(std::alloc::Layout::from_size_align(ALT_STACK_SIZE, 1).unwrap())
|
alt_stack.ss_size = alt_stack_size;
|
||||||
as *mut libc::c_void;
|
|
||||||
alt_stack.ss_size = ALT_STACK_SIZE;
|
|
||||||
libc::sigaltstack(&alt_stack, std::ptr::null_mut());
|
libc::sigaltstack(&alt_stack, std::ptr::null_mut());
|
||||||
|
|
||||||
let mut sa: libc::sigaction = std::mem::zeroed();
|
let mut sa: libc::sigaction = std::mem::zeroed();
|
||||||
@ -1469,6 +1469,23 @@ mod signal_handler {
|
|||||||
libc::sigaction(libc::SIGSEGV, &sa, std::ptr::null_mut());
|
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"))))]
|
#[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));
|
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) {
|
extern "C" bool LLVMRustConstIntGetZExtValue(LLVMValueRef CV, uint64_t *value) {
|
||||||
auto C = unwrap<llvm::ConstantInt>(CV);
|
auto C = unwrap<llvm::ConstantInt>(CV);
|
||||||
if (C->getBitWidth() > 64)
|
if (C->getBitWidth() > 64)
|
||||||
|
@ -13,7 +13,7 @@ use std::process::Command;
|
|||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
|
|
||||||
use crate::cache::{Cache, Interned, INTERNER};
|
use crate::cache::{Cache, Interned, INTERNER};
|
||||||
use crate::config::{SplitDebuginfo, TargetSelection};
|
use crate::config::{DryRun, SplitDebuginfo, TargetSelection};
|
||||||
use crate::doc;
|
use crate::doc;
|
||||||
use crate::flags::{Color, Subcommand};
|
use crate::flags::{Color, Subcommand};
|
||||||
use crate::install;
|
use crate::install;
|
||||||
@ -281,11 +281,15 @@ impl StepDescription {
|
|||||||
|
|
||||||
fn is_excluded(&self, builder: &Builder<'_>, pathset: &PathSet) -> bool {
|
fn is_excluded(&self, builder: &Builder<'_>, pathset: &PathSet) -> bool {
|
||||||
if builder.config.exclude.iter().any(|e| pathset.has(&e, builder.kind)) {
|
if builder.config.exclude.iter().any(|e| pathset.has(&e, builder.kind)) {
|
||||||
|
if !matches!(builder.config.dry_run, DryRun::SelfCheck) {
|
||||||
println!("Skipping {:?} because it is excluded", pathset);
|
println!("Skipping {:?} because it is excluded", pathset);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if !builder.config.exclude.is_empty() {
|
if !builder.config.exclude.is_empty()
|
||||||
|
&& !matches!(builder.config.dry_run, DryRun::SelfCheck)
|
||||||
|
{
|
||||||
builder.verbose(&format!(
|
builder.verbose(&format!(
|
||||||
"{:?} not skipped for {:?} -- not in {:?}",
|
"{:?} not skipped for {:?} -- not in {:?}",
|
||||||
pathset, self.name, builder.config.exclude
|
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();
|
action();
|
||||||
foo(param)
|
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
|
Such behaviour should extend recursively, however, tools may choose to limit the
|
||||||
|
@ -5,5 +5,4 @@ edition = "2021"
|
|||||||
license = "Apache-2.0/MIT"
|
license = "Apache-2.0/MIT"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde = { version = "1.0.143", features = ["derive"] }
|
|
||||||
serde_json = "1.0.83"
|
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
|
//! This is a small stub that replaces RLS to alert the user that RLS is no
|
||||||
//! longer available.
|
//! longer available.
|
||||||
|
|
||||||
use serde::Deserialize;
|
use serde_json::Value;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::io::BufRead;
|
use std::io::BufRead;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
@ -21,7 +21,6 @@ fn main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
|
||||||
struct Message {
|
struct Message {
|
||||||
method: Option<String>,
|
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>> {
|
fn read_message<R: BufRead>(reader: &mut R) -> Result<Message, Box<dyn Error>> {
|
||||||
let m = read_message_raw(reader)?;
|
let m = read_message_raw(reader)?;
|
||||||
match serde_json::from_str(&m) {
|
match serde_json::from_str::<Value>(&m) {
|
||||||
Ok(m) => Ok(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()),
|
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"]
|
[mentions."src/bootstrap/llvm.rs"]
|
||||||
message = "This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp."
|
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"]
|
[mentions."tests/ui/deriving/deriving-all-codegen.stdout"]
|
||||||
message = "Changes to the code generated for builtin derived traits."
|
message = "Changes to the code generated for builtin derived traits."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user