Skip to content

Rollup of 20 pull requests #145697

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

Closed
wants to merge 48 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
9370440
stabilize `const_array_each_ref`
fee1-dead Jul 3, 2025
f4b3415
[Doc] Add links to the various collections
QnJ1c2kNCg Jul 31, 2025
e13e1e4
fix(debuginfo): handle false positives in overflow check
adwinwhite Aug 12, 2025
919d413
regression test for https://github.com/rust-lang/rust/issues/117763
the8472 Aug 14, 2025
be9cd3c
stdlib: Replace typedef -> type alias in doc comment
typesanitizer Aug 17, 2025
ee7627e
std_detect: RISC-V: implement implication to "C"
a4lg Aug 19, 2025
c2e16cb
UnsafePinned::raw_get: sync signature with get
RalfJung Aug 19, 2025
bfd5d59
Prevent impossible combinations in `ast::ModKind`.
nnethercote Aug 19, 2025
6a088fd
Defer tail call ret ty equality to check_tail_calls
compiler-errors Aug 19, 2025
555986d
Fix some doc typos
dns2utf8 Aug 19, 2025
5a451b8
Add new `--test-codegen-backend` bootstrap option
GuillaumeGomez Aug 11, 2025
e4cdc0f
Split compiletest `--codegen-backend` into two options `--default-cod…
GuillaumeGomez Aug 18, 2025
27e6726
Do not use effective_visibilities query for Adt types of a local trai…
xizheyin Aug 20, 2025
29f0d8b
Download CI GCC into the correct directory
Kobzol Aug 20, 2025
e1045c2
Fix JS search scripts path
GuillaumeGomez Aug 20, 2025
2da0ec3
Enforce correct number of arguments for `"x86-interrupt"` functions
GrigorenkoPV Aug 20, 2025
e57e5f0
Unconditionally-const supertraits are considered not dyn compatible
compiler-errors Aug 19, 2025
cadb56d
Add flock support for cygwin
Berrysoft Aug 20, 2025
992c025
Enable triagebot `[review-changes-since]` feature
Urgau Aug 20, 2025
f34fa22
fix: typo
ttajakka Aug 20, 2025
b65fab6
Move `IntoDiagArg` earlier in the dependency chains
joshtriplett Aug 14, 2025
f3c8b7a
Split `rustc_hir_id` out of `rustc_hir`
joshtriplett Aug 14, 2025
e46ec74
Update test output for change to number of crates
joshtriplett Aug 14, 2025
6cb9dd5
rustc_lint_defs: Use `DefPathHash` from `rustc_span` rather than `rus…
joshtriplett Aug 14, 2025
f0c8f70
rustc_lint_defs: Eliminate the dependency on `rustc_hir` for `Namespace`
joshtriplett Aug 14, 2025
bad4f5c
Eliminate unnecessary dependency from `rustc_mir_dataflow` to `rustc_…
joshtriplett Aug 14, 2025
0f0d702
Eliminate unnecessary dependency from `rustc_traits` to `rustc_hir`
joshtriplett Aug 14, 2025
2ea7e7d
rustc_hir_id: Add a comment explaining why the crate exists
joshtriplett Aug 18, 2025
aca5943
Rollup merge of #143383 - fee1-dead-contrib:push-mstmlwuskxyy, r=dtolnay
jhpratt Aug 21, 2025
c38b2c9
Rollup merge of #144758 - QnJ1c2kNCg:master, r=Noratrieb
jhpratt Aug 21, 2025
d681dda
Rollup merge of #144915 - compiler-errors:tail-call-ret-ty-equality, …
jhpratt Aug 21, 2025
354bbe9
Rollup merge of #145256 - GuillaumeGomez:bootstrap-test-codegen-backe…
jhpratt Aug 21, 2025
1f812db
Rollup merge of #145297 - adwinwhite:recursive-debuginfo, r=wesleywiser
jhpratt Aug 21, 2025
fd4ae19
Rollup merge of #145390 - joshtriplett:rustc-diag-value-earlier, r=lcnr
jhpratt Aug 21, 2025
725b9b5
Rollup merge of #145411 - the8472:cows-have-no-branches, r=Mark-Simul…
jhpratt Aug 21, 2025
218dd94
Rollup merge of #145415 - a4lg:riscv-implication-to-c, r=Amanieu
jhpratt Aug 21, 2025
f6b9377
Rollup merge of #145525 - typesanitizer:vg/doc, r=Mark-Simulacrum
jhpratt Aug 21, 2025
76a696b
Rollup merge of #145590 - nnethercote:ModKind-Inline, r=petrochenkov
jhpratt Aug 21, 2025
6c93b3a
Rollup merge of #145593 - RalfJung:unsafepinned-raw_get, r=Mark-Simul…
jhpratt Aug 21, 2025
780eea3
Rollup merge of #145621 - dns2utf8:fix_some_typos, r=petrochenkov
jhpratt Aug 21, 2025
12af64a
Rollup merge of #145627 - compiler-errors:const-supertrait-dyn-compat…
jhpratt Aug 21, 2025
3e435aa
Rollup merge of #145642 - xizheyin:145611, r=lcnr
jhpratt Aug 21, 2025
d2dc84f
Rollup merge of #145650 - GuillaumeGomez:fix-js-search-scripts-path, …
jhpratt Aug 21, 2025
c99d5b7
Rollup merge of #145654 - Kobzol:gcc-ci-root, r=jieyouxu
jhpratt Aug 21, 2025
e1c7e3c
Rollup merge of #145662 - GrigorenkoPV:x86-interrupt, r=compiler-errors
jhpratt Aug 21, 2025
c562485
Rollup merge of #145673 - Berrysoft:cygwin-fix-flock, r=joshtriplett
jhpratt Aug 21, 2025
e0bf549
Rollup merge of #145674 - Urgau:triagebot-review-changes-since, r=Kobzol
jhpratt Aug 21, 2025
d533ada
Rollup merge of #145678 - ttajakka:master, r=estebank
jhpratt Aug 21, 2025
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
28 changes: 20 additions & 8 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3367,6 +3367,7 @@ dependencies = [
"rand 0.9.2",
"rand_xoshiro",
"rustc_data_structures",
"rustc_error_messages",
"rustc_hashes",
"rustc_index",
"rustc_macros",
Expand Down Expand Up @@ -3779,6 +3780,8 @@ dependencies = [
"icu_locid",
"icu_provider_adapters",
"intl-memoizer",
"rustc_ast",
"rustc_ast_pretty",
"rustc_baked_icu_data",
"rustc_data_structures",
"rustc_macros",
Expand All @@ -3795,22 +3798,18 @@ dependencies = [
"annotate-snippets 0.11.5",
"derive_setters",
"rustc_abi",
"rustc_ast",
"rustc_ast_pretty",
"rustc_data_structures",
"rustc_error_codes",
"rustc_error_messages",
"rustc_fluent_macro",
"rustc_hashes",
"rustc_hir",
"rustc_hir_id",
"rustc_index",
"rustc_lexer",
"rustc_lint_defs",
"rustc_macros",
"rustc_serialize",
"rustc_span",
"rustc_target",
"rustc_type_ir",
"serde",
"serde_json",
"termcolor",
Expand Down Expand Up @@ -3898,7 +3897,9 @@ dependencies = [
"rustc_ast",
"rustc_ast_pretty",
"rustc_data_structures",
"rustc_error_messages",
"rustc_hashes",
"rustc_hir_id",
"rustc_index",
"rustc_macros",
"rustc_serialize",
Expand Down Expand Up @@ -3936,6 +3937,17 @@ dependencies = [
"tracing",
]

[[package]]
name = "rustc_hir_id"
version = "0.0.0"
dependencies = [
"rustc_data_structures",
"rustc_index",
"rustc_macros",
"rustc_serialize",
"rustc_span",
]

[[package]]
name = "rustc_hir_pretty"
version = "0.0.0"
Expand Down Expand Up @@ -4127,7 +4139,7 @@ dependencies = [
"rustc_ast",
"rustc_data_structures",
"rustc_error_messages",
"rustc_hir",
"rustc_hir_id",
"rustc_macros",
"rustc_serialize",
"rustc_span",
Expand Down Expand Up @@ -4268,7 +4280,6 @@ dependencies = [
"rustc_errors",
"rustc_fluent_macro",
"rustc_graphviz",
"rustc_hir",
"rustc_index",
"rustc_macros",
"rustc_middle",
Expand Down Expand Up @@ -4647,6 +4658,7 @@ dependencies = [
"object 0.37.2",
"rustc_abi",
"rustc_data_structures",
"rustc_error_messages",
"rustc_fs_util",
"rustc_macros",
"rustc_serialize",
Expand Down Expand Up @@ -4710,7 +4722,6 @@ name = "rustc_traits"
version = "0.0.0"
dependencies = [
"rustc_data_structures",
"rustc_hir",
"rustc_infer",
"rustc_middle",
"rustc_span",
Expand Down Expand Up @@ -4765,6 +4776,7 @@ dependencies = [
"rustc-hash 2.1.1",
"rustc_ast_ir",
"rustc_data_structures",
"rustc_error_messages",
"rustc_index",
"rustc_macros",
"rustc_serialize",
Expand Down
2 changes: 1 addition & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -1778,7 +1778,7 @@ Language
- [Undeprecate lint `unstable_features` and make use of it in the compiler.](https://github.com/rust-lang/rust/pull/118639/)
- [Make inductive cycles in coherence ambiguous always.](https://github.com/rust-lang/rust/pull/118649/)
- [Get rid of type-driven traversal in const-eval interning](https://github.com/rust-lang/rust/pull/119044/),
only as a [future compatiblity lint](https://github.com/rust-lang/rust/pull/122204) for now.
only as a [future compatibility lint](https://github.com/rust-lang/rust/pull/122204) for now.
- [Deny braced macro invocations in let-else.](https://github.com/rust-lang/rust/pull/119062/)

<a id="1.77.0-Compiler"></a>
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_abi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ bitflags = "2.4.1"
rand = { version = "0.9.0", default-features = false, optional = true }
rand_xoshiro = { version = "0.7.0", optional = true }
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
rustc_error_messages = { path = "../rustc_error_messages", optional = true }
rustc_hashes = { path = "../rustc_hashes" }
rustc_index = { path = "../rustc_index", default-features = false }
rustc_macros = { path = "../rustc_macros", optional = true }
Expand All @@ -24,6 +25,7 @@ default = ["nightly", "randomize"]
# without depending on rustc_data_structures, rustc_macros and rustc_serialize
nightly = [
"dep:rustc_data_structures",
"dep:rustc_error_messages",
"dep:rustc_macros",
"dep:rustc_serialize",
"dep:rustc_span",
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_abi/src/extern_abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ impl StableOrd for ExternAbi {
const THIS_IMPLEMENTATION_HAS_BEEN_TRIPLE_CHECKED: () = ();
}

#[cfg(feature = "nightly")]
rustc_error_messages::into_diag_arg_using_display!(ExternAbi);

impl ExternAbi {
/// An ABI "like Rust"
///
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3137,7 +3137,7 @@ impl FnRetTy {
#[derive(Clone, Copy, PartialEq, Encodable, Decodable, Debug, Walkable)]
pub enum Inline {
Yes,
No,
No { had_parse_error: Result<(), ErrorGuaranteed> },
}

/// Module item kind.
Expand All @@ -3147,7 +3147,7 @@ pub enum ModKind {
/// or with definition outlined to a separate file `mod foo;` and already loaded from it.
/// The inner span is from the first token past `{` to the last token until `}`,
/// or from the first to the last token in the loaded file.
Loaded(ThinVec<Box<Item>>, Inline, ModSpans, Result<(), ErrorGuaranteed>),
Loaded(ThinVec<Box<Item>>, Inline, ModSpans),
/// Module with definition outlined to a separate file `mod foo;` but not yet loaded from it.
Unloaded,
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
ItemKind::Mod(_, ident, mod_kind) => {
let ident = self.lower_ident(*ident);
match mod_kind {
ModKind::Loaded(items, _, spans, _) => {
ModKind::Loaded(items, _, spans) => {
hir::ItemKind::Mod(ident, self.lower_mod(items, spans))
}
ModKind::Unloaded => panic!("`mod` items should have been loaded by now"),
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_ast_passes/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ ast_passes_abi_must_not_have_return_type=
.note = functions with the {$abi} ABI cannot have a return type
.help = remove the return type

ast_passes_abi_x86_interrupt =
invalid signature for `extern "x86-interrupt"` function
.note = functions with the "x86-interrupt" ABI must be have either 1 or 2 parameters (but found {$param_count})

ast_passes_assoc_const_without_body =
associated constant in `impl` without body
.suggestion = provide a definition for the constant
Expand Down
13 changes: 12 additions & 1 deletion compiler/rustc_ast_passes/src/ast_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,17 @@ impl<'a> AstValidator<'a> {
if let InterruptKind::X86 = interrupt_kind {
// "x86-interrupt" is special because it does have arguments.
// FIXME(workingjubilee): properly lint on acceptable input types.
let inputs = &sig.decl.inputs;
let param_count = inputs.len();
if !matches!(param_count, 1 | 2) {
let mut spans: Vec<Span> =
inputs.iter().map(|arg| arg.span).collect();
if spans.is_empty() {
spans = vec![sig.span];
}
self.dcx().emit_err(errors::AbiX86Interrupt { spans, param_count });
}

if let FnRetTy::Ty(ref ret_ty) = sig.decl.output
&& match &ret_ty.kind {
TyKind::Never => false,
Expand Down Expand Up @@ -1169,7 +1180,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
self.dcx().emit_err(errors::UnsafeItem { span, kind: "module" });
}
// Ensure that `path` attributes on modules are recorded as used (cf. issue #35584).
if !matches!(mod_kind, ModKind::Loaded(_, Inline::Yes, _, _))
if !matches!(mod_kind, ModKind::Loaded(_, Inline::Yes, _))
&& !attr::contains_name(&item.attrs, sym::path)
{
self.check_mod_file_item_asciionly(*ident);
Expand Down
9 changes: 9 additions & 0 deletions compiler/rustc_ast_passes/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -891,3 +891,12 @@ pub(crate) struct AbiMustNotHaveReturnType {
pub span: Span,
pub abi: ExternAbi,
}

#[derive(Diagnostic)]
#[diag(ast_passes_abi_x86_interrupt)]
#[note]
pub(crate) struct AbiX86Interrupt {
#[primary_span]
pub spans: Vec<Span>,
pub param_count: usize,
}
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/type_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1895,7 +1895,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
if !output_ty
.is_privately_uninhabited(self.tcx(), self.infcx.typing_env(self.infcx.param_env))
{
span_mirbug!(self, term, "call to converging function {:?} w/o dest", sig);
span_mirbug!(self, term, "call to non-diverging function {:?} w/o dest", sig);
}
} else {
let dest_ty = destination.ty(self.body, tcx).ty;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/test_harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ impl<'a> MutVisitor for TestHarnessGenerator<'a> {
if let ast::ItemKind::Mod(
_,
_,
ModKind::Loaded(.., ast::ModSpans { inner_span: span, .. }, _),
ModKind::Loaded(.., ast::ModSpans { inner_span: span, .. }),
) = item.kind
{
let prev_tests = mem::take(&mut self.tests);
Expand Down
54 changes: 38 additions & 16 deletions compiler/rustc_codegen_llvm/src/debuginfo/metadata/type_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ pub(super) fn build_type_with_children<'ll, 'tcx>(
&& let ty::Adt(adt_def, args) = ty.kind()
{
let def_id = adt_def.did();
// If any sub type reference the original type definition and the sub type has a type
// If any child type references the original type definition and the child type has a type
// parameter that strictly contains the original parameter, the original type is a recursive
// type that can expanding indefinitely. Example,
// ```
Expand All @@ -285,21 +285,43 @@ pub(super) fn build_type_with_children<'ll, 'tcx>(
// Item(T),
// }
// ```
let is_expanding_recursive = adt_def.is_enum()
&& debug_context(cx).adt_stack.borrow().iter().any(|(parent_def_id, parent_args)| {
if def_id == *parent_def_id {
args.iter().zip(parent_args.iter()).any(|(arg, parent_arg)| {
if let (Some(arg), Some(parent_arg)) = (arg.as_type(), parent_arg.as_type())
{
arg != parent_arg && arg.contains(parent_arg)
} else {
false
}
})
} else {
false
}
});
let is_expanding_recursive = {
let stack = debug_context(cx).adt_stack.borrow();
stack
.iter()
.enumerate()
.rev()
.skip(1)
.filter(|(_, (ancestor_def_id, _))| def_id == *ancestor_def_id)
.any(|(ancestor_index, (_, ancestor_args))| {
args.iter()
.zip(ancestor_args.iter())
.filter_map(|(arg, ancestor_arg)| arg.as_type().zip(ancestor_arg.as_type()))
.any(|(arg, ancestor_arg)|
// Strictly contains.
(arg != ancestor_arg && arg.contains(ancestor_arg))
// Check all types between current and ancestor use the
// ancestor_arg.
// Otherwise, duplicate wrappers in normal recursive type may be
// regarded as expanding.
// ```
// struct Recursive {
// a: Box<Box<Recursive>>,
// }
// ```
// It can produce an ADT stack like this,
// - Box<Recursive>
// - Recursive
// - Box<Box<Recursive>>
&& stack[ancestor_index + 1..stack.len()].iter().all(
|(_, intermediate_args)|
intermediate_args
.iter()
.filter_map(|arg| arg.as_type())
.any(|mid_arg| mid_arg.contains(ancestor_arg))
))
})
};
if is_expanding_recursive {
// FIXME: indicate that this is an expanding recursive type in stub metadata?
return DINodeCreationResult::new(stub_info.metadata, false);
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_error_messages/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ icu_list = "1.2"
icu_locid = "1.2"
icu_provider_adapters = "1.2"
intl-memoizer = "0.5.1"
rustc_ast = { path = "../rustc_ast" }
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
rustc_baked_icu_data = { path = "../rustc_baked_icu_data" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_macros = { path = "../rustc_macros" }
Expand Down
Loading
Loading