Skip to content

Commit 6d140d5

Browse files
committed
Auto merge of #111271 - JohnTitor:rollup-t07qk1c, r=JohnTitor
Rollup of 8 pull requests Successful merges: - #109677 (Stabilize raw-dylib, link_ordinal, import_name_type and -Cdlltool) - #110780 (rustdoc-search: add slices and arrays to index) - #110830 (Add FreeBSD cpuset support to `std::thread::available_concurrency`) - #111139 (Fix MXCSR configuration dependent timing) - #111239 (Remove unnecessary attribute from a diagnostic) - #111246 (forbid escaping bound vars in combine) - #111251 (Issue 109502 follow up, remove unnecessary Vec::new() from compile_test()) - #111261 (Mark `ErrorGuaranteed` constructor as deprecated so people don't use it) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 963e5c0 + 393e285 commit 6d140d5

File tree

81 files changed

+403
-387
lines changed

Some content is hidden

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

81 files changed

+403
-387
lines changed

compiler/rustc_codegen_llvm/messages.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ codegen_llvm_error_writing_def_file =
2424
Error writing .DEF file: {$error}
2525
2626
codegen_llvm_error_calling_dlltool =
27-
Error calling dlltool: {$error}
27+
Error calling dlltool '{$dlltool_path}': {$error}
2828
2929
codegen_llvm_dlltool_fail_import_library =
3030
Dlltool could not create import library: {$stdout}

compiler/rustc_codegen_llvm/src/back/archive.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
198198
"arm" => ("arm", "--32"),
199199
_ => panic!("unsupported arch {}", sess.target.arch),
200200
};
201-
let result = std::process::Command::new(dlltool)
201+
let result = std::process::Command::new(&dlltool)
202202
.args([
203203
"-d",
204204
def_file_path.to_str().unwrap(),
@@ -218,9 +218,13 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
218218

219219
match result {
220220
Err(e) => {
221-
sess.emit_fatal(ErrorCallingDllTool { error: e });
221+
sess.emit_fatal(ErrorCallingDllTool {
222+
dlltool_path: dlltool.to_string_lossy(),
223+
error: e,
224+
});
222225
}
223-
Ok(output) if !output.status.success() => {
226+
// dlltool returns '0' on failure, so check for error output instead.
227+
Ok(output) if !output.stderr.is_empty() => {
224228
sess.emit_fatal(DlltoolFailImportLibrary {
225229
stdout: String::from_utf8_lossy(&output.stdout),
226230
stderr: String::from_utf8_lossy(&output.stderr),
@@ -431,7 +435,7 @@ fn string_to_io_error(s: String) -> io::Error {
431435

432436
fn find_binutils_dlltool(sess: &Session) -> OsString {
433437
assert!(sess.target.options.is_like_windows && !sess.target.options.is_like_msvc);
434-
if let Some(dlltool_path) = &sess.opts.unstable_opts.dlltool {
438+
if let Some(dlltool_path) = &sess.opts.cg.dlltool {
435439
return dlltool_path.clone().into_os_string();
436440
}
437441

compiler/rustc_codegen_llvm/src/errors.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ pub(crate) struct ErrorWritingDEFFile {
6767

6868
#[derive(Diagnostic)]
6969
#[diag(codegen_llvm_error_calling_dlltool)]
70-
pub(crate) struct ErrorCallingDllTool {
70+
pub(crate) struct ErrorCallingDllTool<'a> {
71+
pub dlltool_path: Cow<'a, str>,
7172
pub error: std::io::Error,
7273
}
7374

compiler/rustc_codegen_ssa/src/codegen_attrs.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -592,15 +592,6 @@ fn should_inherit_track_caller(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
592592

593593
fn check_link_ordinal(tcx: TyCtxt<'_>, attr: &ast::Attribute) -> Option<u16> {
594594
use rustc_ast::{LitIntType, LitKind, MetaItemLit};
595-
if !tcx.features().raw_dylib && tcx.sess.target.arch == "x86" {
596-
feature_err(
597-
&tcx.sess.parse_sess,
598-
sym::raw_dylib,
599-
attr.span,
600-
"`#[link_ordinal]` is unstable on x86",
601-
)
602-
.emit();
603-
}
604595
let meta_item_list = attr.meta_item_list();
605596
let meta_item_list = meta_item_list.as_deref();
606597
let sole_meta_list = match meta_item_list {

compiler/rustc_driver_impl/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,7 @@ fn extra_compiler_flags() -> Option<(Vec<String>, bool)> {
11781178
pub fn catch_fatal_errors<F: FnOnce() -> R, R>(f: F) -> Result<R, ErrorGuaranteed> {
11791179
catch_unwind(panic::AssertUnwindSafe(f)).map_err(|value| {
11801180
if value.is::<rustc_errors::FatalErrorMarker>() {
1181+
#[allow(deprecated)]
11811182
ErrorGuaranteed::unchecked_claim_error_was_emitted()
11821183
} else {
11831184
panic::resume_unwind(value);

compiler/rustc_errors/src/diagnostic_builder.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ impl EmissionGuarantee for ErrorGuaranteed {
192192
became non-error ({:?}), after original `.emit()`",
193193
db.inner.diagnostic.level,
194194
);
195+
#[allow(deprecated)]
195196
ErrorGuaranteed::unchecked_claim_error_was_emitted()
196197
}
197198
}

compiler/rustc_errors/src/lib.rs

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,26 +1069,29 @@ impl Handler {
10691069
}
10701070

10711071
pub fn has_errors(&self) -> Option<ErrorGuaranteed> {
1072-
self.inner.borrow().has_errors().then(ErrorGuaranteed::unchecked_claim_error_was_emitted)
1072+
self.inner.borrow().has_errors().then(|| {
1073+
#[allow(deprecated)]
1074+
ErrorGuaranteed::unchecked_claim_error_was_emitted()
1075+
})
10731076
}
10741077

10751078
pub fn has_errors_or_lint_errors(&self) -> Option<ErrorGuaranteed> {
1076-
self.inner
1077-
.borrow()
1078-
.has_errors_or_lint_errors()
1079-
.then(ErrorGuaranteed::unchecked_claim_error_was_emitted)
1079+
self.inner.borrow().has_errors_or_lint_errors().then(|| {
1080+
#[allow(deprecated)]
1081+
ErrorGuaranteed::unchecked_claim_error_was_emitted()
1082+
})
10801083
}
10811084
pub fn has_errors_or_delayed_span_bugs(&self) -> Option<ErrorGuaranteed> {
1082-
self.inner
1083-
.borrow()
1084-
.has_errors_or_delayed_span_bugs()
1085-
.then(ErrorGuaranteed::unchecked_claim_error_was_emitted)
1085+
self.inner.borrow().has_errors_or_delayed_span_bugs().then(|| {
1086+
#[allow(deprecated)]
1087+
ErrorGuaranteed::unchecked_claim_error_was_emitted()
1088+
})
10861089
}
10871090
pub fn is_compilation_going_to_fail(&self) -> Option<ErrorGuaranteed> {
1088-
self.inner
1089-
.borrow()
1090-
.is_compilation_going_to_fail()
1091-
.then(ErrorGuaranteed::unchecked_claim_error_was_emitted)
1091+
self.inner.borrow().is_compilation_going_to_fail().then(|| {
1092+
#[allow(deprecated)]
1093+
ErrorGuaranteed::unchecked_claim_error_was_emitted()
1094+
})
10921095
}
10931096

10941097
pub fn print_error_count(&self, registry: &Registry) {
@@ -1333,6 +1336,7 @@ impl HandlerInner {
13331336
.push(DelayedDiagnostic::with_backtrace(diagnostic.clone(), backtrace));
13341337

13351338
if !self.flags.report_delayed_bugs {
1339+
#[allow(deprecated)]
13361340
return Some(ErrorGuaranteed::unchecked_claim_error_was_emitted());
13371341
}
13381342
}
@@ -1411,7 +1415,10 @@ impl HandlerInner {
14111415
self.bump_err_count();
14121416
}
14131417

1414-
guaranteed = Some(ErrorGuaranteed::unchecked_claim_error_was_emitted());
1418+
#[allow(deprecated)]
1419+
{
1420+
guaranteed = Some(ErrorGuaranteed::unchecked_claim_error_was_emitted());
1421+
}
14151422
} else {
14161423
self.bump_warn_count();
14171424
}

compiler/rustc_feature/src/accepted.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ declare_features! (
280280
(accepted, pub_restricted, "1.18.0", Some(32409), None),
281281
/// Allows use of the postfix `?` operator in expressions.
282282
(accepted, question_mark, "1.13.0", Some(31436), None),
283+
/// Allows the use of raw-dylibs (RFC 2627).
284+
(accepted, raw_dylib, "CURRENT_RUSTC_VERSION", Some(58713), None),
283285
/// Allows keywords to be escaped for use as identifiers.
284286
(accepted, raw_identifiers, "1.30.0", Some(48589), None),
285287
/// Allows relaxing the coherence rules such that

compiler/rustc_feature/src/active.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,6 @@ declare_features! (
489489
(active, precise_pointer_size_matching, "1.32.0", Some(56354), None),
490490
/// Allows macro attributes on expressions, statements and non-inline modules.
491491
(active, proc_macro_hygiene, "1.30.0", Some(54727), None),
492-
/// Allows the use of raw-dylibs (RFC 2627).
493-
(active, raw_dylib, "1.65.0", Some(58713), None),
494492
/// Allows `&raw const $place_expr` and `&raw mut $place_expr` expressions.
495493
(active, raw_ref_op, "1.41.0", Some(64490), None),
496494
/// Allows using the `#[register_tool]` attribute.

compiler/rustc_hir_analysis/src/errors.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,6 @@ pub enum ImplNotMarkedDefault {
657657
#[note]
658658
Err {
659659
#[primary_span]
660-
#[label]
661660
span: Span,
662661
cname: Symbol,
663662
ident: Symbol,

0 commit comments

Comments
 (0)