Skip to content

Remove let_chains unstable feature #143214

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

Merged
merged 1 commit into from
Jul 2, 2025

Conversation

camsteffen
Copy link
Contributor

@camsteffen camsteffen commented Jun 29, 2025

Per #53667 (comment) (but then I also noticed #140722)

This replaces the feature gate with a parser error that says let chains require 2024.

A lot of tests were using the unstable feature. I either added edition:2024 to the test or split out the parts that require 2024.

@rustbot
Copy link
Collaborator

rustbot commented Jun 29, 2025

r? @WaffleLapkin

rustbot has assigned @WaffleLapkin.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 29, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 29, 2025

Some changes occurred in coverage tests.

cc @Zalathar

@camsteffen camsteffen force-pushed the remove-let-chains-feature branch from d58ccd4 to bd8ed03 Compare June 29, 2025 20:46
@rust-log-analyzer

This comment has been minimized.

@Kivooeo
Copy link
Contributor

Kivooeo commented Jun 29, 2025

i believe it should not be removed according to this

#132833 (comment)

but may be wrong

@camsteffen camsteffen force-pushed the remove-let-chains-feature branch from bd8ed03 to 3ff44da Compare June 29, 2025 21:01
@camsteffen
Copy link
Contributor Author

@Kivooeo Oh right, this is planned in #140722

I think that would only be a slight modification of this PR.

@rust-log-analyzer

This comment has been minimized.

@camsteffen camsteffen force-pushed the remove-let-chains-feature branch from 3ff44da to d701341 Compare June 29, 2025 21:53
@rust-log-analyzer

This comment has been minimized.

Copy link
Member

@est31 est31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit sad about not being able to test the behaviour of let chains drop order on different editions like done in drop-order-comparisons.rs. But I suppose it's not worth it to keep around an unstable feature just for that.

@est31
Copy link
Member

est31 commented Jun 30, 2025

Thanks for taking this over @camsteffen !

@camsteffen camsteffen force-pushed the remove-let-chains-feature branch from d701341 to dc9879c Compare June 30, 2025 12:49
@rustbot
Copy link
Collaborator

rustbot commented Jun 30, 2025

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

@camsteffen
Copy link
Contributor Author

Addressed comments and fixed a rustfmt test.

I'm a bit sad about not being able to test the behaviour of let chains drop order on different editions like done in drop-order-comparisons.rs. But I suppose it's not worth it to keep around an unstable feature just for that.

Yeah, agreed. It would only be a source of historical record rather than testing actual behavior of rustc.

@est31
Copy link
Member

est31 commented Jun 30, 2025

only be a source of historical record

I did look at those tests when trying to figure out if let chains in match guards can be stabilized on all editions or not. I adapted some of those tests to match guards and they worked on edition 2021. Them failing on edition 2021 for if let chains assured me that the tests are indeed showcasing the edition relevant changes. But I suppose one can always use an older version of the compiler. Or just bring it back in the future.

@est31
Copy link
Member

est31 commented Jun 30, 2025

r? @est31

@rustbot rustbot assigned est31 and unassigned WaffleLapkin Jun 30, 2025
@est31
Copy link
Member

est31 commented Jun 30, 2025

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jun 30, 2025

📌 Commit dc9879c has been approved by est31

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 30, 2025
@est31
Copy link
Member

est31 commented Jun 30, 2025

@bors rollup- for the rustfmt subtree changes. maybe better to have them separate.

@est31
Copy link
Member

est31 commented Jun 30, 2025

@bors rollup=never (meant that one instead)

@bors
Copy link
Collaborator

bors commented Jul 2, 2025

⌛ Testing commit dc9879c with merge 1ce9c97...

@bors
Copy link
Collaborator

bors commented Jul 2, 2025

☀️ Test successful - checks-actions
Approved by: est31
Pushing 1ce9c97 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 2, 2025
@bors bors merged commit 1ce9c97 into rust-lang:master Jul 2, 2025
11 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 2, 2025
Copy link
Contributor

github-actions bot commented Jul 2, 2025

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing b94bd12 (parent) -> 1ce9c97 (this PR)

Test differences

Show 259 test diffs

Stage 1

  • errors::verify_parse_asm_expected_comma_180: [missing] -> pass (J0)
  • errors::verify_parse_asm_expected_string_literal_182: pass -> [missing] (J0)
  • errors::verify_parse_asm_non_abi_182: [missing] -> pass (J0)
  • errors::verify_parse_asm_sym_no_path_177: pass -> [missing] (J0)
  • errors::verify_parse_asm_sym_no_path_178: [missing] -> pass (J0)
  • errors::verify_parse_asm_underscore_input_176: pass -> [missing] (J0)
  • errors::verify_parse_asm_underscore_input_177: [missing] -> pass (J0)
  • errors::verify_parse_at_dot_dot_in_struct_pattern_124: pass -> [missing] (J0)
  • errors::verify_parse_attr_after_generic_140: pass -> [missing] (J0)
  • errors::verify_parse_attr_without_generics_141: pass -> [missing] (J0)
  • errors::verify_parse_bad_assoc_type_bounds_139: pass -> [missing] (J0)
  • errors::verify_parse_bad_item_kind_152: [missing] -> pass (J0)
  • errors::verify_parse_binder_and_polarity_173: pass -> [missing] (J0)
  • errors::verify_parse_binder_and_polarity_174: [missing] -> pass (J0)
  • errors::verify_parse_binder_before_modifiers_172: pass -> [missing] (J0)
  • errors::verify_parse_box_not_pat_157: pass -> [missing] (J0)
  • errors::verify_parse_cannot_be_raw_ident_102: pass -> [missing] (J0)
  • errors::verify_parse_const_global_cannot_be_mutable_87: [missing] -> pass (J0)
  • errors::verify_parse_cr_doc_comment_107: [missing] -> pass (J0)
  • errors::verify_parse_dot_dot_dot_for_remaining_fields_126: pass -> [missing] (J0)
  • errors::verify_parse_dot_dot_dot_range_to_pattern_not_allowed_122: pass -> [missing] (J0)
  • errors::verify_parse_dotdotdot_rest_pattern_115: pass -> [missing] (J0)
  • errors::verify_parse_dyn_after_mut_133: pass -> [missing] (J0)
  • errors::verify_parse_empty_exponent_float_109: pass -> [missing] (J0)
  • errors::verify_parse_enum_pattern_instead_of_identifier_124: [missing] -> pass (J0)
  • errors::verify_parse_expect_label_found_ident_147: pass -> [missing] (J0)
  • errors::verify_parse_expected_binding_left_of_at_118: [missing] -> pass (J0)
  • errors::verify_parse_expr_rarrow_call_169: pass -> [missing] (J0)
  • errors::verify_parse_extern_item_cannot_be_const_85: pass -> [missing] (J0)
  • errors::verify_parse_extra_impl_keyword_in_trait_impl_81: [missing] -> pass (J0)
  • errors::verify_parse_float_literal_unsupported_base_111: [missing] -> pass (J0)
  • errors::verify_parse_fn_pointer_cannot_be_async_135: pass -> [missing] (J0)
  • errors::verify_parse_fn_pointer_cannot_be_const_135: [missing] -> pass (J0)
  • errors::verify_parse_generic_args_in_pat_require_turbofish_syntax_165: pass -> [missing] (J0)
  • errors::verify_parse_generics_in_path_143: pass -> [missing] (J0)
  • errors::verify_parse_inappropriate_default_148: pass -> [missing] (J0)
  • errors::verify_parse_inappropriate_default_149: [missing] -> pass (J0)
  • errors::verify_parse_invalid_attr_unsafe_171: pass -> [missing] (J0)
  • errors::verify_parse_invalid_attr_unsafe_172: [missing] -> pass (J0)
  • errors::verify_parse_invalid_digit_literal_108: pass -> [missing] (J0)
  • errors::verify_parse_invalid_offset_of_167: pass -> [missing] (J0)
  • errors::verify_parse_invalid_path_sep_in_fn_definition_76: pass -> [missing] (J0)
  • errors::verify_parse_keyword_lifetime_104: pass -> [missing] (J0)
  • errors::verify_parse_keyword_lifetime_105: [missing] -> pass (J0)
  • errors::verify_parse_kw_bad_case_160: pass -> [missing] (J0)
  • errors::verify_parse_lifetime_after_mut_132: pass -> [missing] (J0)
  • errors::verify_parse_lifetime_after_mut_133: [missing] -> pass (J0)
  • errors::verify_parse_lifetime_in_eq_constraint_144: pass -> [missing] (J0)
  • errors::verify_parse_macro_invocation_visibility_156: [missing] -> pass (J0)
  • errors::verify_parse_macro_name_remove_bang_153: pass -> [missing] (J0)
  • errors::verify_parse_malformed_cfg_attr_161: pass -> [missing] (J0)
  • errors::verify_parse_missing_const_type_87: pass -> [missing] (J0)
  • errors::verify_parse_missing_trait_in_trait_impl_77: pass -> [missing] (J0)
  • errors::verify_parse_modifiers_and_polarity_174: pass -> [missing] (J0)
  • errors::verify_parse_multiple_where_clauses_98: [missing] -> pass (J0)
  • errors::verify_parse_mut_on_nested_ident_pattern_119: pass -> [missing] (J0)
  • errors::verify_parse_need_plus_after_trait_object_lifetime_130: pass -> [missing] (J0)
  • errors::verify_parse_need_plus_after_trait_object_lifetime_131: [missing] -> pass (J0)
  • errors::verify_parse_nested_adt_156: pass -> [missing] (J0)
  • errors::verify_parse_nested_c_variadic_type_137: [missing] -> pass (J0)
  • errors::verify_parse_no_digits_literal_108: [missing] -> pass (J0)
  • errors::verify_parse_nonterminal_expected_ident_100: pass -> [missing] (J0)
  • errors::verify_parse_nonterminal_expected_ident_101: [missing] -> pass (J0)
  • errors::verify_parse_nonterminal_expected_item_keyword_99: [missing] -> pass (J0)
  • errors::verify_parse_nonterminal_expected_lifetime_101: pass -> [missing] (J0)
  • errors::verify_parse_nonterminal_expected_lifetime_102: [missing] -> pass (J0)
  • errors::verify_parse_nonterminal_expected_statement_99: pass -> [missing] (J0)
  • errors::verify_parse_pattern_on_wrong_side_of_at_116: pass -> [missing] (J0)
  • errors::verify_parse_return_types_use_thin_arrow_129: pass -> [missing] (J0)
  • errors::verify_parse_self_argument_pointer_71: pass -> [missing] (J0)
  • errors::verify_parse_static_with_generics_165: [missing] -> pass (J0)
  • errors::verify_parse_trailing_vert_not_allowed_114: pass -> [missing] (J0)
  • errors::verify_parse_trait_alias_cannot_be_auto_82: pass -> [missing] (J0)
  • errors::verify_parse_underscore_literal_suffix_146: pass -> [missing] (J0)
  • errors::verify_parse_unexpected_expr_in_pat_128: pass -> [missing] (J0)
  • errors::verify_parse_unexpected_token_after_struct_name_found_doc_comment_93: [missing] -> pass (J0)
  • errors::verify_parse_unexpected_token_after_struct_name_found_keyword_90: pass -> [missing] (J0)
  • errors::verify_parse_unexpected_token_after_struct_name_found_other_95: [missing] -> pass (J0)
  • errors::verify_parse_unexpected_token_after_struct_name_found_reserved_identifier_89: pass -> [missing] (J0)
  • errors::verify_parse_unexpected_token_after_struct_name_found_reserved_keyword_91: pass -> [missing] (J0)
  • errors::verify_parse_unexpected_token_after_struct_name_found_reserved_keyword_92: [missing] -> pass (J0)
  • errors::verify_parse_unexpected_vert_vert_before_function_parameter_113: [missing] -> pass (J0)
  • errors::verify_parse_unexpected_vert_vert_in_pattern_113: pass -> [missing] (J0)
  • errors::verify_parse_unknown_builtin_construct_162: pass -> [missing] (J0)
  • errors::verify_parse_unmatched_angle_158: pass -> [missing] (J0)
  • errors::verify_parse_unmatched_angle_159: [missing] -> pass (J0)
  • errors::verify_parse_visibility_not_followed_by_item_73: pass -> [missing] (J0)
  • errors::verify_parse_where_generics_143: [missing] -> pass (J0)
  • [ui] tests/ui/drop/issue-100276.rs#edition2024: pass -> [missing] (J2)
  • [ui] tests/ui/mir/mir_let_chains_drop_order.rs: [missing] -> pass (J2)
  • [ui] tests/ui/mir/mir_let_chains_drop_order.rs#edition2021: pass -> [missing] (J2)
  • [ui] tests/ui/mir/mir_let_chains_drop_order.rs#edition2024: pass -> [missing] (J2)
  • [ui] tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs#e2021: [missing] -> pass (J2)
  • [ui] tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs#e2024: [missing] -> pass (J2)

Stage 2

  • [ui] tests/ui/drop/issue-100276.rs: [missing] -> pass (J1)
  • [ui] tests/ui/mir/mir_let_chains_drop_order.rs: [missing] -> pass (J1)
  • [ui] tests/ui/mir/mir_let_chains_drop_order.rs#edition2024: pass -> [missing] (J1)
  • [ui] tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs#e2021: [missing] -> pass (J1)
  • [ui] tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs#e2024: [missing] -> pass (J1)
  • [ui] tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs#feature: pass -> [missing] (J1)

(and 157 additional test diffs)

Additionally, 2 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 1ce9c977ffcff7c3b12bfe5629a682da0e74a7a1 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. x86_64-apple-1: 7843.5s -> 10223.2s (30.3%)
  2. x86_64-apple-2: 4932.0s -> 5449.5s (10.5%)
  3. dist-powerpc64-linux: 5318.7s -> 4930.5s (-7.3%)
  4. dist-arm-linux-musl: 5083.0s -> 5443.9s (7.1%)
  5. dist-aarch64-linux: 5457.5s -> 5838.9s (7.0%)
  6. dist-x86_64-apple: 8957.6s -> 8339.1s (-6.9%)
  7. aarch64-apple: 5011.4s -> 4683.3s (-6.5%)
  8. i686-gnu-1: 8606.9s -> 8058.8s (-6.4%)
  9. dist-arm-linux-gnueabi: 4881.7s -> 4575.7s (-6.3%)
  10. x86_64-msvc-ext2: 5386.3s -> 5666.1s (5.2%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@camsteffen camsteffen deleted the remove-let-chains-feature branch July 2, 2025 22:22
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1ce9c97): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary 3.0%, secondary 2.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.0% [3.0%, 3.0%] 1
Regressions ❌
(secondary)
2.2% [0.7%, 3.6%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.0% [3.0%, 3.0%] 1

Cycles

Results (primary -1.1%, secondary -0.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.9% [1.9%, 1.9%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.7% [-2.2%, -1.1%] 5
Improvements ✅
(secondary)
-0.6% [-0.7%, -0.5%] 2
All ❌✅ (primary) -1.1% [-2.2%, 1.9%] 6

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 462.452s -> 460.331s (-0.46%)
Artifact size: 372.20 MiB -> 372.27 MiB (0.02%)

tautschnig added a commit to tautschnig/kani that referenced this pull request Jul 3, 2025
Upstream change rust-lang/rust#143214 (Remove
let_chains unstable feature) requires us to either remove the use of
`let` in several places or wholesale update to Rust edition 2024. Doing
this edition update seems worthwhile to keep accessing more recent
features, but required code changes in several places.

Resolves: model-checking#4196
github-merge-queue bot pushed a commit to model-checking/kani that referenced this pull request Jul 4, 2025
Upstream change rust-lang/rust#143214 (Remove
let_chains unstable feature) requires us to either remove the use of
`let` in several places or wholesale update to Rust edition 2024. Doing
this edition update seems worthwhile to keep accessing more recent
features, but required code changes in several places.

This is in preparation of the toolchain upgrade to 2025-07-03, but does
not actually do this upgrade for it will require other, unrelated
changes.

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.

---------

Co-authored-by: Carolyn Zech <[email protected]>
tautschnig added a commit to tautschnig/kani that referenced this pull request Jul 4, 2025
Relevant upstream PRs:
- rust-lang/rust#143214 (Remove let_chains
  unstable feature)
- rust-lang/rust#143036 (Remove support for
  `dyn*` from the compiler)

The latter was tracked as an unsupported feature in Kani, whereby we can
resolve one of our own issues as well.

Resolves: model-checking#4196
Resolves: model-checking#1784
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants