Skip to content

Commit 4b31fde

Browse files
committed
Auto merge of #159696 - jhpratt:rollup-cuL0oZw, r=<try>
Rollup of 13 pull requests try-job: dist-various-1 try-job: test-various try-job: x86_64-gnu-aux try-job: x86_64-gnu-llvm-21-3 try-job: x86_64-msvc-1 try-job: aarch64-apple try-job: x86_64-mingw-1 try-job: i686-msvc-*
2 parents 0e29c21 + 59c79fb commit 4b31fde

210 files changed

Lines changed: 2008 additions & 1633 deletions

File tree

Some content is hidden

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

‎compiler/rustc_ast_passes/src/feature_gate.rs‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use rustc_ast::visit::{self, AssocCtxt, FnCtxt, FnKind, Visitor};
1+
use rustc_ast::visit::{self, AssocCtxt, FnKind, Visitor};
22
use rustc_ast::{self as ast, AttrVec, GenericBound, NodeId, PatKind, attr, token};
33
use rustc_attr_parsing::AttributeParser;
44
use rustc_errors::msg;
@@ -366,7 +366,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
366366
visit::walk_poly_trait_ref(self, t);
367367
}
368368

369-
fn visit_fn(&mut self, fn_kind: FnKind<'a>, _: &AttrVec, span: Span, _: NodeId) {
369+
fn visit_fn(&mut self, fn_kind: FnKind<'a>, _: &AttrVec, _: Span, _: NodeId) {
370370
if let Some(_header) = fn_kind.header() {
371371
// Stability of const fn methods are covered in `visit_assoc_item` below.
372372
}
@@ -375,10 +375,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
375375
self.check_late_bound_lifetime_defs(generic_params);
376376
}
377377

378-
if fn_kind.ctxt() != Some(FnCtxt::Foreign) && fn_kind.decl().c_variadic() {
379-
gate!(self, c_variadic, span, "C-variadic functions are unstable");
380-
}
381-
382378
visit::walk_fn(self, fn_kind)
383379
}
384380

‎compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1635,7 +1635,7 @@ fn build_unsafe_binder_type_di_node<'ll, 'tcx>(
16351635
binder_type
16361636
)
16371637
};
1638-
let inner_type = inner.skip_binder();
1638+
let inner_type = cx.tcx.instantiate_bound_regions_with_erased((*inner).into());
16391639
let inner_type_di_node = type_di_node(cx, inner_type);
16401640

16411641
let type_name = compute_debuginfo_type_name(cx.tcx, binder_type, true);

‎compiler/rustc_codegen_ssa/src/back/linker.rs‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,8 +1944,13 @@ impl<'a> Linker for LlbcLinker<'a> {
19441944
self.link_or_cc_arg(path);
19451945
}
19461946

1947-
fn debuginfo(&mut self, _strip: Strip, _: &[PathBuf]) {
1948-
self.link_arg("--debug");
1947+
fn debuginfo(&mut self, strip: Strip, _: &[PathBuf]) {
1948+
match strip {
1949+
Strip::None => {
1950+
self.link_arg("--debug");
1951+
}
1952+
Strip::Debuginfo | Strip::Symbols => {}
1953+
}
19491954
}
19501955

19511956
fn optimize(&mut self) {

‎compiler/rustc_driver_impl/src/lib.rs‎

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -231,28 +231,21 @@ pub fn run_compiler(at_args: &[String], callbacks: &mut (dyn Callbacks + Send))
231231
let sess = &compiler.sess;
232232
let codegen_backend = &*compiler.codegen_backend;
233233

234-
// This is used for early exits unrelated to errors. E.g. when just
235-
// printing some information without compiling, or exiting immediately
236-
// after parsing, etc.
237-
let early_exit = || {
238-
sess.dcx().abort_if_errors();
239-
};
240-
241234
// This implements `-Whelp`. It should be handled very early, like
242235
// `--help`/`-Zhelp`/`-Chelp`. This is the earliest it can run, because
243236
// it must happen after lints are registered, during session creation.
244237
if sess.opts.describe_lints {
245238
describe_lints(sess, registered_lints);
246-
return early_exit();
239+
return;
247240
}
248241

249242
// We have now handled all help options, exit
250243
if help_only {
251-
return early_exit();
244+
return;
252245
}
253246

254247
if print_crate_info(codegen_backend, sess, has_input) == Compilation::Stop {
255-
return early_exit();
248+
return;
256249
}
257250

258251
if !has_input {
@@ -261,12 +254,12 @@ pub fn run_compiler(at_args: &[String], callbacks: &mut (dyn Callbacks + Send))
261254

262255
if !sess.opts.unstable_opts.ls.is_empty() {
263256
list_metadata(sess, &*codegen_backend.metadata_loader());
264-
return early_exit();
257+
return;
265258
}
266259

267260
if sess.opts.unstable_opts.link_only {
268261
process_rlink(sess, compiler);
269-
return early_exit();
262+
return;
270263
}
271264

272265
// Parse the crate root source code (doesn't parse submodules yet)
@@ -285,28 +278,23 @@ pub fn run_compiler(at_args: &[String], callbacks: &mut (dyn Callbacks + Send))
285278
pretty::print(sess, pp_mode, pretty::PrintExtra::AfterParsing { krate: &krate });
286279
}
287280
trace!("finished pretty-printing");
288-
return early_exit();
281+
return;
289282
}
290283

291284
if callbacks.after_crate_root_parsing(compiler, &mut krate) == Compilation::Stop {
292-
return early_exit();
285+
return;
293286
}
294287

295288
if sess.opts.unstable_opts.parse_crate_root_only {
296-
return early_exit();
289+
return;
297290
}
298291

299292
let linker = create_and_enter_global_ctxt(compiler, krate, |tcx| {
300-
let early_exit = || {
301-
sess.dcx().abort_if_errors();
302-
None
303-
};
304-
305293
// Make sure name resolution and macro expansion is run.
306294
let _ = tcx.resolver_for_lowering();
307295

308296
if callbacks.after_expansion(compiler, tcx) == Compilation::Stop {
309-
return early_exit();
297+
return None;
310298
}
311299

312300
passes::write_dep_info(tcx);
@@ -316,11 +304,11 @@ pub fn run_compiler(at_args: &[String], callbacks: &mut (dyn Callbacks + Send))
316304
if sess.opts.output_types.contains_key(&OutputType::DepInfo)
317305
&& sess.opts.output_types.len() == 1
318306
{
319-
return early_exit();
307+
return None;
320308
}
321309

322310
if sess.opts.unstable_opts.no_analysis {
323-
return early_exit();
311+
return None;
324312
}
325313

326314
tcx.ensure_ok().analysis(());
@@ -330,16 +318,16 @@ pub fn run_compiler(at_args: &[String], callbacks: &mut (dyn Callbacks + Send))
330318
}
331319

332320
if callbacks.after_analysis(compiler, tcx) == Compilation::Stop {
333-
return early_exit();
321+
return None;
334322
}
335323

336-
if tcx.sess.opts.output_types.contains_key(&OutputType::Mir) {
324+
if sess.opts.output_types.contains_key(&OutputType::Mir) {
337325
if let Err(error) = pretty::emit_mir(tcx) {
338326
tcx.dcx().emit_fatal(CantEmitMIR { error });
339327
}
340328
}
341329

342-
let linker = Linker::codegen_and_build_linker(tcx, &*compiler.codegen_backend);
330+
let linker = Linker::codegen_and_build_linker(tcx, codegen_backend);
343331

344332
tcx.report_unused_features();
345333

‎compiler/rustc_feature/src/accepted.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ declare_features! (
9494
(accepted, c_str_literals, "1.77.0", Some(105723)),
9595
/// Allows `extern "C-unwind" fn` to enable unwinding across ABI boundaries and treat `extern "C" fn` as nounwind.
9696
(accepted, c_unwind, "1.81.0", Some(74990)),
97+
/// Allows using C-variadics.
98+
(accepted, c_variadic, "CURRENT_RUSTC_VERSION", Some(44930)),
9799
/// Allows `#[cfg_attr(predicate, multiple, attributes, here)]`.
98100
(accepted, cfg_attr_multi, "1.33.0", Some(54881)),
99101
/// Allows the use of `#[cfg(<true/false>)]`.

‎compiler/rustc_feature/src/unstable.rs‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,6 @@ declare_features! (
424424
(unstable, avx10_target_feature, "1.88.0", Some(138843)),
425425
/// Target features on bpf.
426426
(unstable, bpf_target_feature, "1.54.0", Some(150247)),
427-
/// Allows using C-variadics.
428-
(unstable, c_variadic, "1.34.0", Some(44930)),
429427
/// Allows defining c-variadic functions on targets where this feature has not yet
430428
/// undergone sufficient testing for stabilization.
431429
(unstable, c_variadic_experimental_arch, "1.97.0", Some(155973)),

0 commit comments

Comments
 (0)