Skip to content

Commit c9e0610

Browse files
committed
Auto merge of #3227 - rust-lang:rustup-2023-12-15, r=RalfJung
Automatic Rustup
2 parents 5747646 + b0d92a7 commit c9e0610

File tree

371 files changed

+1909
-1456
lines changed

Some content is hidden

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

371 files changed

+1909
-1456
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
[submodule "src/llvm-project"]
3434
path = src/llvm-project
3535
url = https://github.com/rust-lang/llvm-project.git
36-
branch = rustc/17.0-2023-09-19
36+
branch = rustc/17.0-2023-12-14
3737
shallow = true
3838
[submodule "src/doc/embedded-book"]
3939
path = src/doc/embedded-book

Cargo.lock

Lines changed: 9 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ dependencies = [
548548
"futures",
549549
"if_chain",
550550
"itertools",
551-
"parking_lot 0.12.1",
551+
"parking_lot",
552552
"quote",
553553
"regex",
554554
"rustc_tools_util",
@@ -866,16 +866,6 @@ dependencies = [
866866
"typenum",
867867
]
868868

869-
[[package]]
870-
name = "cstr"
871-
version = "0.2.8"
872-
source = "registry+https://github.com/rust-lang/crates.io-index"
873-
checksum = "c11a39d776a3b35896711da8a04dc1835169dcd36f710878187637314e47941b"
874-
dependencies = [
875-
"proc-macro2",
876-
"quote",
877-
]
878-
879869
[[package]]
880870
name = "ctrlc"
881871
version = "3.4.0"
@@ -2366,13 +2356,13 @@ dependencies = [
23662356

23672357
[[package]]
23682358
name = "measureme"
2369-
version = "10.1.1"
2359+
version = "10.1.2"
23702360
source = "registry+https://github.com/rust-lang/crates.io-index"
2371-
checksum = "1930d162935fecd56fc4e0f6729eb3483bac1264542eb4ea31570b86a434b6bc"
2361+
checksum = "45e381dcdad44c3c435f8052b08c5c4a1449c48ab56f312345eae12d7a693dbe"
23722362
dependencies = [
23732363
"log",
23742364
"memmap2",
2375-
"parking_lot 0.11.2",
2365+
"parking_lot",
23762366
"perf-event-open-sys",
23772367
"rustc-hash",
23782368
"smallvec",
@@ -2790,39 +2780,14 @@ dependencies = [
27902780
"unicode-width",
27912781
]
27922782

2793-
[[package]]
2794-
name = "parking_lot"
2795-
version = "0.11.2"
2796-
source = "registry+https://github.com/rust-lang/crates.io-index"
2797-
checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
2798-
dependencies = [
2799-
"instant",
2800-
"lock_api",
2801-
"parking_lot_core 0.8.6",
2802-
]
2803-
28042783
[[package]]
28052784
name = "parking_lot"
28062785
version = "0.12.1"
28072786
source = "registry+https://github.com/rust-lang/crates.io-index"
28082787
checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
28092788
dependencies = [
28102789
"lock_api",
2811-
"parking_lot_core 0.9.8",
2812-
]
2813-
2814-
[[package]]
2815-
name = "parking_lot_core"
2816-
version = "0.8.6"
2817-
source = "registry+https://github.com/rust-lang/crates.io-index"
2818-
checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc"
2819-
dependencies = [
2820-
"cfg-if",
2821-
"instant",
2822-
"libc",
2823-
"redox_syscall 0.2.16",
2824-
"smallvec",
2825-
"winapi",
2790+
"parking_lot_core",
28262791
]
28272792

28282793
[[package]]
@@ -3582,7 +3547,6 @@ name = "rustc_codegen_llvm"
35823547
version = "0.0.0"
35833548
dependencies = [
35843549
"bitflags 1.3.2",
3585-
"cstr",
35863550
"itertools",
35873551
"libc",
35883552
"measureme",
@@ -3693,7 +3657,7 @@ dependencies = [
36933657
"libc",
36943658
"measureme",
36953659
"memmap2",
3696-
"parking_lot 0.12.1",
3660+
"parking_lot",
36973661
"portable-atomic",
36983662
"rustc-hash",
36993663
"rustc-rayon",
@@ -4428,7 +4392,7 @@ dependencies = [
44284392
name = "rustc_query_system"
44294393
version = "0.0.0"
44304394
dependencies = [
4431-
"parking_lot 0.12.1",
4395+
"parking_lot",
44324396
"rustc-rayon-core",
44334397
"rustc_ast",
44344398
"rustc_data_structures",
@@ -5145,7 +5109,7 @@ checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b"
51455109
dependencies = [
51465110
"new_debug_unreachable",
51475111
"once_cell",
5148-
"parking_lot 0.12.1",
5112+
"parking_lot",
51495113
"phf_shared",
51505114
"precomputed-hash",
51515115
"serde",
@@ -5670,7 +5634,7 @@ dependencies = [
56705634
"matchers",
56715635
"nu-ansi-term",
56725636
"once_cell",
5673-
"parking_lot 0.12.1",
5637+
"parking_lot",
56745638
"regex",
56755639
"sharded-slab",
56765640
"smallvec",

compiler/rustc_borrowck/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2502,8 +2502,8 @@ mod error {
25022502
if !self.errors.buffered.is_empty() {
25032503
self.errors.buffered.sort_by_key(|diag| diag.sort_span);
25042504

2505-
for mut diag in self.errors.buffered.drain(..) {
2506-
self.infcx.tcx.sess.diagnostic().emit_diagnostic(&mut diag);
2505+
for diag in self.errors.buffered.drain(..) {
2506+
self.infcx.tcx.sess.diagnostic().emit_diagnostic(diag);
25072507
}
25082508
}
25092509

compiler/rustc_borrowck/src/region_infer/opaque_types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ fn check_opaque_type_well_formed<'tcx>(
315315
parent_def_id = tcx.local_parent(parent_def_id);
316316
}
317317

318-
// FIXME(-Ztrait-solver=next): We probably should use `DefiningAnchor::Error`
318+
// FIXME(-Znext-solver): We probably should use `DefiningAnchor::Error`
319319
// and prepopulate this `InferCtxt` with known opaque values, rather than
320320
// using the `Bind` anchor here. For now it's fine.
321321
let infcx = tcx

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,16 +1003,16 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
10031003
reported_errors: Default::default(),
10041004
};
10051005

1006-
// FIXME(-Ztrait-solver=next): A bit dubious that we're only registering
1006+
// FIXME(-Znext-solver): A bit dubious that we're only registering
10071007
// predefined opaques in the typeck root.
10081008
if infcx.next_trait_solver() && !infcx.tcx.is_typeck_child(body.source.def_id()) {
1009-
checker.register_predefined_opaques_in_new_solver();
1009+
checker.register_predefined_opaques_for_next_solver();
10101010
}
10111011

10121012
checker
10131013
}
10141014

1015-
pub(super) fn register_predefined_opaques_in_new_solver(&mut self) {
1015+
pub(super) fn register_predefined_opaques_for_next_solver(&mut self) {
10161016
// OK to use the identity arguments for each opaque type key, since
10171017
// we remap opaques from HIR typeck back to their definition params.
10181018
let opaques: Vec<_> = self

compiler/rustc_builtin_macros/src/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ impl<'a> IntoDiagnostic<'a> for EnvNotDefinedWithUserMessage {
453453
rustc::untranslatable_diagnostic,
454454
reason = "cannot translate user-provided messages"
455455
)]
456-
let mut diag = handler.struct_diagnostic(self.msg_from_user.to_string());
456+
let mut diag = handler.struct_err(self.msg_from_user.to_string());
457457
diag.set_span(self.span);
458458
diag
459459
}
@@ -804,7 +804,7 @@ pub(crate) struct AsmClobberNoReg {
804804
impl<'a> IntoDiagnostic<'a> for AsmClobberNoReg {
805805
fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
806806
let mut diag =
807-
handler.struct_diagnostic(crate::fluent_generated::builtin_macros_asm_clobber_no_reg);
807+
handler.struct_err(crate::fluent_generated::builtin_macros_asm_clobber_no_reg);
808808
diag.set_span(self.spans.clone());
809809
// eager translation as `span_labels` takes `AsRef<str>`
810810
let lbl1 = handler.eagerly_translate_to_string(

compiler/rustc_codegen_cranelift/example/gen_block_iterate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copied from https://github.com/rust-lang/rust/blob/46455dc65069387f2dc46612f13fd45452ab301a/tests/ui/coroutine/gen_block_iterate.rs
22
// revisions: next old
33
//compile-flags: --edition 2024 -Zunstable-options
4-
//[next] compile-flags: -Ztrait-solver=next
4+
//[next] compile-flags: -Znext-solver
55
// run-pass
66
#![feature(gen_blocks)]
77

compiler/rustc_codegen_gcc/src/allocator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ fn create_wrapper_function(
9090
.collect();
9191
let func = context.new_function(None, FunctionType::Exported, output.unwrap_or(void), &args, from_name, false);
9292

93-
if tcx.sess.target.options.default_hidden_visibility {
93+
if tcx.sess.default_hidden_visibility() {
9494
#[cfg(feature="master")]
9595
func.add_attribute(FnAttribute::Visibility(gccjit::Visibility::Hidden));
9696
}

compiler/rustc_codegen_gcc/src/gcc_util.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
use gccjit::Context;
33
use smallvec::{smallvec, SmallVec};
44

5-
use rustc_codegen_ssa::target_features::{
6-
supported_target_features, tied_target_features, RUSTC_SPECIFIC_FEATURES,
7-
};
85
use rustc_data_structures::fx::FxHashMap;
96
use rustc_middle::bug;
107
use rustc_session::Session;
8+
use rustc_target::target_features::RUSTC_SPECIFIC_FEATURES;
119

1210
use crate::errors::{PossibleFeature, TargetFeatureDisableOrEnable, UnknownCTargetFeature, UnknownCTargetFeaturePrefix};
1311

@@ -44,7 +42,7 @@ pub(crate) fn global_gcc_features(sess: &Session, diagnostics: bool) -> Vec<Stri
4442
);
4543

4644
// -Ctarget-features
47-
let supported_features = supported_target_features(sess);
45+
let supported_features = sess.target.supported_target_features();
4846
let mut featsmap = FxHashMap::default();
4947
let feats = sess.opts.cg.target_feature
5048
.split(',')
@@ -187,7 +185,7 @@ pub fn to_gcc_features<'a>(sess: &Session, s: &'a str) -> SmallVec<[&'a str; 2]>
187185
// Given a map from target_features to whether they are enabled or disabled,
188186
// ensure only valid combinations are allowed.
189187
pub fn check_tied_features(sess: &Session, features: &FxHashMap<&str, bool>) -> Option<&'static [&'static str]> {
190-
for tied in tied_target_features(sess) {
188+
for tied in sess.target.tied_target_features() {
191189
// Tied features must be set to the same value, or not set at all
192190
let mut tied_iter = tied.iter();
193191
let enabled = features.get(tied_iter.next().unwrap());

compiler/rustc_codegen_gcc/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ use rustc_codegen_ssa::{CodegenResults, CompiledModule, ModuleCodegen};
9797
use rustc_codegen_ssa::base::codegen_crate;
9898
use rustc_codegen_ssa::back::write::{CodegenContext, FatLtoInput, ModuleConfig, TargetMachineFactoryFn};
9999
use rustc_codegen_ssa::back::lto::{LtoModuleCodegen, SerializedModule, ThinModule};
100-
use rustc_codegen_ssa::target_features::supported_target_features;
101100
use rustc_data_structures::fx::FxIndexMap;
102101
use rustc_data_structures::sync::IntoDynSyncSend;
103102
use rustc_codegen_ssa::traits::{CodegenBackend, ExtraBackendMethods, ThinBufferMethods, WriteBackendMethods};
@@ -397,7 +396,9 @@ fn to_gcc_opt_level(optlevel: Option<OptLevel>) -> OptimizationLevel {
397396
}
398397

399398
pub fn target_features(sess: &Session, allow_unstable: bool, target_info: &LockedTargetInfo) -> Vec<Symbol> {
400-
supported_target_features(sess)
399+
sess
400+
.target
401+
.supported_target_features()
401402
.iter()
402403
.filter_map(
403404
|&(feature, gate)| {

compiler/rustc_codegen_llvm/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ test = false
99
[dependencies]
1010
# tidy-alphabetical-start
1111
bitflags = "1.0"
12-
cstr = "0.2"
1312
itertools = "0.11"
1413
libc = "0.2"
1514
measureme = "10.0.0"

compiler/rustc_codegen_llvm/src/allocator.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub(crate) unsafe fn codegen(
7676
// __rust_alloc_error_handler_should_panic
7777
let name = OomStrategy::SYMBOL;
7878
let ll_g = llvm::LLVMRustGetOrInsertGlobal(llmod, name.as_ptr().cast(), name.len(), i8);
79-
if tcx.sess.target.default_hidden_visibility {
79+
if tcx.sess.default_hidden_visibility() {
8080
llvm::LLVMRustSetVisibility(ll_g, llvm::Visibility::Hidden);
8181
}
8282
let val = tcx.sess.opts.unstable_opts.oom.should_panic();
@@ -85,7 +85,7 @@ pub(crate) unsafe fn codegen(
8585

8686
let name = NO_ALLOC_SHIM_IS_UNSTABLE;
8787
let ll_g = llvm::LLVMRustGetOrInsertGlobal(llmod, name.as_ptr().cast(), name.len(), i8);
88-
if tcx.sess.target.default_hidden_visibility {
88+
if tcx.sess.default_hidden_visibility() {
8989
llvm::LLVMRustSetVisibility(ll_g, llvm::Visibility::Hidden);
9090
}
9191
let llval = llvm::LLVMConstInt(i8, 0, False);
@@ -130,7 +130,7 @@ fn create_wrapper_function(
130130
None
131131
};
132132

133-
if tcx.sess.target.default_hidden_visibility {
133+
if tcx.sess.default_hidden_visibility() {
134134
llvm::LLVMRustSetVisibility(llfn, llvm::Visibility::Hidden);
135135
}
136136
if tcx.sess.must_emit_unwind_tables() {
@@ -146,7 +146,7 @@ fn create_wrapper_function(
146146
}
147147
llvm::LLVMRustSetVisibility(callee, llvm::Visibility::Hidden);
148148

149-
let llbb = llvm::LLVMAppendBasicBlockInContext(llcx, llfn, "entry\0".as_ptr().cast());
149+
let llbb = llvm::LLVMAppendBasicBlockInContext(llcx, llfn, c"entry".as_ptr().cast());
150150

151151
let llbuilder = llvm::LLVMCreateBuilderInContext(llcx);
152152
llvm::LLVMPositionBuilderAtEnd(llbuilder, llbb);

compiler/rustc_codegen_llvm/src/back/lto.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ pub(crate) fn run_pass_manager(
631631
llvm::LLVMRustAddModuleFlag(
632632
module.module_llvm.llmod(),
633633
llvm::LLVMModFlagBehavior::Error,
634-
"LTOPostLink\0".as_ptr().cast(),
634+
c"LTOPostLink".as_ptr().cast(),
635635
1,
636636
);
637637
}

compiler/rustc_codegen_llvm/src/back/write.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,7 @@ fn target_is_aix(cgcx: &CodegenContext<LlvmCodegenBackend>) -> bool {
916916
cgcx.opts.target_triple.triple().contains("-aix")
917917
}
918918

919+
//FIXME use c string literals here too
919920
pub(crate) fn bitcode_section_name(cgcx: &CodegenContext<LlvmCodegenBackend>) -> &'static str {
920921
if target_is_apple(cgcx) {
921922
"__LLVM,__bitcode\0"
@@ -994,7 +995,7 @@ unsafe fn embed_bitcode(
994995
let llglobal = llvm::LLVMAddGlobal(
995996
llmod,
996997
common::val_ty(llconst),
997-
"rustc.embedded.module\0".as_ptr().cast(),
998+
c"rustc.embedded.module".as_ptr().cast(),
998999
);
9991000
llvm::LLVMSetInitializer(llglobal, llconst);
10001001

@@ -1007,15 +1008,15 @@ unsafe fn embed_bitcode(
10071008
let llglobal = llvm::LLVMAddGlobal(
10081009
llmod,
10091010
common::val_ty(llconst),
1010-
"rustc.embedded.cmdline\0".as_ptr().cast(),
1011+
c"rustc.embedded.cmdline".as_ptr().cast(),
10111012
);
10121013
llvm::LLVMSetInitializer(llglobal, llconst);
10131014
let section = if is_apple {
1014-
"__LLVM,__cmdline\0"
1015+
c"__LLVM,__cmdline"
10151016
} else if is_aix {
1016-
".info\0"
1017+
c".info"
10171018
} else {
1018-
".llvmcmd\0"
1019+
c".llvmcmd"
10191020
};
10201021
llvm::LLVMSetSection(llglobal, section.as_ptr().cast());
10211022
llvm::LLVMRustSetLinkage(llglobal, llvm::Linkage::PrivateLinkage);

compiler/rustc_codegen_llvm/src/base.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ use crate::context::CodegenCx;
1919
use crate::llvm;
2020
use crate::value::Value;
2121

22-
use cstr::cstr;
23-
2422
use rustc_codegen_ssa::base::maybe_create_entry_wrapper;
2523
use rustc_codegen_ssa::mono_item::MonoItemExt;
2624
use rustc_codegen_ssa::traits::*;
@@ -110,11 +108,11 @@ pub fn compile_codegen_unit(tcx: TyCtxt<'_>, cgu_name: Symbol) -> (ModuleCodegen
110108

111109
// Create the llvm.used and llvm.compiler.used variables.
112110
if !cx.used_statics.borrow().is_empty() {
113-
cx.create_used_variable_impl(cstr!("llvm.used"), &*cx.used_statics.borrow());
111+
cx.create_used_variable_impl(c"llvm.used", &*cx.used_statics.borrow());
114112
}
115113
if !cx.compiler_used_statics.borrow().is_empty() {
116114
cx.create_used_variable_impl(
117-
cstr!("llvm.compiler.used"),
115+
c"llvm.compiler.used",
118116
&*cx.compiler_used_statics.borrow(),
119117
);
120118
}

0 commit comments

Comments
 (0)