Merge from rustc

This commit is contained in:
The Miri Conjob Bot 2024-02-11 05:03:52 +00:00
commit 31b66251be
170 changed files with 2297 additions and 2674 deletions

View file

@ -98,7 +98,7 @@ pub fn prebuilt_llvm_config(
let out_dir = builder.llvm_out(target);
let mut llvm_config_ret_dir = builder.llvm_out(builder.config.build);
if !builder.config.build.is_msvc() || builder.ninja() {
if (!builder.config.build.is_msvc() || builder.ninja()) && !builder.config.llvm_from_ci {
llvm_config_ret_dir.push("build");
}
llvm_config_ret_dir.push("bin");

View file

@ -524,6 +524,23 @@ mod dist {
);
}
#[test]
fn llvm_out_behaviour() {
let mut config = configure(&["A"], &["B"]);
config.llvm_from_ci = true;
let build = Build::new(config.clone());
let target = TargetSelection::from_user("A");
assert!(build.llvm_out(target).ends_with("ci-llvm"));
let target = TargetSelection::from_user("B");
assert!(build.llvm_out(target).ends_with("llvm"));
config.llvm_from_ci = false;
let build = Build::new(config.clone());
let target = TargetSelection::from_user("A");
assert!(build.llvm_out(target).ends_with("llvm"));
}
#[test]
fn build_with_empty_host() {
let config = configure(&[], &["C"]);

View file

@ -792,12 +792,16 @@ impl Build {
self.stage_out(compiler, mode).join(&*target.triple).join(self.cargo_dir())
}
/// Root output directory for LLVM compiled for `target`
/// Root output directory of LLVM for `target`
///
/// Note that if LLVM is configured externally then the directory returned
/// will likely be empty.
fn llvm_out(&self, target: TargetSelection) -> PathBuf {
self.out.join(&*target.triple).join("llvm")
if self.config.llvm_from_ci && self.config.build == target {
self.config.ci_llvm_root()
} else {
self.out.join(&*target.triple).join("llvm")
}
}
fn lld_out(&self, target: TargetSelection) -> PathBuf {

View file

@ -285,7 +285,7 @@ pub fn report_error<'tcx, 'mir>(
) =>
{
ecx.handle_ice(); // print interpreter backtrace
bug!("This validation error should be impossible in Miri: {}", ecx.format_error(e));
bug!("This validation error should be impossible in Miri: {}", format_interp_error(ecx.tcx.dcx(), e));
}
UndefinedBehavior(_) => "Undefined Behavior",
ResourceExhaustion(_) => "resource exhaustion",
@ -299,7 +299,7 @@ pub fn report_error<'tcx, 'mir>(
) => "post-monomorphization error",
_ => {
ecx.handle_ice(); // print interpreter backtrace
bug!("This error should be impossible in Miri: {}", ecx.format_error(e));
bug!("This error should be impossible in Miri: {}", format_interp_error(ecx.tcx.dcx(), e));
}
};
#[rustfmt::skip]
@ -365,7 +365,7 @@ pub fn report_error<'tcx, 'mir>(
_ => {}
}
msg.insert(0, ecx.format_error(e));
msg.insert(0, format_interp_error(ecx.tcx.dcx(), e));
report_msg(
DiagLevel::Error,