Skip to content

Commit 7ba799d

Browse files
committed
Merge branch 'master' into sync_from_rust_2025_11_13
2 parents 3e1d537 + f25ac1d commit 7ba799d

File tree

15 files changed

+40
-72
lines changed

15 files changed

+40
-72
lines changed

example/mini_core_hello_world.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
)]
77
#![no_core]
88
#![allow(dead_code, internal_features, non_camel_case_types)]
9-
#![rustfmt_skip]
9+
#![cfg_attr(rustfmt, rustfmt_skip)]
1010

1111
extern crate mini_core;
1212

src/archive.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
use std::path::Path;
2+
3+
use rustc_codegen_ssa::back::archive::{
4+
ArArchiveBuilder, ArchiveBuilder, ArchiveBuilderBuilder, DEFAULT_OBJECT_READER,
5+
};
6+
use rustc_session::Session;
7+
8+
pub(crate) struct ArArchiveBuilderBuilder;
9+
10+
impl ArchiveBuilderBuilder for ArArchiveBuilderBuilder {
11+
fn new_archive_builder<'a>(&self, sess: &'a Session) -> Box<dyn ArchiveBuilder + 'a> {
12+
Box::new(ArArchiveBuilder::new(sess, &DEFAULT_OBJECT_READER))
13+
}
14+
15+
fn create_dll_import_lib(
16+
&self,
17+
_sess: &Session,
18+
_lib_name: &str,
19+
_import_name_and_ordinal_vector: Vec<(String, Option<u16>)>,
20+
_output_path: &Path,
21+
) {
22+
unimplemented!("creating dll imports is not yet supported");
23+
}
24+
}

src/attributes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ fn inline_attr<'gcc, 'tcx>(
8686
/// attributes.
8787
pub fn from_fn_attrs<'gcc, 'tcx>(
8888
cx: &CodegenCx<'gcc, 'tcx>,
89-
#[cfg_attr(not(feature = "master"), allow(unused_variables))] func: Function<'gcc>,
89+
#[cfg_attr(not(feature = "master"), expect(unused_variables))] func: Function<'gcc>,
9090
instance: ty::Instance<'tcx>,
9191
) {
9292
let codegen_fn_attrs = cx.tcx.codegen_instance_attrs(instance.def);

src/back/lto.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ pub fn optimize_thin_module(
633633
save_temp_bitcode(cgcx, &module, "thin-lto-after-pm");
634634
}
635635
}*/
636-
#[allow(clippy::let_and_return)]
636+
#[expect(clippy::let_and_return)]
637637
module
638638
}
639639

src/builder.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,7 +1481,6 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
14811481
variable.to_rvalue()
14821482
}
14831483

1484-
#[allow(dead_code)]
14851484
fn va_arg(&mut self, _list: RValue<'gcc>, _ty: Type<'gcc>) -> RValue<'gcc> {
14861485
unimplemented!();
14871486
}
@@ -2517,7 +2516,7 @@ impl ToGccComp for RealPredicate {
25172516
}
25182517

25192518
#[repr(C)]
2520-
#[allow(non_camel_case_types)]
2519+
#[expect(non_camel_case_types)]
25212520
enum MemOrdering {
25222521
__ATOMIC_RELAXED,
25232522
__ATOMIC_CONSUME,

src/consts.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ impl<'gcc, 'tcx> StaticCodegenMethods for CodegenCx<'gcc, 'tcx> {
5858
global_value
5959
}
6060

61-
#[cfg_attr(not(feature = "master"), allow(unused_mut))]
6261
fn codegen_static(&mut self, def_id: DefId) {
6362
let attrs = self.tcx.codegen_fn_attrs(def_id);
6463

@@ -162,7 +161,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
162161
// TODO(antoyo)
163162
}
164163

165-
#[cfg_attr(not(feature = "master"), allow(unused_variables))]
164+
#[cfg_attr(not(feature = "master"), expect(unused_variables))]
166165
pub fn add_used_function(&self, function: Function<'gcc>) {
167166
#[cfg(feature = "master")]
168167
function.add_attribute(FnAttribute::Used);

src/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use crate::abi::conv_to_fn_attribute;
2828
use crate::callee::get_fn;
2929
use crate::common::SignType;
3030

31-
#[cfg_attr(not(feature = "master"), allow(dead_code))]
31+
#[cfg_attr(not(feature = "master"), expect(dead_code))]
3232
pub struct CodegenCx<'gcc, 'tcx> {
3333
/// A cache of converted ConstAllocs
3434
pub const_cache: RefCell<HashMap<Allocation, RValue<'gcc>>>,
@@ -132,7 +132,7 @@ pub struct CodegenCx<'gcc, 'tcx> {
132132
}
133133

134134
impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
135-
#[allow(clippy::too_many_arguments)]
135+
#[expect(clippy::too_many_arguments)]
136136
pub fn new(
137137
context: &'gcc Context<'gcc>,
138138
codegen_unit: &'tcx CodegenUnit<'tcx>,

src/declare.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
156156
///
157157
/// If there’s a value with the same name already declared, the function will
158158
/// update the declaration and return existing Value instead.
159-
#[allow(clippy::let_and_return)]
159+
#[expect(clippy::let_and_return)]
160160
fn declare_raw_fn<'gcc>(
161161
cx: &CodegenCx<'gcc, '_>,
162162
name: &str,

src/intrinsic/archs.rs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fn map_arch_intrinsic(full_name: &str) -> &'static str {
1010
};
1111
match arch {
1212
"AMDGPU" => {
13-
#[allow(non_snake_case)]
13+
#[expect(non_snake_case)]
1414
fn AMDGPU(name: &str, full_name: &str) -> &'static str {
1515
match name {
1616
// AMDGPU
@@ -48,7 +48,6 @@ fn map_arch_intrinsic(full_name: &str) -> &'static str {
4848
AMDGPU(name, full_name)
4949
}
5050
"aarch64" => {
51-
#[allow(non_snake_case)]
5251
fn aarch64(name: &str, full_name: &str) -> &'static str {
5352
match name {
5453
// aarch64
@@ -81,7 +80,6 @@ fn map_arch_intrinsic(full_name: &str) -> &'static str {
8180
aarch64(name, full_name)
8281
}
8382
"amdgcn" => {
84-
#[allow(non_snake_case)]
8583
fn amdgcn(name: &str, full_name: &str) -> &'static str {
8684
match name {
8785
// amdgcn
@@ -524,7 +522,6 @@ fn map_arch_intrinsic(full_name: &str) -> &'static str {
524522
amdgcn(name, full_name)
525523
}
526524
"arm" => {
527-
#[allow(non_snake_case)]
528525
fn arm(name: &str, full_name: &str) -> &'static str {
529526
match name {
530527
// arm
@@ -633,7 +630,6 @@ fn map_arch_intrinsic(full_name: &str) -> &'static str {
633630
arm(name, full_name)
634631
}
635632
"bpf" => {
636-
#[allow(non_snake_case)]
637633
fn bpf(name: &str, full_name: &str) -> &'static str {
638634
match name {
639635
// bpf
@@ -655,7 +651,6 @@ fn map_arch_intrinsic(full_name: &str) -> &'static str {
655651
bpf(name, full_name)
656652
}
657653
"cuda" => {
658-
#[allow(non_snake_case)]
659654
fn cuda(name: &str, full_name: &str) -> &'static str {
660655
match name {
661656
// cuda
@@ -666,7 +661,6 @@ fn map_arch_intrinsic(full_name: &str) -> &'static str {
666661
cuda(name, full_name)
667662
}
668663
"hexagon" => {
669-
#[allow(non_snake_case)]
670664
fn hexagon(name: &str, full_name: &str) -> &'static str {
671665
match name {
672666
// hexagon
@@ -2653,7 +2647,6 @@ fn map_arch_intrinsic(full_name: &str) -> &'static str {
26532647
hexagon(name, full_name)
26542648
}
26552649
"loongarch" => {
2656-
#[allow(non_snake_case)]
26572650
fn loongarch(name: &str, full_name: &str) -> &'static str {
26582651
match name {
26592652
// loongarch
@@ -4162,7 +4155,6 @@ fn map_arch_intrinsic(full_name: &str) -> &'static str {
41624155
loongarch(name, full_name)
41634156
}
41644157
"mips" => {
4165-
#[allow(non_snake_case)]
41664158
fn mips(name: &str, full_name: &str) -> &'static str {
41674159
match name {
41684160
// mips
@@ -4843,7 +4835,6 @@ fn map_arch_intrinsic(full_name: &str) -> &'static str {
48434835
mips(name, full_name)
48444836
}
48454837
"nvvm" => {
4846-
#[allow(non_snake_case)]
48474838
fn nvvm(name: &str, full_name: &str) -> &'static str {
48484839
match name {
48494840
// nvvm
@@ -5652,7 +5643,6 @@ fn map_arch_intrinsic(full_name: &str) -> &'static str {
56525643
nvvm(name, full_name)
56535644
}
56545645
"ppc" => {
5655-
#[allow(non_snake_case)]
56565646
fn ppc(name: &str, full_name: &str) -> &'static str {
56575647
match name {
56585648
// ppc
@@ -6245,7 +6235,6 @@ fn map_arch_intrinsic(full_name: &str) -> &'static str {
62456235
ppc(name, full_name)
62466236
}
62476237
"ptx" => {
6248-
#[allow(non_snake_case)]
62496238
fn ptx(name: &str, full_name: &str) -> &'static str {
62506239
match name {
62516240
// ptx
@@ -6273,7 +6262,6 @@ fn map_arch_intrinsic(full_name: &str) -> &'static str {
62736262
ptx(name, full_name)
62746263
}
62756264
"r600" => {
6276-
#[allow(non_snake_case)]
62776265
fn r600(name: &str, full_name: &str) -> &'static str {
62786266
match name {
62796267
// r600
@@ -6298,7 +6286,6 @@ fn map_arch_intrinsic(full_name: &str) -> &'static str {
62986286
r600(name, full_name)
62996287
}
63006288
"riscv" => {
6301-
#[allow(non_snake_case)]
63026289
fn riscv(name: &str, full_name: &str) -> &'static str {
63036290
match name {
63046291
// riscv
@@ -6332,7 +6319,6 @@ fn map_arch_intrinsic(full_name: &str) -> &'static str {
63326319
riscv(name, full_name)
63336320
}
63346321
"s390" => {
6335-
#[allow(non_snake_case)]
63366322
fn s390(name: &str, full_name: &str) -> &'static str {
63376323
match name {
63386324
// s390
@@ -6526,7 +6512,6 @@ fn map_arch_intrinsic(full_name: &str) -> &'static str {
65266512
s390(name, full_name)
65276513
}
65286514
"spv" => {
6529-
#[allow(non_snake_case)]
65306515
fn spv(name: &str, full_name: &str) -> &'static str {
65316516
match name {
65326517
// spv
@@ -6543,7 +6528,6 @@ fn map_arch_intrinsic(full_name: &str) -> &'static str {
65436528
spv(name, full_name)
65446529
}
65456530
"ve" => {
6546-
#[allow(non_snake_case)]
65476531
fn ve(name: &str, full_name: &str) -> &'static str {
65486532
match name {
65496533
// ve
@@ -7816,7 +7800,6 @@ fn map_arch_intrinsic(full_name: &str) -> &'static str {
78167800
ve(name, full_name)
78177801
}
78187802
"x86" => {
7819-
#[allow(non_snake_case)]
78207803
fn x86(name: &str, full_name: &str) -> &'static str {
78217804
match name {
78227805
// x86
@@ -10384,7 +10367,6 @@ fn map_arch_intrinsic(full_name: &str) -> &'static str {
1038410367
x86(name, full_name)
1038510368
}
1038610369
"xcore" => {
10387-
#[allow(non_snake_case)]
1038810370
fn xcore(name: &str, full_name: &str) -> &'static str {
1038910371
match name {
1039010372
// xcore

src/intrinsic/llvm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ fn wide_aes_output_type<'a, 'gcc, 'tcx>(
8585
(aes_output_type.as_type(), field1, field2)
8686
}
8787

88-
#[cfg_attr(not(feature = "master"), allow(unused_variables))]
88+
#[cfg_attr(not(feature = "master"), expect(unused_variables))]
8989
pub fn adjust_function<'gcc>(
9090
context: &'gcc Context<'gcc>,
9191
func_name: &str,

0 commit comments

Comments
 (0)