Skip to content

Commit 54cdc75

Browse files
committed
Auto merge of rust-lang#136965 - jhpratt:rollup-bsnqvmf, r=jhpratt
Rollup of 8 pull requests Successful merges: - rust-lang#134999 (Add cygwin target.) - rust-lang#136559 (Resolve named regions when reporting type test failures in NLL) - rust-lang#136660 (Use a trait to enforce field validity for union fields + `unsafe` fields + `unsafe<>` binder types) - rust-lang#136858 (Parallel-compiler-related cleanup) - rust-lang#136881 (cg_llvm: Reduce visibility of all functions in the llvm module) - rust-lang#136888 (Always perform discr read for never pattern in EUV) - rust-lang#136948 (Split out the `extern_system_varargs` feature) - rust-lang#136949 (Fix import in bench for wasm) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 3cb0272 + f9142b0 commit 54cdc75

File tree

71 files changed

+1232
-791
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1232
-791
lines changed

compiler/rustc_abi/src/extern_abi.rs

-2
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ impl ExternAbi {
195195
// * C and Cdecl obviously support varargs.
196196
// * C can be based on Aapcs, SysV64 or Win64, so they must support varargs.
197197
// * EfiApi is based on Win64 or C, so it also supports it.
198-
// * System falls back to C for functions with varargs.
199198
//
200199
// * Stdcall does not, because it would be impossible for the callee to clean
201200
// up the arguments. (callee doesn't know how many arguments are there)
@@ -204,7 +203,6 @@ impl ExternAbi {
204203
match self {
205204
Self::C { .. }
206205
| Self::Cdecl { .. }
207-
| Self::System { .. }
208206
| Self::Aapcs { .. }
209207
| Self::Win64 { .. }
210208
| Self::SysV64 { .. }

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -316,13 +316,16 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
316316
let type_test_span = type_test.span;
317317

318318
if let Some(lower_bound_region) = lower_bound_region {
319-
let generic_ty = type_test.generic_kind.to_ty(self.infcx.tcx);
319+
let generic_ty = self.regioncx.name_regions(
320+
self.infcx.tcx,
321+
type_test.generic_kind.to_ty(self.infcx.tcx),
322+
);
320323
let origin = RelateParamBound(type_test_span, generic_ty, None);
321324
self.buffer_error(self.infcx.err_ctxt().construct_generic_bound_failure(
322325
self.body.source.def_id().expect_local(),
323326
type_test_span,
324327
Some(origin),
325-
type_test.generic_kind,
328+
self.regioncx.name_regions(self.infcx.tcx, type_test.generic_kind),
326329
lower_bound_region,
327330
));
328331
} else {

compiler/rustc_codegen_cranelift/example/mini_core.rs

+3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ impl<T: ?Sized> LegacyReceiver for Box<T> {}
5757
#[lang = "copy"]
5858
pub trait Copy {}
5959

60+
#[lang = "bikeshed_guaranteed_no_drop"]
61+
pub trait BikeshedGuaranteedNoDrop {}
62+
6063
impl Copy for bool {}
6164
impl Copy for u8 {}
6265
impl Copy for u16 {}

compiler/rustc_codegen_gcc/example/mini_core.rs

+3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ impl<T: ?Sized, A: Allocator> LegacyReceiver for Box<T, A> {}
5454
#[lang = "copy"]
5555
pub trait Copy {}
5656

57+
#[lang = "bikeshed_guaranteed_no_drop"]
58+
pub trait BikeshedGuaranteedNoDrop {}
59+
5760
impl Copy for bool {}
5861
impl Copy for u8 {}
5962
impl Copy for u16 {}

compiler/rustc_codegen_gcc/src/back/lto.rs

-4
Original file line numberDiff line numberDiff line change
@@ -710,10 +710,6 @@ pub struct ThinBuffer {
710710
context: Arc<SyncContext>,
711711
}
712712

713-
// TODO: check if this makes sense to make ThinBuffer Send and Sync.
714-
unsafe impl Send for ThinBuffer {}
715-
unsafe impl Sync for ThinBuffer {}
716-
717713
impl ThinBuffer {
718714
pub(crate) fn new(context: &Arc<SyncContext>) -> Self {
719715
Self { context: Arc::clone(context) }

compiler/rustc_codegen_llvm/src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,6 @@ impl WriteBackendMethods for LlvmCodegenBackend {
245245
}
246246
}
247247

248-
unsafe impl Send for LlvmCodegenBackend {} // Llvm is on a per-thread basis
249-
unsafe impl Sync for LlvmCodegenBackend {}
250-
251248
impl LlvmCodegenBackend {
252249
pub fn new() -> Box<dyn CodegenBackend> {
253250
Box::new(LlvmCodegenBackend(()))

compiler/rustc_codegen_llvm/src/llvm/archive_ro.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl ArchiveRO {
2626
///
2727
/// If this archive is used with a mutable method, then an error will be
2828
/// raised.
29-
pub fn open(dst: &Path) -> Result<ArchiveRO, String> {
29+
pub(crate) fn open(dst: &Path) -> Result<ArchiveRO, String> {
3030
unsafe {
3131
let s = path_to_c_string(dst);
3232
let ar = super::LLVMRustOpenArchive(s.as_ptr()).ok_or_else(|| {
@@ -36,7 +36,7 @@ impl ArchiveRO {
3636
}
3737
}
3838

39-
pub fn iter(&self) -> Iter<'_> {
39+
pub(crate) fn iter(&self) -> Iter<'_> {
4040
unsafe { Iter { raw: super::LLVMRustArchiveIteratorNew(self.raw) } }
4141
}
4242
}
@@ -71,7 +71,7 @@ impl<'a> Drop for Iter<'a> {
7171
}
7272

7373
impl<'a> Child<'a> {
74-
pub fn name(&self) -> Option<&'a str> {
74+
pub(crate) fn name(&self) -> Option<&'a str> {
7575
unsafe {
7676
let mut name_len = 0;
7777
let name_ptr = super::LLVMRustArchiveChildName(self.raw, &mut name_len);

compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs

+14-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![allow(non_camel_case_types)]
2+
#![expect(dead_code)]
23

34
use libc::{c_char, c_uint};
45

@@ -8,23 +9,23 @@ use crate::llvm::Bool;
89
#[link(name = "llvm-wrapper", kind = "static")]
910
extern "C" {
1011
// Enzyme
11-
pub fn LLVMRustHasMetadata(I: &Value, KindID: c_uint) -> bool;
12-
pub fn LLVMRustEraseInstUntilInclusive(BB: &BasicBlock, I: &Value);
13-
pub fn LLVMRustGetLastInstruction<'a>(BB: &BasicBlock) -> Option<&'a Value>;
14-
pub fn LLVMRustDIGetInstMetadata(I: &Value) -> Option<&Metadata>;
15-
pub fn LLVMRustEraseInstFromParent(V: &Value);
16-
pub fn LLVMRustGetTerminator<'a>(B: &BasicBlock) -> &'a Value;
17-
pub fn LLVMRustVerifyFunction(V: &Value, action: LLVMRustVerifierFailureAction) -> Bool;
12+
pub(crate) fn LLVMRustHasMetadata(I: &Value, KindID: c_uint) -> bool;
13+
pub(crate) fn LLVMRustEraseInstUntilInclusive(BB: &BasicBlock, I: &Value);
14+
pub(crate) fn LLVMRustGetLastInstruction<'a>(BB: &BasicBlock) -> Option<&'a Value>;
15+
pub(crate) fn LLVMRustDIGetInstMetadata(I: &Value) -> Option<&Metadata>;
16+
pub(crate) fn LLVMRustEraseInstFromParent(V: &Value);
17+
pub(crate) fn LLVMRustGetTerminator<'a>(B: &BasicBlock) -> &'a Value;
18+
pub(crate) fn LLVMRustVerifyFunction(V: &Value, action: LLVMRustVerifierFailureAction) -> Bool;
1819
}
1920

2021
extern "C" {
2122
// Enzyme
22-
pub fn LLVMDumpModule(M: &Module);
23-
pub fn LLVMDumpValue(V: &Value);
24-
pub fn LLVMGetFunctionCallConv(F: &Value) -> c_uint;
25-
pub fn LLVMGetReturnType(T: &Type) -> &Type;
26-
pub fn LLVMGetParams(Fnc: &Value, parms: *mut &Value);
27-
pub fn LLVMGetNamedFunction(M: &Module, Name: *const c_char) -> Option<&Value>;
23+
pub(crate) fn LLVMDumpModule(M: &Module);
24+
pub(crate) fn LLVMDumpValue(V: &Value);
25+
pub(crate) fn LLVMGetFunctionCallConv(F: &Value) -> c_uint;
26+
pub(crate) fn LLVMGetReturnType(T: &Type) -> &Type;
27+
pub(crate) fn LLVMGetParams(Fnc: &Value, parms: *mut &Value);
28+
pub(crate) fn LLVMGetNamedFunction(M: &Module, Name: *const c_char) -> Option<&Value>;
2829
}
2930

3031
#[repr(C)]

0 commit comments

Comments
 (0)