Skip to content

Commit a2aba05

Browse files
committed
Auto merge of rust-lang#138448 - matthiaskrgr:rollup-3onhkse, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - rust-lang#126856 (remove deprecated tool `rls`) - rust-lang#133981 (rustdoc-json: Refractor and document Id's) - rust-lang#136842 (Add libstd support for Trusty targets) - rust-lang#137355 (Implement `read_buf` and vectored read/write for SGX stdio) - rust-lang#138162 (Update the standard library to Rust 2024) - rust-lang#138273 (metadata: Ignore sysroot when doing the manual native lib search in rustc) - rust-lang#138346 (naked functions: on windows emit `.endef` without the symbol name) - rust-lang#138370 (Simulate OOM for the `try_oom_error` test) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 961351c + 3bfce83 commit a2aba05

File tree

74 files changed

+560
-406
lines changed

Some content is hidden

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

74 files changed

+560
-406
lines changed

Cargo.lock

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3045,13 +3045,6 @@ dependencies = [
30453045
"serde",
30463046
]
30473047

3048-
[[package]]
3049-
name = "rls"
3050-
version = "2.0.0"
3051-
dependencies = [
3052-
"serde_json",
3053-
]
3054-
30553048
[[package]]
30563049
name = "run_make_support"
30573050
version = "0.2.0"

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ members = [
2424
"src/tools/remote-test-server",
2525
"src/tools/rust-installer",
2626
"src/tools/rustdoc",
27-
"src/tools/rls",
2827
"src/tools/rustfmt",
2928
"src/tools/miri",
3029
"src/tools/miri/cargo-miri",

compiler/rustc_codegen_ssa/src/back/link.rs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ use rustc_fs_util::{fix_windows_verbatim_for_gcc, try_canonicalize};
2222
use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
2323
use rustc_macros::LintDiagnostic;
2424
use rustc_metadata::fs::{METADATA_FILENAME, copy_to_stdout, emit_wrapper_file};
25-
use rustc_metadata::{find_native_static_library, walk_native_lib_search_dirs};
25+
use rustc_metadata::{
26+
NativeLibSearchFallback, find_native_static_library, walk_native_lib_search_dirs,
27+
};
2628
use rustc_middle::bug;
2729
use rustc_middle::lint::lint_level;
2830
use rustc_middle::middle::debugger_visualizer::DebuggerVisualizerFile;
@@ -2129,19 +2131,15 @@ fn add_library_search_dirs(
21292131
return;
21302132
}
21312133

2132-
walk_native_lib_search_dirs(
2133-
sess,
2134-
self_contained_components,
2135-
apple_sdk_root,
2136-
|dir, is_framework| {
2137-
if is_framework {
2138-
cmd.framework_path(dir);
2139-
} else {
2140-
cmd.include_path(&fix_windows_verbatim_for_gcc(dir));
2141-
}
2142-
ControlFlow::<()>::Continue(())
2143-
},
2144-
);
2134+
let fallback = Some(NativeLibSearchFallback { self_contained_components, apple_sdk_root });
2135+
walk_native_lib_search_dirs(sess, fallback, |dir, is_framework| {
2136+
if is_framework {
2137+
cmd.framework_path(dir);
2138+
} else {
2139+
cmd.include_path(&fix_windows_verbatim_for_gcc(dir));
2140+
}
2141+
ControlFlow::<()>::Continue(())
2142+
});
21452143
}
21462144

21472145
/// Add options making relocation sections in the produced ELF files read-only

compiler/rustc_codegen_ssa/src/mir/naked_asm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ fn prefix_and_suffix<'tcx>(
245245
writeln!(begin, ".def {asm_name}").unwrap();
246246
writeln!(begin, ".scl 2").unwrap();
247247
writeln!(begin, ".type 32").unwrap();
248-
writeln!(begin, ".endef {asm_name}").unwrap();
248+
writeln!(begin, ".endef").unwrap();
249249
writeln!(begin, "{asm_name}:").unwrap();
250250

251251
writeln!(end).unwrap();

compiler/rustc_metadata/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ pub mod locator;
3535
pub use creader::{DylibError, load_symbol_from_dylib};
3636
pub use fs::{METADATA_FILENAME, emit_wrapper_file};
3737
pub use native_libs::{
38-
find_native_static_library, try_find_native_dynamic_library, try_find_native_static_library,
39-
walk_native_lib_search_dirs,
38+
NativeLibSearchFallback, find_native_static_library, try_find_native_dynamic_library,
39+
try_find_native_static_library, walk_native_lib_search_dirs,
4040
};
4141
pub use rmeta::{EncodedMetadata, METADATA_HEADER, encode_metadata, rendered_const};
4242

compiler/rustc_metadata/src/native_libs.rs

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,17 @@ use rustc_target::spec::{BinaryFormat, LinkSelfContainedComponents};
2121

2222
use crate::{errors, fluent_generated};
2323

24+
/// The fallback directories are passed to linker, but not used when rustc does the search,
25+
/// because in the latter case the set of fallback directories cannot always be determined
26+
/// consistently at the moment.
27+
pub struct NativeLibSearchFallback<'a> {
28+
pub self_contained_components: LinkSelfContainedComponents,
29+
pub apple_sdk_root: Option<&'a Path>,
30+
}
31+
2432
pub fn walk_native_lib_search_dirs<R>(
2533
sess: &Session,
26-
self_contained_components: LinkSelfContainedComponents,
27-
apple_sdk_root: Option<&Path>,
34+
fallback: Option<NativeLibSearchFallback<'_>>,
2835
mut f: impl FnMut(&Path, bool /*is_framework*/) -> ControlFlow<R>,
2936
) -> ControlFlow<R> {
3037
// Library search paths explicitly supplied by user (`-L` on the command line).
@@ -38,6 +45,11 @@ pub fn walk_native_lib_search_dirs<R>(
3845
}
3946
}
4047

48+
let Some(NativeLibSearchFallback { self_contained_components, apple_sdk_root }) = fallback
49+
else {
50+
return ControlFlow::Continue(());
51+
};
52+
4153
// The toolchain ships some native library components and self-contained linking was enabled.
4254
// Add the self-contained library directory to search paths.
4355
if self_contained_components.intersects(
@@ -93,23 +105,17 @@ pub fn try_find_native_static_library(
93105
if os == unix { vec![os] } else { vec![os, unix] }
94106
};
95107

96-
// FIXME: Account for self-contained linking settings and Apple SDK.
97-
walk_native_lib_search_dirs(
98-
sess,
99-
LinkSelfContainedComponents::empty(),
100-
None,
101-
|dir, is_framework| {
102-
if !is_framework {
103-
for (prefix, suffix) in &formats {
104-
let test = dir.join(format!("{prefix}{name}{suffix}"));
105-
if test.exists() {
106-
return ControlFlow::Break(test);
107-
}
108+
walk_native_lib_search_dirs(sess, None, |dir, is_framework| {
109+
if !is_framework {
110+
for (prefix, suffix) in &formats {
111+
let test = dir.join(format!("{prefix}{name}{suffix}"));
112+
if test.exists() {
113+
return ControlFlow::Break(test);
108114
}
109115
}
110-
ControlFlow::Continue(())
111-
},
112-
)
116+
}
117+
ControlFlow::Continue(())
118+
})
113119
.break_value()
114120
}
115121

@@ -132,22 +138,17 @@ pub fn try_find_native_dynamic_library(
132138
vec![os, meson, mingw]
133139
};
134140

135-
walk_native_lib_search_dirs(
136-
sess,
137-
LinkSelfContainedComponents::empty(),
138-
None,
139-
|dir, is_framework| {
140-
if !is_framework {
141-
for (prefix, suffix) in &formats {
142-
let test = dir.join(format!("{prefix}{name}{suffix}"));
143-
if test.exists() {
144-
return ControlFlow::Break(test);
145-
}
141+
walk_native_lib_search_dirs(sess, None, |dir, is_framework| {
142+
if !is_framework {
143+
for (prefix, suffix) in &formats {
144+
let test = dir.join(format!("{prefix}{name}{suffix}"));
145+
if test.exists() {
146+
return ControlFlow::Break(test);
146147
}
147148
}
148-
ControlFlow::Continue(())
149-
},
150-
)
149+
}
150+
ControlFlow::Continue(())
151+
})
151152
.break_value()
152153
}
153154

library/alloc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repository = "https://github.com/rust-lang/rust.git"
88
description = "The Rust core allocation and collections library"
99
autotests = false
1010
autobenches = false
11-
edition = "2021"
11+
edition = "2024"
1212

1313
[lib]
1414
test = false

library/core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ autobenches = false
99
# If you update this, be sure to update it in a bunch of other places too!
1010
# As of 2024, it was src/tools/opt-dist, the core-no-fp-fmt-parse test and
1111
# the version of the prelude imported in core/lib.rs.
12-
edition = "2021"
12+
edition = "2024"
1313

1414
[lib]
1515
test = false

library/core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ extern crate self as core;
226226

227227
#[prelude_import]
228228
#[allow(unused)]
229-
use prelude::rust_2021::*;
229+
use prelude::rust_2024::*;
230230

231231
#[cfg(not(test))] // See #65860
232232
#[macro_use]

library/panic_abort/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.0.0"
44
license = "MIT OR Apache-2.0"
55
repository = "https://github.com/rust-lang/rust.git"
66
description = "Implementation of Rust panics via process aborts"
7-
edition = "2021"
7+
edition = "2024"
88

99
[lib]
1010
test = false

0 commit comments

Comments
 (0)