Skip to content

Rollup of 7 pull requests #134052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 96 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
95a5138
Add benchmark showing effectivity of subtree skipping
JoJoDeveloping Oct 26, 2024
4400804
Refactor AnonSocket::read/write
tiif Nov 17, 2024
6af006e
Fill out Windows error mapping table
CraftSpider Nov 21, 2024
7d38c51
eventfd: comment tweaks
RalfJung Nov 21, 2024
0a7e63a
Add comment about multiple errors to one ErrorKind
CraftSpider Nov 21, 2024
0267cbf
Merge pull request #4046 from CraftSpider/windows-error-mapping
RalfJung Nov 21, 2024
f77817a
Preparing for merge from rustc
Nov 22, 2024
69930dc
Merge from rustc
Nov 22, 2024
33f4d2e
epoll: fix comment typo
RalfJung Nov 21, 2024
7dcba03
disable solaris on CI for now
RalfJung Nov 22, 2024
76f27aa
Merge pull request #4049 from rust-lang/rustup-2024-11-22
RalfJung Nov 22, 2024
fa93f35
Merge pull request #4047 from RalfJung/eventfd-comments
RalfJung Nov 22, 2024
004edb2
sysconf interception fix for solarish systems.
devnexen Nov 22, 2024
6a4aa9a
Merge pull request #4052 from devnexen/gh4050
RalfJung Nov 23, 2024
bb55f52
follow-up on #4052, making a miri evaluation context fn for strerror_r.
devnexen Nov 23, 2024
a221d50
Merge pull request #4054 from devnexen/strerror_r_chg
RalfJung Nov 24, 2024
1deb8f9
sysconf: add _SC_OPEN_MAX
devnexen Nov 23, 2024
0761f07
Merge pull request #4053 from devnexen/sysconf_extend
RalfJung Nov 24, 2024
d125945
Merge pull request #4037 from tiif/blockpipe
RalfJung Nov 24, 2024
57c6615
Added epoll and eventfd for Android
YohDeadfall Nov 6, 2024
64f42a4
Fixed test target
YohDeadfall Nov 11, 2024
13aa5fb
Added linux_like module
YohDeadfall Nov 11, 2024
065d9b5
Fix the rest of the tests
YohDeadfall Nov 11, 2024
a05e53b
attempt to fix miri failing to create file when under weird powershel…
asquared31415 Nov 26, 2024
366001f
Merge pull request #4016 from YohDeadfall/android-epoll
RalfJung Nov 26, 2024
24a1946
Merge pull request #4061 from asquared31415/dep_info_fix
RalfJung Nov 26, 2024
109c299
Simplify thread blocking tests
tiif Nov 26, 2024
63ce8fb
Merge pull request #4059 from tiif/fixtest
oli-obk Nov 26, 2024
15001f3
filesystem support for solarish.
devnexen Nov 12, 2024
987d642
Merge pull request #4031 from devnexen/solarish_stat
RalfJung Nov 26, 2024
79b4f25
Preparing for merge from rustc
Nov 28, 2024
45ed69e
Merge from rustc
Nov 28, 2024
2039a9f
fmt
Nov 28, 2024
8e2d72b
silence clippy
RalfJung Nov 28, 2024
4624dad
Merge pull request #4063 from rust-lang/rustup-2024-11-28
RalfJung Nov 28, 2024
c2cb993
remove ctrlc, unused
klensy Nov 28, 2024
b4744f8
Merge pull request #4064 from klensy/ctrlc
oli-obk Nov 28, 2024
374397f
Move FdTable to public location, fix up imports
CraftSpider Nov 29, 2024
035777d
Split unix-specific function into UnixFileDescription
CraftSpider Nov 29, 2024
244249e
Make metadata a FileDescription operation
CraftSpider Nov 29, 2024
aaa4e75
Merge pull request #4045 from CraftSpider/move-fdmap
RalfJung Dec 1, 2024
15feb5d
Add doc alias 'then_with' for `then` method on `bool`
rossmacarthur Dec 3, 2024
db8bef5
Preparing for merge from rustc
Dec 4, 2024
1300e46
Merge from rustc
Dec 4, 2024
6c94020
fmt
Dec 4, 2024
76c27a9
update lockfile
RalfJung Dec 4, 2024
86d6dc0
Merge pull request #4070 from rust-lang/rustup-2024-12-04
RalfJung Dec 4, 2024
91bd957
implement simd_relaxed_fma
RalfJung Dec 4, 2024
b4b0e03
Merge pull request #4071 from RalfJung/simd_relaxed_fma
RalfJung Dec 4, 2024
fceb304
Properly fix #3846 by resetting parents on lazy node creation
JoJoDeveloping Aug 26, 2024
599aef2
Merge pull request #4006 from JoJoDeveloping/tb-fix-3846-retag
RalfJung Dec 4, 2024
c74ede8
Expand home_dir docs
ChrisDenton Dec 5, 2024
8d28ec4
extend some comments regarding weak memory emulation
RalfJung Nov 22, 2024
9449cb9
move GlobalState definition further up so the types are mor concentra…
RalfJung Nov 24, 2024
fe85681
make SC fences stronger, to be correct wrt C++20
RalfJung Nov 24, 2024
16d549a
Avoid passing byte slice to anonsocket_read
tiif Dec 5, 2024
54ff463
Merge pull request #4074 from tiif/cleanup
oli-obk Dec 5, 2024
cfc3924
Preparing for merge from rustc
Dec 6, 2024
4e69b65
Merge from rustc
Dec 6, 2024
981f432
Merge pull request #4075 from rust-lang/rustup-2024-12-06
oli-obk Dec 6, 2024
a57d5fe
Merge pull request #4057 from RalfJung/scfix
RalfJung Dec 6, 2024
a5622a2
fix SC fence logic
RalfJung Dec 6, 2024
84873f8
Remove 'tcx lifetime from OnDiskCache
bjorn3 Nov 3, 2024
ea6f5cb
Move some timers around
bjorn3 Nov 9, 2024
030545d
Store a single copy of the error registry in DiagCtxt
bjorn3 Nov 9, 2024
401dd84
Remove all threading through of ErrorGuaranteed from the driver
bjorn3 Nov 3, 2024
618d4c3
Handle unwinding out of the closure argument of run_compiler with pen…
bjorn3 Nov 28, 2024
85414eb
Fix ui-fulldep tests
bjorn3 Nov 28, 2024
644faf4
add test
RalfJung Dec 6, 2024
016fb48
remove a no-longer-needed work-around
RalfJung Dec 6, 2024
d1094ea
Merge pull request #4076 from RalfJung/sc-fence
RalfJung Dec 6, 2024
8afc3c6
Preparing for merge from rustc
Dec 7, 2024
97633d8
Merge from rustc
Dec 7, 2024
8f05e4c
fmt
Dec 7, 2024
e82426c
Merge pull request #4079 from rust-lang/rustup-2024-12-07
RalfJung Dec 7, 2024
23fda35
Reduce indentation in run_compiler
bjorn3 Dec 7, 2024
854dcbc
add weak memory consistency test for mixing SC accesses and fences
RalfJung Dec 7, 2024
6956b41
Merge pull request #4080 from RalfJung/sc-fence-access-test
RalfJung Dec 7, 2024
7ba5192
Preparing for merge from rustc
Dec 8, 2024
8cabbc9
Merge from rustc
Dec 8, 2024
03c412e
fix build
RalfJung Dec 8, 2024
4740b0f
Merge pull request #4081 from rust-lang/rustup-2024-12-08
saethlin Dec 8, 2024
8d5236f
crash tests: use individual mir opts instead of mir-opt-level where e…
matthiaskrgr Dec 8, 2024
0df8094
Use ensure for analysis calls
bjorn3 Dec 8, 2024
62c71cc
improve `--compare-mode` error handling
lqd Dec 8, 2024
95a1351
mark previously hanging tests as good to go
lqd Dec 8, 2024
91cf0cb
bless test expectations
lqd Dec 8, 2024
ef00d4f
Fix some triagebot mentions paths
ehuss Dec 8, 2024
a33b4b1
update lockfile
RalfJung Dec 8, 2024
d2881e4
Rollup merge of #133567 - bjorn3:various_cleanups, r=cjgillot
matthiaskrgr Dec 9, 2024
38cc868
Rollup merge of #133789 - rossmacarthur:then-with-doc-alias, r=Mark-S…
matthiaskrgr Dec 9, 2024
fd7183c
Rollup merge of #133880 - ChrisDenton:homedir, r=Mark-Simulacrum
matthiaskrgr Dec 9, 2024
273a359
Rollup merge of #134036 - matthiaskrgr:opppt, r=saethlin
matthiaskrgr Dec 9, 2024
6f89a61
Rollup merge of #134045 - ehuss:triagebot-path-fixes, r=compiler-errors
matthiaskrgr Dec 9, 2024
86f3ed3
Rollup merge of #134046 - lqd:new-solver-hangs, r=compiler-errors
matthiaskrgr Dec 9, 2024
e01cb62
Rollup merge of #134050 - RalfJung:miri-sync, r=RalfJung
matthiaskrgr Dec 9, 2024
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
1 change: 0 additions & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2274,7 +2274,6 @@ dependencies = [
"chrono",
"chrono-tz",
"colored",
"ctrlc",
"directories",
"getrandom",
"libc",
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_codegen_cranelift/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,6 @@ impl CodegenBackend for CraneliftCodegenBackend {
sess: &Session,
outputs: &OutputFilenames,
) -> (CodegenResults, FxIndexMap<WorkProductId, WorkProduct>) {
let _timer = sess.timer("finish_ongoing_codegen");

ongoing_codegen.downcast::<driver::aot::OngoingCodegen>().unwrap().join(sess, outputs)
}
}
Expand Down
11 changes: 3 additions & 8 deletions compiler/rustc_codegen_llvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use rustc_codegen_ssa::back::write::{
use rustc_codegen_ssa::traits::*;
use rustc_codegen_ssa::{CodegenResults, CompiledModule, ModuleCodegen};
use rustc_data_structures::fx::FxIndexMap;
use rustc_errors::{DiagCtxtHandle, ErrorGuaranteed, FatalError};
use rustc_errors::{DiagCtxtHandle, FatalError};
use rustc_metadata::EncodedMetadata;
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
use rustc_middle::ty::TyCtxt;
Expand Down Expand Up @@ -370,19 +370,14 @@ impl CodegenBackend for LlvmCodegenBackend {
(codegen_results, work_products)
}

fn link(
&self,
sess: &Session,
codegen_results: CodegenResults,
outputs: &OutputFilenames,
) -> Result<(), ErrorGuaranteed> {
fn link(&self, sess: &Session, codegen_results: CodegenResults, outputs: &OutputFilenames) {
use rustc_codegen_ssa::back::link::link_binary;

use crate::back::archive::LlvmArchiveBuilderBuilder;

// Run the linker on any artifacts that resulted from the LLVM run.
// This should produce either a finished executable or library.
link_binary(sess, &LlvmArchiveBuilderBuilder, codegen_results, outputs)
link_binary(sess, &LlvmArchiveBuilderBuilder, codegen_results, outputs);
}
}

Expand Down
56 changes: 24 additions & 32 deletions compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use rustc_ast::CRATE_NODE_ID;
use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
use rustc_data_structures::memmap::Mmap;
use rustc_data_structures::temp_dir::MaybeTempDir;
use rustc_errors::{DiagCtxtHandle, ErrorGuaranteed, FatalError};
use rustc_errors::{DiagCtxtHandle, FatalError};
use rustc_fs_util::{fix_windows_verbatim_for_gcc, try_canonicalize};
use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
use rustc_metadata::fs::{METADATA_FILENAME, copy_to_stdout, emit_wrapper_file};
Expand Down Expand Up @@ -71,7 +71,7 @@ pub fn link_binary(
archive_builder_builder: &dyn ArchiveBuilderBuilder,
codegen_results: CodegenResults,
outputs: &OutputFilenames,
) -> Result<(), ErrorGuaranteed> {
) {
let _timer = sess.timer("link_binary");
let output_metadata = sess.opts.output_types.contains_key(&OutputType::Metadata);
let mut tempfiles_for_stdout_output: Vec<PathBuf> = Vec::new();
Expand Down Expand Up @@ -119,7 +119,7 @@ pub fn link_binary(
&codegen_results,
RlibFlavor::Normal,
&path,
)?
)
.build(&out_filename);
}
CrateType::Staticlib => {
Expand All @@ -129,7 +129,7 @@ pub fn link_binary(
&codegen_results,
&out_filename,
&path,
)?;
);
}
_ => {
link_natively(
Expand All @@ -139,7 +139,7 @@ pub fn link_binary(
&out_filename,
&codegen_results,
path.as_ref(),
)?;
);
}
}
if sess.opts.json_artifact_notifications {
Expand Down Expand Up @@ -225,8 +225,6 @@ pub fn link_binary(
maybe_remove_temps_from_module(preserve_objects, preserve_dwarf_objects, module);
}
});

Ok(())
}

// Crate type is not passed when calculating the dylibs to include for LTO. In that case all
Expand Down Expand Up @@ -298,7 +296,7 @@ fn link_rlib<'a>(
codegen_results: &CodegenResults,
flavor: RlibFlavor,
tmpdir: &MaybeTempDir,
) -> Result<Box<dyn ArchiveBuilder + 'a>, ErrorGuaranteed> {
) -> Box<dyn ArchiveBuilder + 'a> {
let mut ab = archive_builder_builder.new_archive_builder(sess);

let trailing_metadata = match flavor {
Expand Down Expand Up @@ -374,7 +372,7 @@ fn link_rlib<'a>(
{
let path = find_native_static_library(filename.as_str(), true, sess);
let src = read(path)
.map_err(|e| sess.dcx().emit_fatal(errors::ReadFileError { message: e }))?;
.unwrap_or_else(|e| sess.dcx().emit_fatal(errors::ReadFileError { message: e }));
let (data, _) = create_wrapper_file(sess, ".bundled_lib".to_string(), &src);
let wrapper_file = emit_wrapper_file(sess, &data, tmpdir, filename.as_str());
packed_bundled_libs.push(wrapper_file);
Expand All @@ -392,7 +390,7 @@ fn link_rlib<'a>(
codegen_results.crate_info.used_libraries.iter(),
tmpdir.as_ref(),
true,
)? {
) {
ab.add_archive(&output_path, Box::new(|_| false)).unwrap_or_else(|error| {
sess.dcx().emit_fatal(errors::AddNativeLibrary { library_path: output_path, error });
});
Expand Down Expand Up @@ -433,7 +431,7 @@ fn link_rlib<'a>(
ab.add_file(&lib)
}

Ok(ab)
ab
}

/// Extract all symbols defined in raw-dylib libraries, collated by library name.
Expand All @@ -445,7 +443,7 @@ fn link_rlib<'a>(
fn collate_raw_dylibs<'a>(
sess: &Session,
used_libraries: impl IntoIterator<Item = &'a NativeLib>,
) -> Result<Vec<(String, Vec<DllImport>)>, ErrorGuaranteed> {
) -> Vec<(String, Vec<DllImport>)> {
// Use index maps to preserve original order of imports and libraries.
let mut dylib_table = FxIndexMap::<String, FxIndexMap<Symbol, &DllImport>>::default();

Expand All @@ -469,15 +467,13 @@ fn collate_raw_dylibs<'a>(
}
}
}
if let Some(guar) = sess.dcx().has_errors() {
return Err(guar);
}
Ok(dylib_table
sess.dcx().abort_if_errors();
dylib_table
.into_iter()
.map(|(name, imports)| {
(name, imports.into_iter().map(|(_, import)| import.clone()).collect())
})
.collect())
.collect()
}

fn create_dll_import_libs<'a>(
Expand All @@ -486,8 +482,8 @@ fn create_dll_import_libs<'a>(
used_libraries: impl IntoIterator<Item = &'a NativeLib>,
tmpdir: &Path,
is_direct_dependency: bool,
) -> Result<Vec<PathBuf>, ErrorGuaranteed> {
Ok(collate_raw_dylibs(sess, used_libraries)?
) -> Vec<PathBuf> {
collate_raw_dylibs(sess, used_libraries)
.into_iter()
.map(|(raw_dylib_name, raw_dylib_imports)| {
let name_suffix = if is_direct_dependency { "_imports" } else { "_imports_indirect" };
Expand Down Expand Up @@ -537,7 +533,7 @@ fn create_dll_import_libs<'a>(

output_path
})
.collect())
.collect()
}

/// Create a static archive.
Expand All @@ -557,15 +553,15 @@ fn link_staticlib(
codegen_results: &CodegenResults,
out_filename: &Path,
tempdir: &MaybeTempDir,
) -> Result<(), ErrorGuaranteed> {
) {
info!("preparing staticlib to {:?}", out_filename);
let mut ab = link_rlib(
sess,
archive_builder_builder,
codegen_results,
RlibFlavor::StaticlibBase,
tempdir,
)?;
);
let mut all_native_libs = vec![];

let res = each_linked_rlib(
Expand Down Expand Up @@ -656,8 +652,6 @@ fn link_staticlib(
print_native_static_libs(sess, &print.out, &all_native_libs, &all_rust_dylibs);
}
}

Ok(())
}

/// Use `thorin` (rust implementation of a dwarf packaging utility) to link DWARF objects into a
Expand Down Expand Up @@ -773,7 +767,7 @@ fn link_natively(
out_filename: &Path,
codegen_results: &CodegenResults,
tmpdir: &Path,
) -> Result<(), ErrorGuaranteed> {
) {
info!("preparing {:?} to {:?}", crate_type, out_filename);
let (linker_path, flavor) = linker_and_flavor(sess);
let self_contained_components = self_contained_components(sess, crate_type);
Expand All @@ -797,7 +791,7 @@ fn link_natively(
temp_filename,
codegen_results,
self_contained_components,
)?;
);

linker::disable_localization(&mut cmd);

Expand Down Expand Up @@ -1177,8 +1171,6 @@ fn link_natively(
ab.add_file(temp_filename);
ab.build(out_filename);
}

Ok(())
}

fn strip_symbols_with_external_utility(
Expand Down Expand Up @@ -2232,7 +2224,7 @@ fn linker_with_args(
out_filename: &Path,
codegen_results: &CodegenResults,
self_contained_components: LinkSelfContainedComponents,
) -> Result<Command, ErrorGuaranteed> {
) -> Command {
let self_contained_crt_objects = self_contained_components.is_crt_objects_enabled();
let cmd = &mut *super::linker::get_linker(
sess,
Expand Down Expand Up @@ -2356,7 +2348,7 @@ fn linker_with_args(
codegen_results.crate_info.used_libraries.iter(),
tmpdir,
true,
)? {
) {
cmd.add_object(&output_path);
}
// As with add_upstream_native_libraries, we need to add the upstream raw-dylib symbols in case
Expand Down Expand Up @@ -2388,7 +2380,7 @@ fn linker_with_args(
native_libraries_from_nonstatics,
tmpdir,
false,
)? {
) {
cmd.add_object(&output_path);
}

Expand Down Expand Up @@ -2435,7 +2427,7 @@ fn linker_with_args(
// to it and remove the option. Currently the last holdout is wasm32-unknown-emscripten.
add_post_link_args(cmd, sess, flavor);

Ok(cmd.take_cmd())
cmd.take_cmd()
}

fn add_order_independent_options(
Expand Down
8 changes: 5 additions & 3 deletions compiler/rustc_codegen_ssa/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1883,7 +1883,11 @@ impl Translate for SharedEmitter {
}

impl Emitter for SharedEmitter {
fn emit_diagnostic(&mut self, mut diag: rustc_errors::DiagInner) {
fn emit_diagnostic(
&mut self,
mut diag: rustc_errors::DiagInner,
_registry: &rustc_errors::registry::Registry,
) {
// Check that we aren't missing anything interesting when converting to
// the cut-down local `DiagInner`.
assert_eq!(diag.span, MultiSpan::new());
Expand Down Expand Up @@ -2028,8 +2032,6 @@ pub struct OngoingCodegen<B: ExtraBackendMethods> {

impl<B: ExtraBackendMethods> OngoingCodegen<B> {
pub fn join(self, sess: &Session) -> (CodegenResults, FxIndexMap<WorkProductId, WorkProduct>) {
let _timer = sess.timer("finish_ongoing_codegen");

self.shared_emitter_main.check(sess, true);
let compiled_modules = sess.time("join_worker_thread", || match self.coordinator.join() {
Ok(Ok(compiled_modules)) => compiled_modules,
Expand Down
10 changes: 2 additions & 8 deletions compiler/rustc_codegen_ssa/src/traits/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use std::hash::Hash;
use rustc_ast::expand::allocator::AllocatorKind;
use rustc_data_structures::fx::FxIndexMap;
use rustc_data_structures::sync::{DynSend, DynSync};
use rustc_errors::ErrorGuaranteed;
use rustc_metadata::EncodedMetadata;
use rustc_metadata::creader::MetadataLoaderDyn;
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
Expand Down Expand Up @@ -84,13 +83,8 @@ pub trait CodegenBackend {
) -> (CodegenResults, FxIndexMap<WorkProductId, WorkProduct>);

/// This is called on the returned [`CodegenResults`] from [`join_codegen`](Self::join_codegen).
fn link(
&self,
sess: &Session,
codegen_results: CodegenResults,
outputs: &OutputFilenames,
) -> Result<(), ErrorGuaranteed> {
link_binary(sess, &ArArchiveBuilderBuilder, codegen_results, outputs)
fn link(&self, sess: &Session, codegen_results: CodegenResults, outputs: &OutputFilenames) {
link_binary(sess, &ArArchiveBuilderBuilder, codegen_results, outputs);
}

/// Returns `true` if this backend can be safely called from multiple threads.
Expand Down
10 changes: 5 additions & 5 deletions compiler/rustc_driver_impl/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,18 @@ impl Expander {
/// If this function is intended to be used with command line arguments,
/// `argv[0]` must be removed prior to calling it manually.
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
pub fn arg_expand_all(
early_dcx: &EarlyDiagCtxt,
at_args: &[String],
) -> Result<Vec<String>, ErrorGuaranteed> {
pub fn arg_expand_all(early_dcx: &EarlyDiagCtxt, at_args: &[String]) -> Vec<String> {
let mut expander = Expander::default();
let mut result = Ok(());
for arg in at_args {
if let Err(err) = expander.arg(arg) {
result = Err(early_dcx.early_err(format!("failed to load argument file: {err}")));
}
}
result.map(|()| expander.finish())
if let Err(guar) = result {
guar.raise_fatal();
}
expander.finish()
}

/// Gets the raw unprocessed command-line arguments as Unicode strings, without doing any further
Expand Down
Loading
Loading