Skip to content

Commit 57e620e

Browse files
committed
Auto merge of #145701 - jhpratt:rollup-a0kg33p, r=jhpratt
Rollup of 19 pull requests Successful merges: - #143383 (stabilize `const_array_each_ref`) - #144758 ([Doc] Add links to the various collections) - #144915 (Defer tail call ret ty equality to check_tail_calls) - #145256 (Add new `--test-codegen-backend` bootstrap option) - #145297 (fix(debuginfo): handle false positives in overflow check) - #145390 (Shorten some dependency chains in the compiler) - #145415 (std_detect: RISC-V: implement implication to "C") - #145525 (stdlib: Replace typedef -> type alias in doc comment) - #145590 (Prevent impossible combinations in `ast::ModKind`.) - #145593 (UnsafePinned::raw_get: sync signature with get) - #145621 (Fix some doc typos) - #145627 (Unconditionally-const supertraits are considered not dyn compatible) - #145642 (Do not use effective_visibilities query for Adt types of a local trait while proving a where-clause) - #145650 (Fix JS search scripts path) - #145654 (Download CI GCC into the correct directory) - #145662 (Enforce correct number of arguments for `"x86-interrupt"` functions) - #145673 (Add flock support for cygwin) - #145674 (Enable triagebot `[review-changes-since]` feature) - #145678 (Fix typo in docstring) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 922958c + 49eb781 commit 57e620e

File tree

121 files changed

+1107
-698
lines changed

Some content is hidden

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

121 files changed

+1107
-698
lines changed

Cargo.lock

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3367,6 +3367,7 @@ dependencies = [
33673367
"rand 0.9.2",
33683368
"rand_xoshiro",
33693369
"rustc_data_structures",
3370+
"rustc_error_messages",
33703371
"rustc_hashes",
33713372
"rustc_index",
33723373
"rustc_macros",
@@ -3779,6 +3780,8 @@ dependencies = [
37793780
"icu_locid",
37803781
"icu_provider_adapters",
37813782
"intl-memoizer",
3783+
"rustc_ast",
3784+
"rustc_ast_pretty",
37823785
"rustc_baked_icu_data",
37833786
"rustc_data_structures",
37843787
"rustc_macros",
@@ -3795,22 +3798,18 @@ dependencies = [
37953798
"annotate-snippets 0.11.5",
37963799
"derive_setters",
37973800
"rustc_abi",
3798-
"rustc_ast",
3799-
"rustc_ast_pretty",
38003801
"rustc_data_structures",
38013802
"rustc_error_codes",
38023803
"rustc_error_messages",
38033804
"rustc_fluent_macro",
38043805
"rustc_hashes",
3805-
"rustc_hir",
3806+
"rustc_hir_id",
38063807
"rustc_index",
38073808
"rustc_lexer",
38083809
"rustc_lint_defs",
38093810
"rustc_macros",
38103811
"rustc_serialize",
38113812
"rustc_span",
3812-
"rustc_target",
3813-
"rustc_type_ir",
38143813
"serde",
38153814
"serde_json",
38163815
"termcolor",
@@ -3898,7 +3897,9 @@ dependencies = [
38983897
"rustc_ast",
38993898
"rustc_ast_pretty",
39003899
"rustc_data_structures",
3900+
"rustc_error_messages",
39013901
"rustc_hashes",
3902+
"rustc_hir_id",
39023903
"rustc_index",
39033904
"rustc_macros",
39043905
"rustc_serialize",
@@ -3936,6 +3937,17 @@ dependencies = [
39363937
"tracing",
39373938
]
39383939

3940+
[[package]]
3941+
name = "rustc_hir_id"
3942+
version = "0.0.0"
3943+
dependencies = [
3944+
"rustc_data_structures",
3945+
"rustc_index",
3946+
"rustc_macros",
3947+
"rustc_serialize",
3948+
"rustc_span",
3949+
]
3950+
39393951
[[package]]
39403952
name = "rustc_hir_pretty"
39413953
version = "0.0.0"
@@ -4127,7 +4139,7 @@ dependencies = [
41274139
"rustc_ast",
41284140
"rustc_data_structures",
41294141
"rustc_error_messages",
4130-
"rustc_hir",
4142+
"rustc_hir_id",
41314143
"rustc_macros",
41324144
"rustc_serialize",
41334145
"rustc_span",
@@ -4268,7 +4280,6 @@ dependencies = [
42684280
"rustc_errors",
42694281
"rustc_fluent_macro",
42704282
"rustc_graphviz",
4271-
"rustc_hir",
42724283
"rustc_index",
42734284
"rustc_macros",
42744285
"rustc_middle",
@@ -4647,6 +4658,7 @@ dependencies = [
46474658
"object 0.37.2",
46484659
"rustc_abi",
46494660
"rustc_data_structures",
4661+
"rustc_error_messages",
46504662
"rustc_fs_util",
46514663
"rustc_macros",
46524664
"rustc_serialize",
@@ -4710,7 +4722,6 @@ name = "rustc_traits"
47104722
version = "0.0.0"
47114723
dependencies = [
47124724
"rustc_data_structures",
4713-
"rustc_hir",
47144725
"rustc_infer",
47154726
"rustc_middle",
47164727
"rustc_span",
@@ -4765,6 +4776,7 @@ dependencies = [
47654776
"rustc-hash 2.1.1",
47664777
"rustc_ast_ir",
47674778
"rustc_data_structures",
4779+
"rustc_error_messages",
47684780
"rustc_index",
47694781
"rustc_macros",
47704782
"rustc_serialize",

RELEASES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1778,7 +1778,7 @@ Language
17781778
- [Undeprecate lint `unstable_features` and make use of it in the compiler.](https://github.com/rust-lang/rust/pull/118639/)
17791779
- [Make inductive cycles in coherence ambiguous always.](https://github.com/rust-lang/rust/pull/118649/)
17801780
- [Get rid of type-driven traversal in const-eval interning](https://github.com/rust-lang/rust/pull/119044/),
1781-
only as a [future compatiblity lint](https://github.com/rust-lang/rust/pull/122204) for now.
1781+
only as a [future compatibility lint](https://github.com/rust-lang/rust/pull/122204) for now.
17821782
- [Deny braced macro invocations in let-else.](https://github.com/rust-lang/rust/pull/119062/)
17831783

17841784
<a id="1.77.0-Compiler"></a>

compiler/rustc_abi/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ bitflags = "2.4.1"
99
rand = { version = "0.9.0", default-features = false, optional = true }
1010
rand_xoshiro = { version = "0.7.0", optional = true }
1111
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
12+
rustc_error_messages = { path = "../rustc_error_messages", optional = true }
1213
rustc_hashes = { path = "../rustc_hashes" }
1314
rustc_index = { path = "../rustc_index", default-features = false }
1415
rustc_macros = { path = "../rustc_macros", optional = true }
@@ -24,6 +25,7 @@ default = ["nightly", "randomize"]
2425
# without depending on rustc_data_structures, rustc_macros and rustc_serialize
2526
nightly = [
2627
"dep:rustc_data_structures",
28+
"dep:rustc_error_messages",
2729
"dep:rustc_macros",
2830
"dep:rustc_serialize",
2931
"dep:rustc_span",

compiler/rustc_abi/src/extern_abi.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ impl StableOrd for ExternAbi {
223223
const THIS_IMPLEMENTATION_HAS_BEEN_TRIPLE_CHECKED: () = ();
224224
}
225225

226+
#[cfg(feature = "nightly")]
227+
rustc_error_messages::into_diag_arg_using_display!(ExternAbi);
228+
226229
impl ExternAbi {
227230
/// An ABI "like Rust"
228231
///

compiler/rustc_ast/src/ast.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3137,7 +3137,7 @@ impl FnRetTy {
31373137
#[derive(Clone, Copy, PartialEq, Encodable, Decodable, Debug, Walkable)]
31383138
pub enum Inline {
31393139
Yes,
3140-
No,
3140+
No { had_parse_error: Result<(), ErrorGuaranteed> },
31413141
}
31423142

31433143
/// Module item kind.
@@ -3147,7 +3147,7 @@ pub enum ModKind {
31473147
/// or with definition outlined to a separate file `mod foo;` and already loaded from it.
31483148
/// The inner span is from the first token past `{` to the last token until `}`,
31493149
/// or from the first to the last token in the loaded file.
3150-
Loaded(ThinVec<Box<Item>>, Inline, ModSpans, Result<(), ErrorGuaranteed>),
3150+
Loaded(ThinVec<Box<Item>>, Inline, ModSpans),
31513151
/// Module with definition outlined to a separate file `mod foo;` but not yet loaded from it.
31523152
Unloaded,
31533153
}

compiler/rustc_ast_lowering/src/item.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
251251
ItemKind::Mod(_, ident, mod_kind) => {
252252
let ident = self.lower_ident(*ident);
253253
match mod_kind {
254-
ModKind::Loaded(items, _, spans, _) => {
254+
ModKind::Loaded(items, _, spans) => {
255255
hir::ItemKind::Mod(ident, self.lower_mod(items, spans))
256256
}
257257
ModKind::Unloaded => panic!("`mod` items should have been loaded by now"),

compiler/rustc_ast_passes/messages.ftl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ ast_passes_abi_must_not_have_return_type=
2020
.note = functions with the {$abi} ABI cannot have a return type
2121
.help = remove the return type
2222
23+
ast_passes_abi_x86_interrupt =
24+
invalid signature for `extern "x86-interrupt"` function
25+
.note = functions with the "x86-interrupt" ABI must be have either 1 or 2 parameters (but found {$param_count})
26+
2327
ast_passes_assoc_const_without_body =
2428
associated constant in `impl` without body
2529
.suggestion = provide a definition for the constant

compiler/rustc_ast_passes/src/ast_validation.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,17 @@ impl<'a> AstValidator<'a> {
405405
if let InterruptKind::X86 = interrupt_kind {
406406
// "x86-interrupt" is special because it does have arguments.
407407
// FIXME(workingjubilee): properly lint on acceptable input types.
408+
let inputs = &sig.decl.inputs;
409+
let param_count = inputs.len();
410+
if !matches!(param_count, 1 | 2) {
411+
let mut spans: Vec<Span> =
412+
inputs.iter().map(|arg| arg.span).collect();
413+
if spans.is_empty() {
414+
spans = vec![sig.span];
415+
}
416+
self.dcx().emit_err(errors::AbiX86Interrupt { spans, param_count });
417+
}
418+
408419
if let FnRetTy::Ty(ref ret_ty) = sig.decl.output
409420
&& match &ret_ty.kind {
410421
TyKind::Never => false,
@@ -1169,7 +1180,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
11691180
self.dcx().emit_err(errors::UnsafeItem { span, kind: "module" });
11701181
}
11711182
// Ensure that `path` attributes on modules are recorded as used (cf. issue #35584).
1172-
if !matches!(mod_kind, ModKind::Loaded(_, Inline::Yes, _, _))
1183+
if !matches!(mod_kind, ModKind::Loaded(_, Inline::Yes, _))
11731184
&& !attr::contains_name(&item.attrs, sym::path)
11741185
{
11751186
self.check_mod_file_item_asciionly(*ident);

compiler/rustc_ast_passes/src/errors.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,3 +891,12 @@ pub(crate) struct AbiMustNotHaveReturnType {
891891
pub span: Span,
892892
pub abi: ExternAbi,
893893
}
894+
895+
#[derive(Diagnostic)]
896+
#[diag(ast_passes_abi_x86_interrupt)]
897+
#[note]
898+
pub(crate) struct AbiX86Interrupt {
899+
#[primary_span]
900+
pub spans: Vec<Span>,
901+
pub param_count: usize,
902+
}

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1879,7 +1879,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
18791879
if !output_ty
18801880
.is_privately_uninhabited(self.tcx(), self.infcx.typing_env(self.infcx.param_env))
18811881
{
1882-
span_mirbug!(self, term, "call to converging function {:?} w/o dest", sig);
1882+
span_mirbug!(self, term, "call to non-diverging function {:?} w/o dest", sig);
18831883
}
18841884
} else {
18851885
let dest_ty = destination.ty(self.body, tcx).ty;

0 commit comments

Comments
 (0)