Skip to content

Commit a7cae02

Browse files
committed
Auto merge of rust-lang#138180 - compiler-errors:rollup-m8zqdep, r=compiler-errors
Rollup of 10 pull requests Successful merges: - rust-lang#135651 (Support for `wasm32-wali-linux-musl` Tier-3 target) - rust-lang#136642 (Put the alloc unit tests in a separate alloctests package) - rust-lang#137337 (Add verbatim linker to AIXLinker) - rust-lang#137549 (Clean up various LLVM FFI things in codegen_llvm) - rust-lang#137957 (Remove i586-pc-windows-msvc) - rust-lang#138063 (Improve `-Zunpretty=hir` for parsed attrs) - rust-lang#138137 (setTargetTriple now accepts Triple rather than string) - rust-lang#138141 (tests: fix some typos in comment) - rust-lang#138150 (Streamline HIR intravisit `visit_id` calls for items) - rust-lang#138173 (Delay bug for negative auto trait rather than ICEing) r? `@ghost` `@rustbot` modify labels: rollup
2 parents c53af1c + 3f24608 commit a7cae02

File tree

146 files changed

+1395
-1107
lines changed

Some content is hidden

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

146 files changed

+1395
-1107
lines changed

compiler/rustc_attr_data_structures/src/lib.rs

+30-22
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,39 @@ pub trait HashStableContext: rustc_ast::HashStableContext + rustc_abi::HashStabl
3535
/// like [`Span`]s and empty tuples, are gracefully skipped so they don't clutter the
3636
/// representation much.
3737
pub trait PrintAttribute {
38-
fn print_something(&self) -> bool;
38+
/// Whether or not this will render as something meaningful, or if it's skipped
39+
/// (which will force the containing struct to also skip printing a comma
40+
/// and the field name).
41+
fn should_render(&self) -> bool;
42+
3943
fn print_attribute(&self, p: &mut Printer);
4044
}
4145

4246
impl<T: PrintAttribute> PrintAttribute for &T {
43-
fn print_something(&self) -> bool {
44-
T::print_something(self)
47+
fn should_render(&self) -> bool {
48+
T::should_render(self)
4549
}
4650

4751
fn print_attribute(&self, p: &mut Printer) {
4852
T::print_attribute(self, p)
4953
}
5054
}
5155
impl<T: PrintAttribute> PrintAttribute for Option<T> {
52-
fn print_something(&self) -> bool {
53-
self.as_ref().is_some_and(|x| x.print_something())
56+
fn should_render(&self) -> bool {
57+
self.as_ref().is_some_and(|x| x.should_render())
5458
}
59+
5560
fn print_attribute(&self, p: &mut Printer) {
5661
if let Some(i) = self {
5762
T::print_attribute(i, p)
5863
}
5964
}
6065
}
6166
impl<T: PrintAttribute> PrintAttribute for ThinVec<T> {
62-
fn print_something(&self) -> bool {
63-
self.is_empty() || self[0].print_something()
67+
fn should_render(&self) -> bool {
68+
self.is_empty() || self[0].should_render()
6469
}
70+
6571
fn print_attribute(&self, p: &mut Printer) {
6672
let mut last_printed = false;
6773
p.word("[");
@@ -70,15 +76,15 @@ impl<T: PrintAttribute> PrintAttribute for ThinVec<T> {
7076
p.word_space(",");
7177
}
7278
i.print_attribute(p);
73-
last_printed = i.print_something();
79+
last_printed = i.should_render();
7480
}
7581
p.word("]");
7682
}
7783
}
7884
macro_rules! print_skip {
7985
($($t: ty),* $(,)?) => {$(
8086
impl PrintAttribute for $t {
81-
fn print_something(&self) -> bool { false }
87+
fn should_render(&self) -> bool { false }
8288
fn print_attribute(&self, _: &mut Printer) { }
8389
})*
8490
};
@@ -87,7 +93,7 @@ macro_rules! print_skip {
8793
macro_rules! print_disp {
8894
($($t: ty),* $(,)?) => {$(
8995
impl PrintAttribute for $t {
90-
fn print_something(&self) -> bool { true }
96+
fn should_render(&self) -> bool { true }
9197
fn print_attribute(&self, p: &mut Printer) {
9298
p.word(format!("{}", self));
9399
}
@@ -97,7 +103,7 @@ macro_rules! print_disp {
97103
macro_rules! print_debug {
98104
($($t: ty),* $(,)?) => {$(
99105
impl PrintAttribute for $t {
100-
fn print_something(&self) -> bool { true }
106+
fn should_render(&self) -> bool { true }
101107
fn print_attribute(&self, p: &mut Printer) {
102108
p.word(format!("{:?}", self));
103109
}
@@ -106,37 +112,39 @@ macro_rules! print_debug {
106112
}
107113

108114
macro_rules! print_tup {
109-
(num_print_something $($ts: ident)*) => { 0 $(+ $ts.print_something() as usize)* };
115+
(num_should_render $($ts: ident)*) => { 0 $(+ $ts.should_render() as usize)* };
110116
() => {};
111117
($t: ident $($ts: ident)*) => {
112118
#[allow(non_snake_case, unused)]
113119
impl<$t: PrintAttribute, $($ts: PrintAttribute),*> PrintAttribute for ($t, $($ts),*) {
114-
fn print_something(&self) -> bool {
120+
fn should_render(&self) -> bool {
115121
let ($t, $($ts),*) = self;
116-
print_tup!(num_print_something $t $($ts)*) != 0
122+
print_tup!(num_should_render $t $($ts)*) != 0
117123
}
118124

119125
fn print_attribute(&self, p: &mut Printer) {
120126
let ($t, $($ts),*) = self;
121-
let parens = print_tup!(num_print_something $t $($ts)*) > 1;
127+
let parens = print_tup!(num_should_render $t $($ts)*) > 1;
122128
if parens {
123-
p.word("(");
129+
p.popen();
124130
}
125131

126-
let mut printed_anything = $t.print_something();
132+
let mut printed_anything = $t.should_render();
127133

128134
$t.print_attribute(p);
129135

130136
$(
131-
if printed_anything && $ts.print_something() {
132-
p.word_space(",");
137+
if $ts.should_render() {
138+
if printed_anything {
139+
p.word_space(",");
140+
}
133141
printed_anything = true;
134142
}
135143
$ts.print_attribute(p);
136144
)*
137145

138146
if parens {
139-
p.word(")");
147+
p.pclose();
140148
}
141149
}
142150
}
@@ -147,5 +155,5 @@ macro_rules! print_tup {
147155

148156
print_tup!(A B C D E F G H);
149157
print_skip!(Span, ());
150-
print_disp!(Symbol, u16, bool, NonZero<u32>);
151-
print_debug!(UintTy, IntTy, Align, AttrStyle, CommentKind, Transparency);
158+
print_disp!(u16, bool, NonZero<u32>);
159+
print_debug!(Symbol, UintTy, IntTy, Align, AttrStyle, CommentKind, Transparency);

compiler/rustc_codegen_cranelift/patches/0029-stdlib-Disable-f16-and-f128-in-compiler-builtins.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ index 7165c3e48af..968552ad435 100644
1212
--- a/library/alloc/Cargo.toml
1313
+++ b/library/alloc/Cargo.toml
1414
@@ -11,7 +11,7 @@ test = { path = "../test" }
15-
edition = "2021"
15+
bench = false
1616

1717
[dependencies]
1818
core = { path = "../core", public = true }
1919
-compiler_builtins = { version = "=0.1.151", features = ['rustc-dep-of-std'] }
2020
+compiler_builtins = { version = "=0.1.151", features = ['rustc-dep-of-std', 'no-f16-f128'] }
2121

22-
[dev-dependencies]
23-
rand = { version = "0.8.5", default-features = false, features = ["alloc"] }
22+
[features]
23+
compiler-builtins-mem = ['compiler_builtins/mem']
2424
--
2525
2.34.1
2626

compiler/rustc_codegen_gcc/src/abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::context::CodegenCx;
1616
use crate::intrinsic::ArgAbiExt;
1717
use crate::type_of::LayoutGccExt;
1818

19-
impl<'a, 'gcc, 'tcx> AbiBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
19+
impl AbiBuilderMethods for Builder<'_, '_, '_> {
2020
fn get_param(&mut self, index: usize) -> Self::Value {
2121
let func = self.current_func();
2222
let param = func.get_param(index as i32);

compiler/rustc_codegen_gcc/src/common.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub fn type_is_pointer(typ: Type<'_>) -> bool {
5959
typ.get_pointee().is_some()
6060
}
6161

62-
impl<'gcc, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
62+
impl<'gcc, 'tcx> ConstCodegenMethods for CodegenCx<'gcc, 'tcx> {
6363
fn const_null(&self, typ: Type<'gcc>) -> RValue<'gcc> {
6464
if type_is_pointer(typ) { self.context.new_null(typ) } else { self.const_int(typ, 0) }
6565
}
@@ -257,7 +257,7 @@ impl<'gcc, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
257257
}
258258
}
259259

260-
fn const_data_from_alloc(&self, alloc: ConstAllocation<'tcx>) -> Self::Value {
260+
fn const_data_from_alloc(&self, alloc: ConstAllocation<'_>) -> Self::Value {
261261
const_alloc_to_gcc(self, alloc)
262262
}
263263

compiler/rustc_codegen_gcc/src/consts.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,9 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
302302
}
303303
}
304304

305-
pub fn const_alloc_to_gcc<'gcc, 'tcx>(
306-
cx: &CodegenCx<'gcc, 'tcx>,
307-
alloc: ConstAllocation<'tcx>,
305+
pub fn const_alloc_to_gcc<'gcc>(
306+
cx: &CodegenCx<'gcc, '_>,
307+
alloc: ConstAllocation<'_>,
308308
) -> RValue<'gcc> {
309309
let alloc = alloc.inner();
310310
let mut llvals = Vec::with_capacity(alloc.provenance().ptrs().len() + 1);

compiler/rustc_codegen_gcc/src/type_.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
123123
}
124124
}
125125

126-
impl<'gcc, 'tcx> BaseTypeCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
126+
impl<'gcc, 'tcx> BaseTypeCodegenMethods for CodegenCx<'gcc, 'tcx> {
127127
fn type_i8(&self) -> Type<'gcc> {
128128
self.i8_type
129129
}

compiler/rustc_codegen_llvm/src/abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
654654
}
655655
}
656656

657-
impl<'tcx> AbiBuilderMethods<'tcx> for Builder<'_, '_, 'tcx> {
657+
impl AbiBuilderMethods for Builder<'_, '_, '_> {
658658
fn get_param(&mut self, index: usize) -> Self::Value {
659659
llvm::get_param(self.llfn(), index as c_uint)
660660
}

0 commit comments

Comments
 (0)