Skip to content

Commit 756bff9

Browse files
committed
Auto merge of rust-lang#138841 - matthiaskrgr:rollup-bfkls57, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - rust-lang#138018 (rustdoc: Use own logic to print `#[repr(..)]` attributes in JSON output.) - rust-lang#138294 (Mark some std tests as requiring `panic = "unwind"`) - rust-lang#138468 (rustdoc js: add nonnull helper and typecheck src-script.js) - rust-lang#138675 (Add release notes for 1.85.1) - rust-lang#138765 (Fix Thread::set_name on cygwin) - rust-lang#138786 (Move some driver code around) - rust-lang#138793 (target spec check: better error when llvm-floatabi is missing) - rust-lang#138822 (De-Stabilize `file_lock`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents b48576b + 3f59916 commit 756bff9

File tree

32 files changed

+256
-105
lines changed

32 files changed

+256
-105
lines changed

RELEASES.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
Version 1.85.1 (2025-03-18)
2+
==========================
3+
4+
<a id="1.85.1"></a>
5+
6+
- [Fix the doctest-merging feature of the 2024 Edition.](https://github.com/rust-lang/rust/pull/137899/)
7+
- [Relax some `target_feature` checks when generating docs.](https://github.com/rust-lang/rust/pull/137632/)
8+
- [Fix errors in `std::fs::rename` on Windows 10, version 1607.](https://github.com/rust-lang/rust/pull/137528/)
9+
- [Downgrade bootstrap `cc` to fix custom targets.](https://github.com/rust-lang/rust/pull/137460/)
10+
- [Skip submodule updates when building Rust from a source tarball.](https://github.com/rust-lang/rust/pull/137338/)
11+
112
Version 1.85.0 (2025-02-20)
213
==========================
314

compiler/rustc_driver_impl/messages.ftl

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
driver_impl_cant_emit_mir = could not emit MIR: {$error}
2+
13
driver_impl_ice = the compiler unexpectedly panicked. this is a bug.
24
driver_impl_ice_bug_report = we would appreciate a bug report: {$bug_report_url}
35
driver_impl_ice_bug_report_internal_feature = using internal features is not supported and expected to cause internal compiler errors when used incorrectly

compiler/rustc_driver_impl/src/lib.rs

+14-13
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ mod signal_handler {
108108
}
109109

110110
use crate::session_diagnostics::{
111-
RLinkEmptyVersionNumber, RLinkEncodingVersionMismatch, RLinkRustcVersionMismatch,
111+
CantEmitMIR, RLinkEmptyVersionNumber, RLinkEncodingVersionMismatch, RLinkRustcVersionMismatch,
112112
RLinkWrongFileType, RlinkCorruptFile, RlinkNotAFile, RlinkUnableToRead, UnstableFeatureUsage,
113113
};
114114

@@ -243,12 +243,17 @@ pub fn run_compiler(at_args: &[String], callbacks: &mut (dyn Callbacks + Send))
243243
return;
244244
}
245245

246+
let input = make_input(&default_early_dcx, &matches.free);
247+
let has_input = input.is_some();
246248
let (odir, ofile) = make_output(&matches);
249+
250+
drop(default_early_dcx);
251+
247252
let mut config = interface::Config {
248253
opts: sopts,
249254
crate_cfg: matches.opt_strs("cfg"),
250255
crate_check_cfg: matches.opt_strs("check-cfg"),
251-
input: Input::File(PathBuf::new()),
256+
input: input.unwrap_or(Input::File(PathBuf::new())),
252257
output_file: ofile,
253258
output_dir: odir,
254259
ice_file,
@@ -265,16 +270,6 @@ pub fn run_compiler(at_args: &[String], callbacks: &mut (dyn Callbacks + Send))
265270
expanded_args: args,
266271
};
267272

268-
let has_input = match make_input(&default_early_dcx, &matches.free) {
269-
Some(input) => {
270-
config.input = input;
271-
true // has input: normal compilation
272-
}
273-
None => false, // no input: we will exit early
274-
};
275-
276-
drop(default_early_dcx);
277-
278273
callbacks.config(&mut config);
279274

280275
let registered_lints = config.register_lints.is_some();
@@ -379,6 +374,12 @@ pub fn run_compiler(at_args: &[String], callbacks: &mut (dyn Callbacks + Send))
379374
return early_exit();
380375
}
381376

377+
if tcx.sess.opts.output_types.contains_key(&OutputType::Mir) {
378+
if let Err(error) = rustc_mir_transform::dump_mir::emit_mir(tcx) {
379+
tcx.dcx().emit_fatal(CantEmitMIR { error });
380+
}
381+
}
382+
382383
Some(Linker::codegen_and_build_linker(tcx, &*compiler.codegen_backend))
383384
});
384385

@@ -407,7 +408,7 @@ fn dump_feature_usage_metrics(tcxt: TyCtxt<'_>, metrics_dir: &Path) {
407408
}
408409
}
409410

410-
// Extract output directory and file from matches.
411+
/// Extract output directory and file from matches.
411412
fn make_output(matches: &getopts::Matches) -> (Option<PathBuf>, Option<OutFileName>) {
412413
let odir = matches.opt_str("out-dir").map(|o| PathBuf::from(&o));
413414
let ofile = matches.opt_str("o").map(|o| match o.as_str() {

compiler/rustc_driver_impl/src/session_diagnostics.rs

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ use std::error::Error;
22

33
use rustc_macros::{Diagnostic, Subdiagnostic};
44

5+
#[derive(Diagnostic)]
6+
#[diag(driver_impl_cant_emit_mir)]
7+
pub struct CantEmitMIR {
8+
pub error: std::io::Error,
9+
}
10+
511
#[derive(Diagnostic)]
612
#[diag(driver_impl_rlink_unable_to_read)]
713
pub(crate) struct RlinkUnableToRead {

compiler/rustc_interface/messages.ftl

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ interface_abi_required_feature =
33
.note = this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
44
interface_abi_required_feature_issue = for more information, see issue #116344 <https://github.com/rust-lang/rust/issues/116344>
55
6-
interface_cant_emit_mir =
7-
could not emit MIR: {$error}
8-
96
interface_crate_name_does_not_match = `--crate-name` and `#[crate_name]` are required to match, but `{$crate_name}` != `{$attr_crate_name}`
107
118
interface_crate_name_invalid = crate names cannot start with a `-`, but `{$crate_name}` has a leading hyphen

compiler/rustc_interface/src/errors.rs

-6
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,6 @@ pub struct TempsDirError;
7373
#[diag(interface_out_dir_error)]
7474
pub struct OutDirError;
7575

76-
#[derive(Diagnostic)]
77-
#[diag(interface_cant_emit_mir)]
78-
pub struct CantEmitMIR {
79-
pub error: io::Error,
80-
}
81-
8276
#[derive(Diagnostic)]
8377
#[diag(interface_rustc_error_fatal)]
8478
pub struct RustcErrorFatal {

compiler/rustc_interface/src/passes.rs

+9-15
Original file line numberDiff line numberDiff line change
@@ -1078,16 +1078,22 @@ pub(crate) fn start_codegen<'tcx>(
10781078
codegen_backend: &dyn CodegenBackend,
10791079
tcx: TyCtxt<'tcx>,
10801080
) -> Box<dyn Any> {
1081+
// Hook for UI tests.
1082+
check_for_rustc_errors_attr(tcx);
1083+
1084+
// Don't run this test assertions when not doing codegen. Compiletest tries to build
1085+
// build-fail tests in check mode first and expects it to not give an error in that case.
1086+
if tcx.sess.opts.output_types.should_codegen() {
1087+
rustc_symbol_mangling::test::report_symbol_names(tcx);
1088+
}
1089+
10811090
// Don't do code generation if there were any errors. Likewise if
10821091
// there were any delayed bugs, because codegen will likely cause
10831092
// more ICEs, obscuring the original problem.
10841093
if let Some(guar) = tcx.sess.dcx().has_errors_or_delayed_bugs() {
10851094
guar.raise_fatal();
10861095
}
10871096

1088-
// Hook for UI tests.
1089-
check_for_rustc_errors_attr(tcx);
1090-
10911097
info!("Pre-codegen\n{:?}", tcx.debug_stats());
10921098

10931099
let (metadata, need_metadata_module) = rustc_metadata::fs::encode_and_write_metadata(tcx);
@@ -1096,20 +1102,8 @@ pub(crate) fn start_codegen<'tcx>(
10961102
codegen_backend.codegen_crate(tcx, metadata, need_metadata_module)
10971103
});
10981104

1099-
// Don't run this test assertions when not doing codegen. Compiletest tries to build
1100-
// build-fail tests in check mode first and expects it to not give an error in that case.
1101-
if tcx.sess.opts.output_types.should_codegen() {
1102-
rustc_symbol_mangling::test::report_symbol_names(tcx);
1103-
}
1104-
11051105
info!("Post-codegen\n{:?}", tcx.debug_stats());
11061106

1107-
if tcx.sess.opts.output_types.contains_key(&OutputType::Mir) {
1108-
if let Err(error) = rustc_mir_transform::dump_mir::emit_mir(tcx) {
1109-
tcx.dcx().emit_fatal(errors::CantEmitMIR { error });
1110-
}
1111-
}
1112-
11131107
// This must run after monomorphization so that all generic types
11141108
// have been instantiated.
11151109
if tcx.sess.opts.unstable_opts.print_type_sizes {

compiler/rustc_passes/messages.ftl

+2-2
Original file line numberDiff line numberDiff line change
@@ -811,8 +811,8 @@ passes_unused_duplicate =
811811
passes_unused_empty_lints_note =
812812
attribute `{$name}` with an empty list has no effect
813813
814-
passes_unused_linker_warnings_note =
815-
the `linker_warnings` lint can only be controlled at the root of a crate that needs to be linked
814+
passes_unused_linker_messages_note =
815+
the `linker_messages` lint can only be controlled at the root of a crate that needs to be linked
816816
817817
passes_unused_multiple =
818818
multiple `{$name}` attributes

compiler/rustc_passes/src/check_attr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2402,7 +2402,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
24022402
.iter()
24032403
.all(|kind| matches!(kind, CrateType::Rlib | CrateType::Staticlib));
24042404
if never_needs_link {
2405-
errors::UnusedNote::LinkerWarningsBinaryCrateOnly
2405+
errors::UnusedNote::LinkerMessagesBinaryCrateOnly
24062406
} else {
24072407
return;
24082408
}

compiler/rustc_passes/src/errors.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -770,8 +770,8 @@ pub(crate) enum UnusedNote {
770770
NoLints { name: Symbol },
771771
#[note(passes_unused_default_method_body_const_note)]
772772
DefaultMethodBodyConst,
773-
#[note(passes_unused_linker_warnings_note)]
774-
LinkerWarningsBinaryCrateOnly,
773+
#[note(passes_unused_linker_messages_note)]
774+
LinkerMessagesBinaryCrateOnly,
775775
}
776776

777777
#[derive(LintDiagnostic)]

compiler/rustc_target/src/spec/mod.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -3342,7 +3342,10 @@ impl Target {
33423342
);
33433343
}
33443344
"arm" => {
3345-
check!(self.llvm_floatabi.is_some(), "ARM targets must specify their float ABI",)
3345+
check!(
3346+
self.llvm_floatabi.is_some(),
3347+
"ARM targets must set `llvm-floatabi` to `hard` or `soft`",
3348+
)
33463349
}
33473350
_ => {}
33483351
}

library/std/src/fs.rs

+10-5
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,7 @@ impl File {
665665
/// # Examples
666666
///
667667
/// ```no_run
668+
/// #![feature(file_lock)]
668669
/// use std::fs::File;
669670
///
670671
/// fn main() -> std::io::Result<()> {
@@ -673,7 +674,7 @@ impl File {
673674
/// Ok(())
674675
/// }
675676
/// ```
676-
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
677+
#[unstable(feature = "file_lock", issue = "130994")]
677678
pub fn lock(&self) -> io::Result<()> {
678679
self.inner.lock()
679680
}
@@ -717,6 +718,7 @@ impl File {
717718
/// # Examples
718719
///
719720
/// ```no_run
721+
/// #![feature(file_lock)]
720722
/// use std::fs::File;
721723
///
722724
/// fn main() -> std::io::Result<()> {
@@ -725,7 +727,7 @@ impl File {
725727
/// Ok(())
726728
/// }
727729
/// ```
728-
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
730+
#[unstable(feature = "file_lock", issue = "130994")]
729731
pub fn lock_shared(&self) -> io::Result<()> {
730732
self.inner.lock_shared()
731733
}
@@ -774,6 +776,7 @@ impl File {
774776
/// # Examples
775777
///
776778
/// ```no_run
779+
/// #![feature(file_lock)]
777780
/// use std::fs::File;
778781
///
779782
/// fn main() -> std::io::Result<()> {
@@ -782,7 +785,7 @@ impl File {
782785
/// Ok(())
783786
/// }
784787
/// ```
785-
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
788+
#[unstable(feature = "file_lock", issue = "130994")]
786789
pub fn try_lock(&self) -> io::Result<bool> {
787790
self.inner.try_lock()
788791
}
@@ -830,6 +833,7 @@ impl File {
830833
/// # Examples
831834
///
832835
/// ```no_run
836+
/// #![feature(file_lock)]
833837
/// use std::fs::File;
834838
///
835839
/// fn main() -> std::io::Result<()> {
@@ -838,7 +842,7 @@ impl File {
838842
/// Ok(())
839843
/// }
840844
/// ```
841-
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
845+
#[unstable(feature = "file_lock", issue = "130994")]
842846
pub fn try_lock_shared(&self) -> io::Result<bool> {
843847
self.inner.try_lock_shared()
844848
}
@@ -866,6 +870,7 @@ impl File {
866870
/// # Examples
867871
///
868872
/// ```no_run
873+
/// #![feature(file_lock)]
869874
/// use std::fs::File;
870875
///
871876
/// fn main() -> std::io::Result<()> {
@@ -875,7 +880,7 @@ impl File {
875880
/// Ok(())
876881
/// }
877882
/// ```
878-
#[stable(feature = "file_lock", since = "CURRENT_RUSTC_VERSION")]
883+
#[unstable(feature = "file_lock", issue = "130994")]
879884
pub fn unlock(&self) -> io::Result<()> {
880885
self.inner.unlock()
881886
}

library/std/src/sys/pal/unix/thread.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ impl Thread {
143143
pub fn set_name(name: &CStr) {
144144
unsafe {
145145
cfg_if::cfg_if! {
146-
if #[cfg(target_os = "linux")] {
147-
// Linux limits the allowed length of the name.
146+
if #[cfg(any(target_os = "linux", target_os = "cygwin"))] {
147+
// Linux and Cygwin limits the allowed length of the name.
148148
const TASK_COMM_LEN: usize = 16;
149149
let name = truncate_cstr::<{ TASK_COMM_LEN }>(name);
150150
} else {
@@ -346,6 +346,7 @@ impl Drop for Thread {
346346
target_os = "solaris",
347347
target_os = "illumos",
348348
target_os = "vxworks",
349+
target_os = "cygwin",
349350
target_vendor = "apple",
350351
))]
351352
fn truncate_cstr<const MAX_WITH_NUL: usize>(cstr: &CStr) -> [libc::c_char; MAX_WITH_NUL] {

library/std/src/thread/tests.rs

+5
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ fn test_is_finished() {
108108
}
109109

110110
#[test]
111+
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
111112
fn test_join_panic() {
112113
match thread::spawn(move || panic!()).join() {
113114
result::Result::Err(_) => (),
@@ -210,6 +211,7 @@ fn test_simple_newsched_spawn() {
210211
}
211212

212213
#[test]
214+
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
213215
fn test_try_panic_message_string_literal() {
214216
match thread::spawn(move || {
215217
panic!("static string");
@@ -226,6 +228,7 @@ fn test_try_panic_message_string_literal() {
226228
}
227229

228230
#[test]
231+
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
229232
fn test_try_panic_any_message_owned_str() {
230233
match thread::spawn(move || {
231234
panic_any("owned string".to_string());
@@ -242,6 +245,7 @@ fn test_try_panic_any_message_owned_str() {
242245
}
243246

244247
#[test]
248+
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
245249
fn test_try_panic_any_message_any() {
246250
match thread::spawn(move || {
247251
panic_any(Box::new(413u16) as Box<dyn Any + Send>);
@@ -260,6 +264,7 @@ fn test_try_panic_any_message_any() {
260264
}
261265

262266
#[test]
267+
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
263268
fn test_try_panic_any_message_unit_struct() {
264269
struct Juju;
265270

0 commit comments

Comments
 (0)