Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
926599a
Add test batch 5
Oneirical Aug 20, 2025
4a886ad
Fix ICE in pattern matching with generic const array length errors
chenyukang Oct 15, 2025
82b0cd8
deny never type lints by default
WaffleLapkin Aug 30, 2025
602959e
bless ui tests
WaffleLapkin Aug 30, 2025
ce320bb
Do not error out for `download-rustc` if LTO is configured
Kobzol Oct 17, 2025
8e59e3b
treat an error taint from const eval lint in late_lint and check_mod_…
Shunpoco Mar 18, 2025
845ff73
address review
Shunpoco Oct 17, 2025
86dc39f
expect never type lint in tests which do not test it
WaffleLapkin Oct 16, 2025
a1a9113
Rename "non-inline module" to "file module" in proc macro diagnostics
reddevilmidzy Oct 7, 2025
769009a
remove useless `#![deny]`s
WaffleLapkin Oct 16, 2025
0c2e7ce
Add regression test for 134355
reddevilmidzy Oct 18, 2025
e3dd4c1
Warn on `unused_attributes` in tests
JonathanBrouwer Oct 17, 2025
66b8a9d
Update uitests with new `unused_attributes` warnings
JonathanBrouwer Oct 17, 2025
a4fb896
Rollup merge of #138679 - Shunpoco:issue-125323, r=oli-obk
matthiaskrgr Oct 18, 2025
e85e90f
Rollup merge of #146167 - WaffleLapkin:deny-never-ty-lints, r=lcnr,pe…
matthiaskrgr Oct 18, 2025
8f9e2b7
Rollup merge of #146490 - Oneirical:uncountable-integer-12, r=jieyouxu
matthiaskrgr Oct 18, 2025
dd61f6e
Rollup merge of #147438 - reddevilmidzy:rename-non-inline-module-in-m…
matthiaskrgr Oct 18, 2025
92152f3
Rollup merge of #147724 - chenyukang:yukang-fix-139815-ice, r=jdonsze…
matthiaskrgr Oct 18, 2025
5f04bd1
Rollup merge of #147813 - JonathanBrouwer:unused_attributes, r=jdonsz…
matthiaskrgr Oct 18, 2025
441fae3
Rollup merge of #147816 - Kobzol:bootstrap-download-rustc-lto, r=jiey…
matthiaskrgr Oct 18, 2025
c721e50
Rollup merge of #147845 - reddevilmidzy:ice-bug, r=jdonszelmann
matthiaskrgr Oct 18, 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
6 changes: 3 additions & 3 deletions compiler/rustc_expand/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ expand_feature_removed =
.note = removed in {$removed_rustc_version}{$pull_note}
.reason = {$reason}

expand_file_modules_in_proc_macro_input_are_unstable =
file modules in proc macro input are unstable

expand_glob_delegation_outside_impls =
glob delegation is only supported in impls

Expand Down Expand Up @@ -158,9 +161,6 @@ expand_mve_unrecognized_expr =
expand_mve_unrecognized_var =
variable `{$key}` is not recognized in meta-variable expression

expand_non_inline_modules_in_proc_macro_input_are_unstable =
non-inline modules in proc macro input are unstable

expand_or_patterns_back_compat = the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
.suggestion = use pat_param to preserve semantics

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_expand/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
self.sess,
sym::proc_macro_hygiene,
item.span,
fluent_generated::expand_non_inline_modules_in_proc_macro_input_are_unstable,
fluent_generated::expand_file_modules_in_proc_macro_input_are_unstable,
)
.emit();
}
Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_lint/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ declare_lint_pass!(NonShorthandFieldPatterns => [NON_SHORTHAND_FIELD_PATTERNS]);

impl<'tcx> LateLintPass<'tcx> for NonShorthandFieldPatterns {
fn check_pat(&mut self, cx: &LateContext<'_>, pat: &hir::Pat<'_>) {
if let PatKind::Struct(ref qpath, field_pats, _) = pat.kind {
// The result shouldn't be tainted, otherwise it will cause ICE.
if let PatKind::Struct(ref qpath, field_pats, _) = pat.kind
&& cx.typeck_results().tainted_by_errors.is_none()
{
let variant = cx
.typeck_results()
.pat_ty(pat)
Expand Down
6 changes: 2 additions & 4 deletions compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4065,7 +4065,6 @@ declare_lint! {
/// ### Example
///
/// ```rust,compile_fail
/// #![deny(never_type_fallback_flowing_into_unsafe)]
/// fn main() {
/// if true {
/// // return has type `!` which, is some cases, causes never type fallback
Expand Down Expand Up @@ -4100,7 +4099,7 @@ declare_lint! {
/// [`!`]: https://doc.rust-lang.org/core/primitive.never.html
/// [`()`]: https://doc.rust-lang.org/core/primitive.unit.html
pub NEVER_TYPE_FALLBACK_FLOWING_INTO_UNSAFE,
Warn,
Deny,
"never type fallback affecting unsafe function calls",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::EditionAndFutureReleaseSemanticsChange(Edition::Edition2024),
Expand All @@ -4122,7 +4121,6 @@ declare_lint! {
/// ### Example
///
/// ```rust,compile_fail,edition2021
/// #![deny(dependency_on_unit_never_type_fallback)]
/// fn main() {
/// if true {
/// // return has type `!` which, is some cases, causes never type fallback
Expand Down Expand Up @@ -4155,7 +4153,7 @@ declare_lint! {
///
/// See [Tracking Issue for making `!` fall back to `!`](https://github.com/rust-lang/rust/issues/123748).
pub DEPENDENCY_ON_UNIT_NEVER_TYPE_FALLBACK,
Warn,
Deny,
"never type fallback affecting unsafe function calls",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::EditionAndFutureReleaseError(Edition::Edition2024),
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_middle/src/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1202,10 +1202,10 @@ rustc_queries! {
/// Return the live symbols in the crate for dead code check.
///
/// The second return value maps from ADTs to ignored derived traits (e.g. Debug and Clone).
query live_symbols_and_ignored_derived_traits(_: ()) -> &'tcx (
query live_symbols_and_ignored_derived_traits(_: ()) -> &'tcx Result<(
LocalDefIdSet,
LocalDefIdMap<FxIndexSet<DefId>>,
) {
), ErrorGuaranteed> {
arena_cache
desc { "finding live symbols in crate" }
}
Expand Down
24 changes: 17 additions & 7 deletions compiler/rustc_mir_build/src/builder/matches/match_pair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,23 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
) {
let tcx = self.tcx;
let (min_length, exact_size) = if let Some(place_resolved) = place.try_to_place(self) {
match place_resolved.ty(&self.local_decls, tcx).ty.kind() {
ty::Array(_, length) => (
length
.try_to_target_usize(tcx)
.expect("expected len of array pat to be definite"),
true,
),
let place_ty = place_resolved.ty(&self.local_decls, tcx).ty;
match place_ty.kind() {
ty::Array(_, length) => {
if let Some(length) = length.try_to_target_usize(tcx) {
(length, true)
} else {
// This can happen when the array length is a generic const
// expression that couldn't be evaluated (e.g., due to an error).
// Since there's already a compilation error, we use a fallback
// to avoid an ICE.
tcx.dcx().span_delayed_bug(
tcx.def_span(self.def_id),
"array length in pattern couldn't be evaluated",
);
((prefix.len() + suffix.len()).try_into().unwrap(), false)
}
}
_ => ((prefix.len() + suffix.len()).try_into().unwrap(), false),
}
} else {
Expand Down
Loading
Loading