Skip to content

Commit 4db028f

Browse files
committed
Auto merge of #3365 - rust-lang:rustup-2024-03-08, r=RalfJung
Automatic Rustup
2 parents 305d2b0 + fcd2efe commit 4db028f

File tree

517 files changed

+7091
-4204
lines changed

Some content is hidden

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

517 files changed

+7091
-4204
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,9 +469,9 @@ version = "0.1.0"
469469

470470
[[package]]
471471
name = "cc"
472-
version = "1.0.79"
472+
version = "1.0.90"
473473
source = "registry+https://github.com/rust-lang/crates.io-index"
474-
checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
474+
checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5"
475475

476476
[[package]]
477477
name = "cfg-if"

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ pub fn lower_to_hir(tcx: TyCtxt<'_>, (): ()) -> hir::Crate<'_> {
427427
tcx.ensure_with_value().early_lint_checks(());
428428
tcx.ensure_with_value().debugger_visualizers(LOCAL_CRATE);
429429
tcx.ensure_with_value().get_lang_items(());
430-
let (mut resolver, krate) = tcx.resolver_for_lowering(()).steal();
430+
let (mut resolver, krate) = tcx.resolver_for_lowering().steal();
431431

432432
let ast_index = index_crate(&resolver.node_id_to_def_id, &krate);
433433
let mut owners = IndexVec::from_fn_n(

compiler/rustc_ast_passes/src/ast_validation.rs

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -929,35 +929,38 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
929929
only_trait: only_trait.then_some(()),
930930
};
931931

932-
self.visibility_not_permitted(
933-
&item.vis,
934-
errors::VisibilityNotPermittedNote::IndividualImplItems,
935-
);
936-
if let &Unsafe::Yes(span) = unsafety {
937-
self.dcx().emit_err(errors::InherentImplCannotUnsafe {
938-
span: self_ty.span,
939-
annotation_span: span,
940-
annotation: "unsafe",
941-
self_ty: self_ty.span,
942-
});
943-
}
944-
if let &ImplPolarity::Negative(span) = polarity {
945-
self.dcx().emit_err(error(span, "negative", false));
946-
}
947-
if let &Defaultness::Default(def_span) = defaultness {
948-
self.dcx().emit_err(error(def_span, "`default`", true));
949-
}
950-
if let &Const::Yes(span) = constness {
951-
self.dcx().emit_err(error(span, "`const`", true));
952-
}
932+
self.with_in_trait_impl(None, |this| {
933+
this.visibility_not_permitted(
934+
&item.vis,
935+
errors::VisibilityNotPermittedNote::IndividualImplItems,
936+
);
937+
if let &Unsafe::Yes(span) = unsafety {
938+
this.dcx().emit_err(errors::InherentImplCannotUnsafe {
939+
span: self_ty.span,
940+
annotation_span: span,
941+
annotation: "unsafe",
942+
self_ty: self_ty.span,
943+
});
944+
}
945+
if let &ImplPolarity::Negative(span) = polarity {
946+
this.dcx().emit_err(error(span, "negative", false));
947+
}
948+
if let &Defaultness::Default(def_span) = defaultness {
949+
this.dcx().emit_err(error(def_span, "`default`", true));
950+
}
951+
if let &Const::Yes(span) = constness {
952+
this.dcx().emit_err(error(span, "`const`", true));
953+
}
953954

954-
self.visit_vis(&item.vis);
955-
self.visit_ident(item.ident);
956-
self.with_tilde_const(Some(DisallowTildeConstContext::Impl(item.span)), |this| {
957-
this.visit_generics(generics)
955+
this.visit_vis(&item.vis);
956+
this.visit_ident(item.ident);
957+
this.with_tilde_const(
958+
Some(DisallowTildeConstContext::Impl(item.span)),
959+
|this| this.visit_generics(generics),
960+
);
961+
this.visit_ty(self_ty);
962+
walk_list!(this, visit_assoc_item, items, AssocCtxt::Impl);
958963
});
959-
self.visit_ty(self_ty);
960-
walk_list!(self, visit_assoc_item, items, AssocCtxt::Impl);
961964
walk_list!(self, visit_attribute, &item.attrs);
962965
return; // Avoid visiting again.
963966
}

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
206206
);
207207
}
208208
}
209-
if !attr.is_doc_comment()
210-
&& let [seg, _] = attr.get_normal_item().path.segments.as_slice()
211-
&& seg.ident.name == sym::diagnostic
212-
&& !self.features.diagnostic_namespace
213-
{
214-
let msg = "`#[diagnostic]` attribute name space is experimental";
215-
gate!(self, diagnostic_namespace, seg.ident.span, msg);
216-
}
217209

218210
// Emit errors for non-staged-api crates.
219211
if !self.features.staged_api {

compiler/rustc_codegen_llvm/src/back/archive.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ fn llvm_machine_type(cpu: &str) -> LLVMMachineType {
5555
"x86_64" => LLVMMachineType::AMD64,
5656
"x86" => LLVMMachineType::I386,
5757
"aarch64" => LLVMMachineType::ARM64,
58+
"arm64ec" => LLVMMachineType::ARM64EC,
5859
"arm" => LLVMMachineType::ARM,
5960
_ => panic!("unsupported cpu type {cpu}"),
6061
}

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ pub enum LLVMMachineType {
5656
AMD64 = 0x8664,
5757
I386 = 0x14c,
5858
ARM64 = 0xaa64,
59+
ARM64EC = 0xa641,
5960
ARM = 0x01c0,
6061
}
6162

compiler/rustc_codegen_llvm/src/llvm_util.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,13 @@ impl<'a> IntoIterator for LLVMFeature<'a> {
201201
// which might lead to failures if the oldest tested / supported LLVM version
202202
// doesn't yet support the relevant intrinsics
203203
pub fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> LLVMFeature<'a> {
204-
let arch = if sess.target.arch == "x86_64" { "x86" } else { &*sess.target.arch };
204+
let arch = if sess.target.arch == "x86_64" {
205+
"x86"
206+
} else if sess.target.arch == "arm64ec" {
207+
"aarch64"
208+
} else {
209+
&*sess.target.arch
210+
};
205211
match (arch, s) {
206212
("x86", "sse4.2") => {
207213
LLVMFeature::with_dependency("sse4.2", TargetFeatureFoldStrength::EnableOnly("crc32"))

compiler/rustc_codegen_llvm/src/va_arg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ pub(super) fn emit_va_arg<'ll, 'tcx>(
288288
// Generic x86
289289
"x86" => emit_ptr_va_arg(bx, addr, target_ty, false, Align::from_bytes(4).unwrap(), true),
290290
// Windows AArch64
291-
"aarch64" if target.is_like_windows => {
291+
"aarch64" | "arm64ec" if target.is_like_windows => {
292292
emit_ptr_va_arg(bx, addr, target_ty, false, Align::from_bytes(8).unwrap(), false)
293293
}
294294
// macOS / iOS AArch64

compiler/rustc_codegen_ssa/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2021"
77
# tidy-alphabetical-start
88
ar_archive_writer = "0.1.5"
99
bitflags = "2.4.1"
10-
cc = "1.0.69"
10+
cc = "1.0.90"
1111
itertools = "0.11"
1212
jobserver = "0.1.28"
1313
pathdiff = "0.2.0"

compiler/rustc_codegen_ssa/src/back/metadata.rs

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::path::Path;
88
use object::write::{self, StandardSegment, Symbol, SymbolSection};
99
use object::{
1010
elf, pe, xcoff, Architecture, BinaryFormat, Endianness, FileFlags, Object, ObjectSection,
11-
ObjectSymbol, SectionFlags, SectionKind, SymbolFlags, SymbolKind, SymbolScope,
11+
ObjectSymbol, SectionFlags, SectionKind, SubArchitecture, SymbolFlags, SymbolKind, SymbolScope,
1212
};
1313

1414
use rustc_data_structures::memmap::Mmap;
@@ -182,37 +182,40 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
182182
Endian::Little => Endianness::Little,
183183
Endian::Big => Endianness::Big,
184184
};
185-
let architecture = match &sess.target.arch[..] {
186-
"arm" => Architecture::Arm,
187-
"aarch64" => {
185+
let (architecture, sub_architecture) = match &sess.target.arch[..] {
186+
"arm" => (Architecture::Arm, None),
187+
"aarch64" => (
188188
if sess.target.pointer_width == 32 {
189189
Architecture::Aarch64_Ilp32
190190
} else {
191191
Architecture::Aarch64
192-
}
193-
}
194-
"x86" => Architecture::I386,
195-
"s390x" => Architecture::S390x,
196-
"mips" | "mips32r6" => Architecture::Mips,
197-
"mips64" | "mips64r6" => Architecture::Mips64,
198-
"x86_64" => {
192+
},
193+
None,
194+
),
195+
"x86" => (Architecture::I386, None),
196+
"s390x" => (Architecture::S390x, None),
197+
"mips" | "mips32r6" => (Architecture::Mips, None),
198+
"mips64" | "mips64r6" => (Architecture::Mips64, None),
199+
"x86_64" => (
199200
if sess.target.pointer_width == 32 {
200201
Architecture::X86_64_X32
201202
} else {
202203
Architecture::X86_64
203-
}
204-
}
205-
"powerpc" => Architecture::PowerPc,
206-
"powerpc64" => Architecture::PowerPc64,
207-
"riscv32" => Architecture::Riscv32,
208-
"riscv64" => Architecture::Riscv64,
209-
"sparc64" => Architecture::Sparc64,
210-
"avr" => Architecture::Avr,
211-
"msp430" => Architecture::Msp430,
212-
"hexagon" => Architecture::Hexagon,
213-
"bpf" => Architecture::Bpf,
214-
"loongarch64" => Architecture::LoongArch64,
215-
"csky" => Architecture::Csky,
204+
},
205+
None,
206+
),
207+
"powerpc" => (Architecture::PowerPc, None),
208+
"powerpc64" => (Architecture::PowerPc64, None),
209+
"riscv32" => (Architecture::Riscv32, None),
210+
"riscv64" => (Architecture::Riscv64, None),
211+
"sparc64" => (Architecture::Sparc64, None),
212+
"avr" => (Architecture::Avr, None),
213+
"msp430" => (Architecture::Msp430, None),
214+
"hexagon" => (Architecture::Hexagon, None),
215+
"bpf" => (Architecture::Bpf, None),
216+
"loongarch64" => (Architecture::LoongArch64, None),
217+
"csky" => (Architecture::Csky, None),
218+
"arm64ec" => (Architecture::Aarch64, Some(SubArchitecture::Arm64EC)),
216219
// Unsupported architecture.
217220
_ => return None,
218221
};
@@ -227,6 +230,7 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
227230
};
228231

229232
let mut file = write::Object::new(binary_format, architecture, endianness);
233+
file.set_sub_architecture(sub_architecture);
230234
if sess.target.is_like_osx {
231235
if macho_is_arm64e(&sess.target) {
232236
file.set_macho_cpu_subtype(object::macho::CPU_SUBTYPE_ARM64E);
@@ -335,7 +339,7 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
335339
"ilp32s" | "lp64s" => e_flags |= elf::EF_LARCH_ABI_SOFT_FLOAT,
336340
"ilp32f" | "lp64f" => e_flags |= elf::EF_LARCH_ABI_SINGLE_FLOAT,
337341
"ilp32d" | "lp64d" => e_flags |= elf::EF_LARCH_ABI_DOUBLE_FLOAT,
338-
_ => bug!("unknown RISC-V ABI name"),
342+
_ => bug!("unknown LoongArch ABI name"),
339343
}
340344

341345
e_flags

0 commit comments

Comments
 (0)