Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
08b188c
Remove `cleanup_debug_info_options`
Zalathar Oct 28, 2025
bd57886
Test that auxiliaries are built against their own directives
Zalathar Oct 28, 2025
c627945
Don't modify `testpaths` when creating aux contexts
Zalathar Oct 28, 2025
6dfc82b
Remove some parameters that are always `self.testpaths`
Zalathar Oct 28, 2025
720bfff
Rename `compute_aux_paths` to `resolve_aux_path`
Zalathar Oct 28, 2025
48f8f23
Remove a special case for rust_eh_personality from reachable_non_gene…
bjorn3 Oct 29, 2025
1b78417
Remove special case for the panic runtime from reachable_non_generics
bjorn3 Oct 29, 2025
3a02b35
Add tests to demonstrate explicit tail call bug
InvalidPathException Oct 29, 2025
52959a8
Fix musttail returns for cast/indirect ABIs
InvalidPathException Oct 29, 2025
cac6f87
Do not emit solver errors that contain error types
oli-obk Jul 23, 2025
0efeec5
Mention crate being analysized in query description
estebank Sep 28, 2025
2044a5f
Separate debugger discovery from debugger version-query
Zalathar Oct 24, 2025
c7a80ab
Only pass debugger-related flags for `debuginfo` tests
Zalathar Oct 25, 2025
4587ea7
Extract some discovery code for debuginfo tests into submodules
Zalathar Oct 25, 2025
4220f7c
confirmed success built rustc 1.91.0 + host tools for win7
Fenex Nov 1, 2025
4192223
Rollup merge of #147137 - estebank:issue-74380, r=nnethercote
matthiaskrgr Nov 1, 2025
a3e44c7
Rollup merge of #148099 - Zalathar:debuggers, r=jieyouxu
matthiaskrgr Nov 1, 2025
94f71d0
Rollup merge of #148194 - Zalathar:no-cleanup, r=jieyouxu
matthiaskrgr Nov 1, 2025
6eb0f92
Rollup merge of #148199 - Zalathar:paths, r=jieyouxu
matthiaskrgr Nov 1, 2025
10623cf
Rollup merge of #148240 - InvalidPathException:master, r=WaffleLapkin
matthiaskrgr Nov 1, 2025
c09c885
Rollup merge of #148247 - bjorn3:minor_symbol_export_cleanup, r=Waffl…
matthiaskrgr Nov 1, 2025
ccc8265
Rollup merge of #148290 - oli-obk:push-qwxvxyopypry, r=nnethercote
matthiaskrgr Nov 1, 2025
a4e8997
Rollup merge of #148362 - Fenex:docs/platform-support-win7, r=Noratrieb
matthiaskrgr Nov 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions compiler/rustc_codegen_llvm/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use rustc_codegen_ssa::mir::place::PlaceRef;
use rustc_codegen_ssa::traits::*;
use rustc_data_structures::small_c_str::SmallCStr;
use rustc_hir::def_id::DefId;
use rustc_middle::bug;
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs;
use rustc_middle::ty::layout::{
FnAbiError, FnAbiOfHelpers, FnAbiRequest, HasTypingEnv, LayoutError, LayoutOfHelpers,
Expand Down Expand Up @@ -1458,10 +1457,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {

match &fn_abi.ret.mode {
PassMode::Ignore | PassMode::Indirect { .. } => self.ret_void(),
PassMode::Direct(_) | PassMode::Pair { .. } => self.ret(call),
mode @ PassMode::Cast { .. } => {
bug!("Encountered `PassMode::{mode:?}` during codegen")
}
PassMode::Direct(_) | PassMode::Pair { .. } | PassMode::Cast { .. } => self.ret(call),
}
}

Expand Down
24 changes: 8 additions & 16 deletions compiler/rustc_codegen_ssa/src/back/symbol_export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,7 @@ fn reachable_non_generics_provider(tcx: TyCtxt<'_>, _: LocalCrate) -> DefIdMap<S
return Default::default();
}

// Check to see if this crate is a "special runtime crate". These
// crates, implementation details of the standard library, typically
// have a bunch of `pub extern` and `#[no_mangle]` functions as the
// ABI between them. We don't want their symbols to have a `C`
// export level, however, as they're just implementation details.
// Down below we'll hardwire all of the symbols to the `Rust` export
// level instead.
let special_runtime_crate =
tcx.is_panic_runtime(LOCAL_CRATE) || tcx.is_compiler_builtins(LOCAL_CRATE);
let is_compiler_builtins = tcx.is_compiler_builtins(LOCAL_CRATE);

let mut reachable_non_generics: DefIdMap<_> = tcx
.reachable_set(())
Expand Down Expand Up @@ -104,11 +96,12 @@ fn reachable_non_generics_provider(tcx: TyCtxt<'_>, _: LocalCrate) -> DefIdMap<S
if tcx.cross_crate_inlinable(def_id) { None } else { Some(def_id) }
})
.map(|def_id| {
// We won't link right if this symbol is stripped during LTO.
let name = tcx.symbol_name(Instance::mono(tcx, def_id.to_def_id())).name;
let used = name == "rust_eh_personality";

let export_level = if special_runtime_crate {
let export_level = if is_compiler_builtins {
// We don't want to export compiler-builtins symbols from any
// dylibs, even rust dylibs. Unlike all other crates it gets
// duplicated in every linker invocation and it may otherwise
// unintentionally override definitions of these symbols by
// libgcc or compiler-rt for C code.
SymbolExportLevel::Rust
} else {
symbol_export_level(tcx, def_id.to_def_id())
Expand All @@ -131,8 +124,7 @@ fn reachable_non_generics_provider(tcx: TyCtxt<'_>, _: LocalCrate) -> DefIdMap<S
SymbolExportKind::Text
},
used: codegen_attrs.flags.contains(CodegenFnAttrFlags::USED_COMPILER)
|| codegen_attrs.flags.contains(CodegenFnAttrFlags::USED_LINKER)
|| used,
|| codegen_attrs.flags.contains(CodegenFnAttrFlags::USED_LINKER),
rustc_std_internal_symbol: codegen_attrs
.flags
.contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL),
Expand Down
12 changes: 11 additions & 1 deletion compiler/rustc_codegen_ssa/src/mir/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,17 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
let return_dest = self.make_return_dest(bx, destination, &fn_abi.ret, &mut llargs);
target.map(|target| (return_dest, target))
}
CallKind::Tail => None,
CallKind::Tail => {
if fn_abi.ret.is_indirect() {
match self.make_return_dest(bx, destination, &fn_abi.ret, &mut llargs) {
ReturnDest::Nothing => {}
_ => bug!(
"tail calls to functions with indirect returns cannot store into a destination"
),
}
}
None
}
};

// Split the rust-call tupled arguments off.
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_infer/src/traits/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use rustc_data_structures::snapshot_map::{self, SnapshotMapRef, SnapshotMapStorage};
use rustc_data_structures::undo_log::Rollback;
use rustc_macros::TypeVisitable;
use rustc_middle::traits::EvaluationResult;
use rustc_middle::ty;
use tracing::{debug, info};
Expand All @@ -12,7 +13,7 @@ use crate::infer::snapshot::undo_log::InferCtxtUndoLogs;
pub(crate) type UndoLog<'tcx> =
snapshot_map::UndoLog<ProjectionCacheKey<'tcx>, ProjectionCacheEntry<'tcx>>;

#[derive(Clone)]
#[derive(Clone, TypeVisitable)]
pub struct MismatchedProjectionTypes<'tcx> {
pub err: ty::error::TypeError<'tcx>,
}
Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_middle/src/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,10 @@ rustc_queries! {
/// The root query triggering all analysis passes like typeck or borrowck.
query analysis(key: ()) {
eval_always
desc { "running analysis passes on this crate" }
desc { |tcx|
"running analysis passes on crate `{}`",
tcx.crate_name(LOCAL_CRATE),
}
}

/// This query checks the fulfillment of collected lint expectations.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use rustc_infer::traits::{
PredicateObligation, SelectionError,
};
use rustc_middle::ty::print::{PrintTraitRefExt as _, with_no_trimmed_paths};
use rustc_middle::ty::{self, Ty, TyCtxt};
use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt as _};
use rustc_span::{DesugaringKind, ErrorGuaranteed, ExpnKind, Span};
use tracing::{info, instrument};

Expand Down Expand Up @@ -253,7 +253,10 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {

for from_expansion in [false, true] {
for (error, suppressed) in iter::zip(&errors, &is_suppressed) {
if !suppressed && error.obligation.cause.span.from_expansion() == from_expansion {
if !suppressed
&& error.obligation.cause.span.from_expansion() == from_expansion
&& !error.references_error()
{
let guar = self.report_fulfillment_error(error);
self.infcx.set_tainted_by_errors(guar);
reported = Some(guar);
Expand Down
5 changes: 3 additions & 2 deletions compiler/rustc_trait_selection/src/traits/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use std::ops::ControlFlow;
use rustc_errors::ErrorGuaranteed;
use rustc_hir::def::DefKind;
pub use rustc_infer::traits::*;
use rustc_macros::TypeVisitable;
use rustc_middle::query::Providers;
use rustc_middle::span_bug;
use rustc_middle::ty::error::{ExpectedFound, TypeError};
Expand Down Expand Up @@ -75,7 +76,7 @@ use crate::infer::{InferCtxt, TyCtxtInferExt};
use crate::regions::InferCtxtRegionExt;
use crate::traits::query::evaluate_obligation::InferCtxtExt as _;

#[derive(Debug)]
#[derive(Debug, TypeVisitable)]
pub struct FulfillmentError<'tcx> {
pub obligation: PredicateObligation<'tcx>,
pub code: FulfillmentErrorCode<'tcx>,
Expand Down Expand Up @@ -107,7 +108,7 @@ impl<'tcx> FulfillmentError<'tcx> {
}
}

#[derive(Clone)]
#[derive(Clone, TypeVisitable)]
pub enum FulfillmentErrorCode<'tcx> {
/// Inherently impossible to fulfill; this trait is implemented if and only
/// if it is already implemented.
Expand Down
52 changes: 19 additions & 33 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use crate::core::builder::{
};
use crate::core::config::TargetSelection;
use crate::core::config::flags::{Subcommand, get_completion, top_level_help};
use crate::core::debuggers;
use crate::utils::build_stamp::{self, BuildStamp};
use crate::utils::exec::{BootstrapCommand, command};
use crate::utils::helpers::{
Expand All @@ -38,8 +39,6 @@ use crate::utils::helpers::{
use crate::utils::render_tests::{add_flags_and_try_run_tests, try_run_tests};
use crate::{CLang, CodegenBackendKind, DocTests, GitRepo, Mode, PathSet, envify};

const ADB_TEST_DIR: &str = "/data/local/tmp/work";

/// Runs `cargo test` on various internal tools used by bootstrap.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct CrateBootstrap {
Expand Down Expand Up @@ -2078,27 +2077,24 @@ Please disable assertions with `rust.debug-assertions = false`.

cmd.arg("--python").arg(builder.python());

if let Some(ref gdb) = builder.config.gdb {
cmd.arg("--gdb").arg(gdb);
}

let lldb_exe = builder.config.lldb.clone().unwrap_or_else(|| PathBuf::from("lldb"));
let lldb_version = command(&lldb_exe)
.allow_failure()
.arg("--version")
.run_capture(builder)
.stdout_if_ok()
.and_then(|v| if v.trim().is_empty() { None } else { Some(v) });
if let Some(ref vers) = lldb_version {
cmd.arg("--lldb-version").arg(vers);
let lldb_python_dir = command(&lldb_exe)
.allow_failure()
.arg("-P")
.run_capture_stdout(builder)
.stdout_if_ok()
.map(|p| p.lines().next().expect("lldb Python dir not found").to_string());
if let Some(ref dir) = lldb_python_dir {
cmd.arg("--lldb-python-dir").arg(dir);
if mode == "debuginfo" {
if let Some(debuggers::Gdb { gdb }) = debuggers::discover_gdb(builder) {
cmd.arg("--gdb").arg(gdb);
}

if let Some(debuggers::Android { adb_path, adb_test_dir, android_cross_path }) =
debuggers::discover_android(builder, target)
{
cmd.arg("--adb-path").arg(adb_path);
cmd.arg("--adb-test-dir").arg(adb_test_dir);
cmd.arg("--android-cross-path").arg(android_cross_path);
}

if let Some(debuggers::Lldb { lldb_version, lldb_python_dir }) =
debuggers::discover_lldb(builder)
{
cmd.arg("--lldb-version").arg(lldb_version);
cmd.arg("--lldb-python-dir").arg(lldb_python_dir);
}
}

Expand Down Expand Up @@ -2332,16 +2328,6 @@ Please disable assertions with `rust.debug-assertions = false`.

cmd.env("RUST_TEST_TMPDIR", builder.tempdir());

cmd.arg("--adb-path").arg("adb");
cmd.arg("--adb-test-dir").arg(ADB_TEST_DIR);
if target.contains("android") && !builder.config.dry_run() {
// Assume that cc for this target comes from the android sysroot
cmd.arg("--android-cross-path")
.arg(builder.cc(target).parent().unwrap().parent().unwrap());
} else {
cmd.arg("--android-cross-path").arg("");
}

if builder.config.cmd.rustfix_coverage() {
cmd.arg("--rustfix-coverage");
}
Expand Down
24 changes: 24 additions & 0 deletions src/bootstrap/src/core/debuggers/android.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
use std::path::PathBuf;

use crate::core::builder::Builder;
use crate::core::config::TargetSelection;

pub(crate) struct Android {
pub(crate) adb_path: &'static str,
pub(crate) adb_test_dir: &'static str,
pub(crate) android_cross_path: PathBuf,
}

pub(crate) fn discover_android(builder: &Builder<'_>, target: TargetSelection) -> Option<Android> {
let adb_path = "adb";
// See <https://github.com/rust-lang/rust/pull/102755>.
let adb_test_dir = "/data/local/tmp/work";

let android_cross_path = if target.contains("android") && !builder.config.dry_run() {
builder.cc(target).parent().unwrap().parent().unwrap().to_owned()
} else {
PathBuf::new()
};

Some(Android { adb_path, adb_test_dir, android_cross_path })
}
13 changes: 13 additions & 0 deletions src/bootstrap/src/core/debuggers/gdb.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use std::path::Path;

use crate::core::builder::Builder;

pub(crate) struct Gdb<'a> {
pub(crate) gdb: &'a Path,
}

pub(crate) fn discover_gdb<'a>(builder: &'a Builder<'_>) -> Option<Gdb<'a>> {
let gdb = builder.config.gdb.as_deref()?;

Some(Gdb { gdb })
}
32 changes: 32 additions & 0 deletions src/bootstrap/src/core/debuggers/lldb.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
use std::path::PathBuf;

use crate::core::builder::Builder;
use crate::utils::exec::command;

pub(crate) struct Lldb {
pub(crate) lldb_version: String,
pub(crate) lldb_python_dir: String,
}

pub(crate) fn discover_lldb(builder: &Builder<'_>) -> Option<Lldb> {
// FIXME(#148361): We probably should not be picking up whatever arbitrary
// lldb happens to be in the user's path, and instead require some kind of
// explicit opt-in or configuration.
let lldb_exe = builder.config.lldb.clone().unwrap_or_else(|| PathBuf::from("lldb"));

let lldb_version = command(&lldb_exe)
.allow_failure()
.arg("--version")
.run_capture(builder)
.stdout_if_ok()
.and_then(|v| if v.trim().is_empty() { None } else { Some(v) })?;

let lldb_python_dir = command(&lldb_exe)
.allow_failure()
.arg("-P")
.run_capture_stdout(builder)
.stdout_if_ok()
.map(|p| p.lines().next().expect("lldb Python dir not found").to_string())?;

Some(Lldb { lldb_version, lldb_python_dir })
}
10 changes: 10 additions & 0 deletions src/bootstrap/src/core/debuggers/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//! Code for discovering debuggers and debugger-related configuration, so that
//! it can be passed to compiletest when running debuginfo tests.

pub(crate) use self::android::{Android, discover_android};
pub(crate) use self::gdb::{Gdb, discover_gdb};
pub(crate) use self::lldb::{Lldb, discover_lldb};

mod android;
mod gdb;
mod lldb;
1 change: 1 addition & 0 deletions src/bootstrap/src/core/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pub(crate) mod build_steps;
pub(crate) mod builder;
pub(crate) mod config;
pub(crate) mod debuggers;
pub(crate) mod download;
pub(crate) mod metadata;
pub(crate) mod sanity;
2 changes: 1 addition & 1 deletion src/doc/rustc/src/platform-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ target | std | host | notes
`x86_64-uwp-windows-gnu` | ✓ | |
[`x86_64-uwp-windows-msvc`](platform-support/uwp-windows-msvc.md) | ✓ | |
[`x86_64-win7-windows-gnu`](platform-support/win7-windows-gnu.md) | ✓ | | 64-bit Windows 7 support
[`x86_64-win7-windows-msvc`](platform-support/win7-windows-msvc.md) | ✓ | | 64-bit Windows 7 support
[`x86_64-win7-windows-msvc`](platform-support/win7-windows-msvc.md) | ✓ | | 64-bit Windows 7 support
[`x86_64-wrs-vxworks`](platform-support/vxworks.md) | ✓ | |
[`x86_64h-apple-darwin`](platform-support/x86_64h-apple-darwin.md) | ✓ | ✓ | macOS with late-gen Intel (at least Haswell)
[`xtensa-esp32-espidf`](platform-support/esp-idf.md) | ✓ | | Xtensa ESP32
Expand Down
3 changes: 2 additions & 1 deletion src/doc/rustc/src/platform-support/win7-windows-msvc.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ Target triples:

This target supports all of core, alloc, std and test. This is automatically
tested every night on private infrastructure hosted by the maintainer. Host
tools may also work, though those are not currently tested.
tools may also work, though it is not guaranteed. Last known success built
version of rustc with host tools (x86_64) is 1.91.0.

Those targets follow Windows calling convention for extern "C".

Expand Down
2 changes: 1 addition & 1 deletion src/tools/compiletest/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ pub struct Config {
///
/// FIXME: take a look at this; this is piggy-backing off of gdb code paths but only for
/// `arm-linux-androideabi` target.
pub android_cross_path: Utf8PathBuf,
pub android_cross_path: Option<Utf8PathBuf>,

/// Extra parameter to run adb on `arm-linux-androideabi`.
///
Expand Down
Loading
Loading