Skip to content

fix drop scope for super let bindings within if let #145342

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dianne
Copy link
Contributor

@dianne dianne commented Aug 13, 2025

Fixes #145328 by making non-lifetime-extended super let reuse the logic used to compute drop scopes for non-lifetime-extended temporaries.

Also fixes #145374, which regressed due to #143376 introducing if let-like scopes for match arms with guards.

Tracking issue for super let: #139076

This is a regression fix / breaking change for macros stably exposing super let, including pin! and format_args!.
Nominating to be discussed alongside #145328: @rustbot label +I-lang-nominated +I-libs-api-nominated

dianne added 2 commits August 13, 2025 01:38
They now use the enclosing temporary scope as their scope, regardless of
which `ScopeData` was used to mark it.
@rustbot
Copy link
Collaborator

rustbot commented Aug 13, 2025

r? @jackh726

rustbot has assigned @jackh726.
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. I-lang-nominated Nominated for discussion during a lang team meeting. I-libs-api-nominated Nominated for discussion during a libs-api team meeting. labels Aug 13, 2025
@traviscross traviscross added P-lang-drag-1 Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang P-lang-drag-0 Lang team prioritization drag level 0.https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang. and removed P-lang-drag-1 Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang labels Aug 13, 2025
@compiler-errors
Copy link
Member

@dianne does this need crater?

@traviscross
Copy link
Contributor

traviscross commented Aug 13, 2025

@bors2 try

@craterbot

This comment was marked as resolved.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Aug 13, 2025
fix drop scope for `super let` bindings within `if let`
@rust-bors
Copy link

rust-bors bot commented Aug 13, 2025

☀️ Try build successful (CI)
Build commit: a498031 (a4980311fb7bb9e7893708e6bd3fbbfb2819fd3d, parent: 350d0ef0ec0493e6d21cfb265cb8211a0e74d766)

@compiler-errors
Copy link
Member

@craterbot check

@craterbot
Copy link
Collaborator

👌 Experiment pr-145342 created and queued.
🤖 Automatically detected try build a498031
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 13, 2025
@rustbot rustbot added the stable-nominated Nominated for backporting to the compiler in the stable channel. label Aug 14, 2025
@compiler-errors compiler-errors added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Aug 14, 2025
@theemathas
Copy link
Contributor

How does #145374 relate to this? The code there doesn't use super let anywhere.

@dianne
Copy link
Contributor Author

dianne commented Aug 14, 2025

Format arguments, e.g. as used by write!, are also implemented in terms of super let. This is visible when printing the HIR of that test case:

f.write_fmt({
        super let args =
            (&pointee.behind_pointer(),
                &ItemIdentifier::path(&ItemIdentifier::nserror()));
        super let args =
            [format_argument::new_display(args.0),
                    format_argument::new_display(args.1)];
        format_arguments::new_v1(&["", ", "], &args)
    })

The interaction between that, old editions not treating block tail expressions as temporary drop scopes, my guard scoping PR, and the existing super let scoping bug is what caused that particular regression.

@traviscross traviscross added T-lang Relevant to the language team I-lang-radar Items that are on lang's radar and will need eventual work or consideration. and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 14, 2025
@traviscross
Copy link
Contributor

We talked about this in the lang call today. For our notes, here's how I'd demonstrate the issue:

fn main() {
    assert_drop_order(1..=4, |e| {
        (
            if let _x = e.log(3)
                && let _x = &e.log(2)
            {
                drop(e.log(1))
            },
            { drop(e.log(4)) },
        );
    });
    assert_drop_order(1..=4, |e| {
        (
            if let _x = e.log(2)
                && let _x = { super let x = &e.log(4); x }
            {
                drop(e.log(1))
            },
            { drop(e.log(3)) },
        );
    });
}

Playground link

In the call, we discussed what we'd expect the behavior to be for super let. Recalling the basic equivalence underlying this work, we expect that &EXPR === { super let x = &EXPR; x }. Given that, the discrepancy in drop order above is clearly not justifiable.

Everyone on the call agreed with that analysis, so let's agree via FCP 1) to accept this and 2) to waive our 10-day FCP period so we can hopefully get this into the point release that we need to cut anyway due to #145262.

@rfcbot fcp merge

Note that the crater results aren't back yet. We can file a concern if anything surprises us enough to change the plan here. That however seems unlikely.

@rfcbot
Copy link
Collaborator

rfcbot commented Aug 14, 2025

Team member @traviscross has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns.
See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Aug 14, 2025
@traviscross traviscross added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Aug 14, 2025
@wesleywiser
Copy link
Member

wesleywiser commented Aug 14, 2025

This proposed stable backport was discussed in the T-compiler steering meeting today and there was a fair amount of concern about backporting this to stable for a few reasons:

  1. Changes to drop order are subtle and having more time for the fix to be validated "in the wild" is helpful
  2. The regression occurred in 1.88 so we've already shipped a full release cycle with the issue, delaying a few more weeks in the case of a beta backport typically does not make these kinds of situations worse
  3. (perhaps just a restatement of point 1) but we really would like to see backports have some bake time on nightly

This is not a definitive "backport declined" but we thought it could be useful to T-lang to know our current position on backporting this.

@tmandry
Copy link
Member

tmandry commented Aug 14, 2025

@rfcbot reviewed

I would defer to T-compiler on the stable backport risk. I would encourage a beta backport however.

I do not think we are likely to see much impact in the wild since this can only be observed via pin!() and format_args!() macros inside of if let, and neither of those macros produce something you would match on. The most likely scenario by far would be if let Pat = pin!(expr).method() where part of expr is sensitive to drop order. Those are both pretty rare. see #145342 (comment)

However, the consequences of any impact that does exist can be large (especially if the change doesn't cause any compilation errors and leads to runtime bugs), and changing this kind of subtle behavior is ungreat, so it would be good to minimize the window this bug exists in.

Many thanks to @theemathas for finding this bug and to @dianne for the fix.

@theemathas
Copy link
Contributor

theemathas commented Aug 14, 2025

this can only be observed via...

@tmandry There is a second way that this bug can be observed: format_args! inside match in an old edition when the arm has an if guard. See #145374.

@dianne
Copy link
Contributor Author

dianne commented Aug 14, 2025

That's only on nightly though1, since it requires #143376; landing this before the beta cutoff for 1.91.0 (or beta-backporting it after) should be sufficient to fix that. The regression visible in stable Rust is only with if let.

Footnotes

  1. and I think could also be reproduced in Rust 2024 by not wrapping the match arm in a block

@theemathas
Copy link
Contributor

theemathas commented Aug 14, 2025

neither of those macros produce something you would match on

@tmandry write!() does produce a Result. There is a lot of code of the form if let Err(e) = write!(....). I don't know if any of them is affected.

@tmandry
Copy link
Member

tmandry commented Aug 15, 2025

Hmm, I had missed the point about write!. In that case impact is more likely.

I can't tell if check mode is best for this crater run, since some issues can manifest at runtime. I expect that test takes quite a bit longer though.

@craterbot
Copy link
Collaborator

🚧 Experiment pr-145342 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@theemathas
Copy link
Contributor

theemathas commented Aug 15, 2025

I am unable to find a stable-to-stable regression that involves format_args!(). Is it actually affected or not?

Sorry for the confusion.

@dianne
Copy link
Contributor Author

dianne commented Aug 15, 2025

format_args! is affected, yes. #145374 can be modified to use let chains to get a 1.88-to-1.89 regression in Rust 2024, which is fixed by this PR. I can try reducing it if needed for a test, but change the definition of foo in that issue's example to

fn foo(ty: &Ty, f: &mut fmt::Formatter<'_>) {
    if let Ty { pointee } = ty
        && let _ = write!(
            f,
            "{}, {}",
            pointee.behind_pointer(),
            ItemIdentifier::path(&ItemIdentifier::nserror()),
        )
    {}
}

@theemathas
Copy link
Contributor

theemathas commented Aug 15, 2025

@dianne A 1.88-to-1.89 regression? I thought we only had a 1.87-to-1.88 regression, and a 1.89-to-nightly regression (and a newly stabilized feature in 1.88 which is handled wrong).

Edit: Ah, format_args!() started using super let in 1.89.0 (#140748). That makes sense.

@theemathas
Copy link
Contributor

theemathas commented Aug 15, 2025

Edit: This is a different bug.

Minimization of the 1.88-to-1.89 regression (all editions):

#[derive(Debug)]
struct Thing;

#[derive(Debug)]
struct Ref<'a>(&'a Thing);
impl Drop for Ref<'_> {
    fn drop(&mut self) {}
}

fn new_thing() -> Thing {
    Thing
}

fn new_ref(x: &Thing) -> Ref<'_> {
    Ref(x)
}

pub fn foo() {
    let _x = format_args!("{:?}, {:?}", 1, new_ref(&new_thing()));
}

The above code compiles in 1.88.0. It produces a compile error in 1.89.0.

Notably, this does not use if-let. I don't understand what's happening here.

@dianne
Copy link
Contributor Author

dianne commented Aug 15, 2025

Oh nice, I think that's a different bug! Lifetime extension is happening there. Here's the pretty-printed HIR:

fn foo() {
    let _x =
        {
            super let args = (&1, &new_ref(&new_thing()));
            super let args =
                [format_argument::new_debug(args.0),
                        format_argument::new_debug(args.1)];
            format_arguments::new_v1(&["", ", "], &args)
        };
}

Unlike with write!, which doesn't put the super lets in a position where they can be lifetime-extended, these super lets are extended by the outer let, which ends up tangling up the drop order (I assume the tangled drop order is a bug).

This PR only changes non-lifetime-extended super let, so that regression is unaffected.

@theemathas
Copy link
Contributor

Here's the minimization of the 1.88-to-1.89 regression which is fixed by this PR:

#[derive(Debug)]
struct Thing;

#[derive(Debug)]
struct Ref<'a>(&'a Thing);
impl Drop for Ref<'_> {
    fn drop(&mut self) {}
}

fn new_thing() -> Thing {
    Thing
}

fn new_ref(x: &Thing) -> Ref<'_> {
    Ref(x)
}

pub fn foo(f: &mut std::fmt::Formatter<'_>) {
    if let _x = write!(f, "{:?}, {:?}", 1, new_ref(&new_thing())) {}
}

I am filing the other bug as a separate issue.

@theemathas
Copy link
Contributor

theemathas commented Aug 15, 2025

This code causes this PR to ICE in the dropping_copy_types lint:

pub fn foo() {
    drop(format_args!("a"));
}
Error output
thread 'rustc' panicked at /Users/timch/rust/compiler/rustc_errors/src/diagnostic.rs:960:9:
assertion `left == right` failed: Span must not be empty and have no suggestion
  left: Some(SubstitutionPart { span: src/lib.rs:2:27: 2:27 (#4), snippet: "" })
 right: None
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panicking.rs:697:5
   1: core::panicking::panic_fmt
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/core/src/panicking.rs:75:14
   2: core::panicking::assert_failed_inner
   3: assert_failed<core::option::Option<&rustc_errors::SubstitutionPart>, core::option::Option<&rustc_errors::SubstitutionPart>>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/core/src/panicking.rs:403:5
   4: multipart_suggestion_with_style<(), rustc_error_messages::SubdiagMessage>
             at /Users/timch/rust/compiler/rustc_errors/src/diagnostic.rs:960:9
   5: add_to_diag<()>
             at /Users/timch/rust/compiler/rustc_lint/src/lints.rs:691:10
   6: subdiagnostic<(), rustc_lint::lints::UseLetUnderscoreIgnoreSuggestion>
             at /Users/timch/rust/compiler/rustc_errors/src/diagnostic.rs:1251:23
   7: decorate_lint
             at /Users/timch/rust/compiler/rustc_lint/src/lints.rs:719:10
   8: {closure#0}<rustc_lint::context::LateContext, rustc_span::span_encoding::Span, rustc_lint::lints::DropCopyDiag>
             at /Users/timch/rust/compiler/rustc_lint/src/context.rs:524:23
   9: call_once<rustc_lint::context::LintContext::emit_span_lint::{closure_env#0}<rustc_lint::context::LateContext, rustc_span::span_encoding::Span, rustc_lint::lints::DropCopyDiag>, (&mut rustc_errors::diagnostic::Diag<()>)>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/core/src/ops/function.rs:253:5
  10: call_once<(&mut rustc_errors::diagnostic::Diag<()>), dyn core::ops::function::FnOnce<(&mut rustc_errors::diagnostic::Diag<()>), Output=()>, alloc::alloc::Global>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/alloc/src/boxed.rs:1971:9
  11: lint_level_impl
             at /Users/timch/rust/compiler/rustc_middle/src/lint.rs:427:13
  12: lint_level<rustc_lint::context::LintContext::emit_span_lint::{closure_env#0}<rustc_lint::context::LateContext, rustc_span::span_encoding::Span, rustc_lint::lints::DropCopyDiag>>
             at /Users/timch/rust/compiler/rustc_middle/src/lint.rs:433:5
  13: node_span_lint<rustc_span::span_encoding::Span, rustc_lint::context::LintContext::emit_span_lint::{closure_env#0}<rustc_lint::context::LateContext, rustc_span::span_encoding::Span, rustc_lint::lints::DropCopyDiag>>
             at /Users/timch/rust/compiler/rustc_middle/src/ty/context.rs:3177:9
  14: opt_span_lint<rustc_span::span_encoding::Span, rustc_lint::context::LintContext::emit_span_lint::{closure_env#0}<rustc_lint::context::LateContext, rustc_span::span_encoding::Span, rustc_lint::lints::DropCopyDiag>>
             at /Users/timch/rust/compiler/rustc_lint/src/context.rs:637:33
  15: emit_span_lint<rustc_lint::context::LateContext, rustc_span::span_encoding::Span, rustc_lint::lints::DropCopyDiag>
             at /Users/timch/rust/compiler/rustc_lint/src/context.rs:523:14
  16: check_expr
             at /Users/timch/rust/compiler/rustc_lint/src/drop_forget_useless.rs:184:24
  17: check_expr
             at /Users/timch/rust/compiler/rustc_lint/src/passes.rs:79:23
  18: {closure#0}<rustc_lint::BuiltinCombinedModuleLateLintPass>
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:33:14
  19: with_lint_attrs<rustc_lint::BuiltinCombinedModuleLateLintPass, rustc_lint::late::{impl#1}::visit_expr::{closure#0}::{closure_env#0}<rustc_lint::BuiltinCombinedModuleLateLintPass>>
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:59:9
  20: {closure#0}<rustc_lint::BuiltinCombinedModuleLateLintPass>
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:165:18
  21: maybe_grow<(), rustc_lint::late::{impl#1}::visit_expr::{closure_env#0}<rustc_lint::BuiltinCombinedModuleLateLintPass>>
             at /Users/timch/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/stacker-0.1.21/src/lib.rs:57:9
  22: ensure_sufficient_stack<(), rustc_lint::late::{impl#1}::visit_expr::{closure_env#0}<rustc_lint::BuiltinCombinedModuleLateLintPass>>
             at /Users/timch/rust/compiler/rustc_data_structures/src/stack.rs:21:5
  23: visit_expr<rustc_lint::BuiltinCombinedModuleLateLintPass>
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:164:9
  24: visit_stmt<rustc_lint::BuiltinCombinedModuleLateLintPass>
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:179:9
  25: walk_block<rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass>>
             at /Users/timch/rust/compiler/rustc_hir/src/intravisit.rs:694:5
  26: visit_block<rustc_lint::BuiltinCombinedModuleLateLintPass>
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:240:9
  27: walk_expr<rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass>>
  28: {closure#0}<rustc_lint::BuiltinCombinedModuleLateLintPass>
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:167:17
  29: with_lint_attrs<rustc_lint::BuiltinCombinedModuleLateLintPass, rustc_lint::late::{impl#1}::visit_expr::{closure#0}::{closure_env#0}<rustc_lint::BuiltinCombinedModuleLateLintPass>>
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:59:9
  30: {closure#0}<rustc_lint::BuiltinCombinedModuleLateLintPass>
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:165:18
  31: maybe_grow<(), rustc_lint::late::{impl#1}::visit_expr::{closure_env#0}<rustc_lint::BuiltinCombinedModuleLateLintPass>>
             at /Users/timch/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/stacker-0.1.21/src/lib.rs:57:9
  32: ensure_sufficient_stack<(), rustc_lint::late::{impl#1}::visit_expr::{closure_env#0}<rustc_lint::BuiltinCombinedModuleLateLintPass>>
             at /Users/timch/rust/compiler/rustc_data_structures/src/stack.rs:21:5
  33: visit_expr<rustc_lint::BuiltinCombinedModuleLateLintPass>
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:164:9
  34: visit_body<rustc_lint::BuiltinCombinedModuleLateLintPass>
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:120:9
  35: visit_nested_body<rustc_lint::BuiltinCombinedModuleLateLintPass>
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:103:14
  36: visit_fn<rustc_lint::BuiltinCombinedModuleLateLintPass>
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:196:9
  37: walk_item<rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass>>
             at /Users/timch/rust/compiler/rustc_hir/src/intravisit.rs:558:32
  38: {closure#0}<rustc_lint::BuiltinCombinedModuleLateLintPass>
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:132:17
  39: with_param_env<rustc_lint::BuiltinCombinedModuleLateLintPass, rustc_lint::late::{impl#1}::visit_item::{closure#0}::{closure_env#0}<rustc_lint::BuiltinCombinedModuleLateLintPass>>
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:71:9
  40: {closure#0}<rustc_lint::BuiltinCombinedModuleLateLintPass>
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:130:16
  41: with_lint_attrs<rustc_lint::BuiltinCombinedModuleLateLintPass, rustc_lint::late::{impl#1}::visit_item::{closure_env#0}<rustc_lint::BuiltinCombinedModuleLateLintPass>>
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:59:9
  42: visit_item<rustc_lint::BuiltinCombinedModuleLateLintPass>
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:129:14
  43: visit_nested_item<rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass>>
             at /Users/timch/rust/compiler/rustc_hir/src/intravisit.rs:249:29
  44: walk_mod<rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass>>
             at /Users/timch/rust/compiler/rustc_hir/src/intravisit.rs:650:5
  45: process_mod<rustc_lint::BuiltinCombinedModuleLateLintPass>
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:77:9
  46: {closure#0}<rustc_lint::BuiltinCombinedModuleLateLintPass>
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:399:12
  47: with_lint_attrs<rustc_lint::BuiltinCombinedModuleLateLintPass, rustc_lint::late::late_lint_mod_inner::{closure_env#0}<rustc_lint::BuiltinCombinedModuleLateLintPass>>
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:59:9
  48: late_lint_mod_inner<rustc_lint::BuiltinCombinedModuleLateLintPass>
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:393:8
  49: late_lint_mod<rustc_lint::BuiltinCombinedModuleLateLintPass>
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:367:13
  50: lint_mod
             at /Users/timch/rust/compiler/rustc_lint/src/lib.rs:151:5
  51: {closure#0}
             at /Users/timch/rust/compiler/rustc_query_impl/src/plumbing.rs:294:9
      [... omitted 33 frames ...]
  52: query_ensure<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalModDefId, rustc_middle::query::erase::Erased<[u8; 0]>>>
             at /Users/timch/rust/compiler/rustc_middle/src/query/plumbing.rs:198:9
  53: lint_mod
             at /Users/timch/rust/compiler/rustc_middle/src/query/plumbing.rs:233:9
  54: {closure#0}
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:474:70
  55: {closure#0}<rustc_lint::late::check_crate::{closure#1}::{closure#0}::{closure_env#0}>
             at /Users/timch/rust/compiler/rustc_middle/src/hir/map.rs:476:13
  56: {closure#0}<&rustc_hir::hir_id::OwnerId, &[rustc_hir::hir_id::OwnerId], rustc_middle::hir::map::{impl#3}::par_hir_for_each_module::{closure_env#0}<rustc_lint::late::check_crate::{closure#1}::{closure#0}::{closure_env#0}>>
             at /Users/timch/rust/compiler/rustc_data_structures/src/sync/parallel.rs:181:30
  57: call_once<(), rustc_data_structures::sync::parallel::par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&rustc_hir::hir_id::OwnerId, &[rustc_hir::hir_id::OwnerId], rustc_middle::hir::map::{impl#3}::par_hir_for_each_module::{closure_env#0}<rustc_lint::late::check_crate::{closure#1}::{closure#0}::{closure_env#0}>>>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/core/src/panic/unwind_safe.rs:272:9
  58: do_call<core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::parallel::par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&rustc_hir::hir_id::OwnerId, &[rustc_hir::hir_id::OwnerId], rustc_middle::hir::map::{impl#3}::par_hir_for_each_module::{closure_env#0}<rustc_lint::late::check_crate::{closure#1}::{closure#0}::{closure_env#0}>>>, ()>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panicking.rs:589:40
  59: catch_unwind<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::parallel::par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&rustc_hir::hir_id::OwnerId, &[rustc_hir::hir_id::OwnerId], rustc_middle::hir::map::{impl#3}::par_hir_for_each_module::{closure_env#0}<rustc_lint::late::check_crate::{closure#1}::{closure#0}::{closure_env#0}>>>>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panicking.rs:552:19
  60: catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::parallel::par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&rustc_hir::hir_id::OwnerId, &[rustc_hir::hir_id::OwnerId], rustc_middle::hir::map::{impl#3}::par_hir_for_each_module::{closure_env#0}<rustc_lint::late::check_crate::{closure#1}::{closure#0}::{closure_env#0}>>>, ()>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panic.rs:359:14
  61: run<(), rustc_data_structures::sync::parallel::par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&rustc_hir::hir_id::OwnerId, &[rustc_hir::hir_id::OwnerId], rustc_middle::hir::map::{impl#3}::par_hir_for_each_module::{closure_env#0}<rustc_lint::late::check_crate::{closure#1}::{closure#0}::{closure_env#0}>>>
             at /Users/timch/rust/compiler/rustc_data_structures/src/sync/parallel.rs:23:9
  62: {closure#1}<&rustc_hir::hir_id::OwnerId, &[rustc_hir::hir_id::OwnerId], rustc_middle::hir::map::{impl#3}::par_hir_for_each_module::{closure_env#0}<rustc_lint::late::check_crate::{closure#1}::{closure#0}::{closure_env#0}>>
             at /Users/timch/rust/compiler/rustc_data_structures/src/sync/parallel.rs:181:23
  63: for_each<rustc_hir::hir_id::OwnerId, rustc_data_structures::sync::parallel::par_for_each_in::{closure#0}::{closure_env#1}<&rustc_hir::hir_id::OwnerId, &[rustc_hir::hir_id::OwnerId], rustc_middle::hir::map::{impl#3}::par_hir_for_each_module::{closure_env#0}<rustc_lint::late::check_crate::{closure#1}::{closure#0}::{closure_env#0}>>>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/core/src/slice/iter/macros.rs:277:21
  64: {closure#0}<&rustc_hir::hir_id::OwnerId, &[rustc_hir::hir_id::OwnerId], rustc_middle::hir::map::{impl#3}::par_hir_for_each_module::{closure_env#0}<rustc_lint::late::check_crate::{closure#1}::{closure#0}::{closure_env#0}>>
             at /Users/timch/rust/compiler/rustc_data_structures/src/sync/parallel.rs:180:27
  65: parallel_guard<(), rustc_data_structures::sync::parallel::par_for_each_in::{closure_env#0}<&rustc_hir::hir_id::OwnerId, &[rustc_hir::hir_id::OwnerId], rustc_middle::hir::map::{impl#3}::par_hir_for_each_module::{closure_env#0}<rustc_lint::late::check_crate::{closure#1}::{closure#0}::{closure_env#0}>>>
             at /Users/timch/rust/compiler/rustc_data_structures/src/sync/parallel.rs:39:15
  66: par_for_each_in<&rustc_hir::hir_id::OwnerId, &[rustc_hir::hir_id::OwnerId], rustc_middle::hir::map::{impl#3}::par_hir_for_each_module::{closure_env#0}<rustc_lint::late::check_crate::{closure#1}::{closure#0}::{closure_env#0}>>
             at /Users/timch/rust/compiler/rustc_data_structures/src/sync/parallel.rs:175:5
  67: par_hir_for_each_module<rustc_lint::late::check_crate::{closure#1}::{closure#0}::{closure_env#0}>
             at /Users/timch/rust/compiler/rustc_middle/src/hir/map.rs:475:9
  68: {closure#0}
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:474:21
  69: run<(), rustc_lint::late::check_crate::{closure#1}::{closure_env#0}>
             at /Users/timch/rust/compiler/rustc_data_structures/src/profiling.rs:844:9
  70: time<(), rustc_lint::late::check_crate::{closure#1}::{closure_env#0}>
             at /Users/timch/rust/compiler/rustc_session/src/utils.rs:16:50
  71: {closure#1}
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:472:22
  72: call_once<(), rustc_lint::late::check_crate::{closure_env#1}>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/core/src/panic/unwind_safe.rs:272:9
  73: do_call<core::panic::unwind_safe::AssertUnwindSafe<rustc_lint::late::check_crate::{closure_env#1}>, ()>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panicking.rs:589:40
  74: catch_unwind<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_lint::late::check_crate::{closure_env#1}>>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panicking.rs:552:19
  75: catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<rustc_lint::late::check_crate::{closure_env#1}>, ()>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panic.rs:359:14
  76: run<(), rustc_lint::late::check_crate::{closure_env#1}>
             at /Users/timch/rust/compiler/rustc_data_structures/src/sync/parallel.rs:23:9
  77: {closure#0}<rustc_lint::late::check_crate::{closure_env#0}, rustc_lint::late::check_crate::{closure_env#1}, (), ()>
             at /Users/timch/rust/compiler/rustc_data_structures/src/sync/parallel.rs:53:23
  78: parallel_guard<(core::option::Option<()>, core::option::Option<()>), rustc_data_structures::sync::parallel::serial_join::{closure_env#0}<rustc_lint::late::check_crate::{closure_env#0}, rustc_lint::late::check_crate::{closure_env#1}, (), ()>>
             at /Users/timch/rust/compiler/rustc_data_structures/src/sync/parallel.rs:39:15
  79: serial_join<rustc_lint::late::check_crate::{closure_env#0}, rustc_lint::late::check_crate::{closure_env#1}, (), ()>
             at /Users/timch/rust/compiler/rustc_data_structures/src/sync/parallel.rs:51:18
  80: join<rustc_lint::late::check_crate::{closure_env#0}, rustc_lint::late::check_crate::{closure_env#1}, (), ()>
             at /Users/timch/rust/compiler/rustc_data_structures/src/sync/parallel.rs:132:9
  81: check_crate
             at /Users/timch/rust/compiler/rustc_lint/src/late.rs:464:5
  82: {closure#0}
             at /Users/timch/rust/compiler/rustc_interface/src/passes.rs:1165:29
  83: run<(), rustc_interface::passes::analysis::{closure#0}::{closure#2}::{closure#0}::{closure#2}::{closure#1}::{closure#0}::{closure#2}::{closure_env#0}>
             at /Users/timch/rust/compiler/rustc_data_structures/src/profiling.rs:844:9
  84: time<(), rustc_interface::passes::analysis::{closure#0}::{closure#2}::{closure#0}::{closure#2}::{closure#1}::{closure#0}::{closure#2}::{closure_env#0}>
             at /Users/timch/rust/compiler/rustc_session/src/utils.rs:16:50
  85: {closure#2}
             at /Users/timch/rust/compiler/rustc_interface/src/passes.rs:1164:30
  86: call_once<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#0}::{closure_env#2}>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/core/src/panic/unwind_safe.rs:272:9
  87: do_call<core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#0}::{closure_env#2}>, ()>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panicking.rs:589:40
  88: catch_unwind<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#0}::{closure_env#2}>>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panicking.rs:552:19
  89: catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#0}::{closure_env#2}>, ()>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panic.rs:359:14
  90: run<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#0}::{closure_env#2}>
             at /Users/timch/rust/compiler/rustc_data_structures/src/sync/parallel.rs:23:9
  91: {closure#0}
             at /Users/timch/rust/compiler/rustc_data_structures/src/sync/parallel.rs:88:29
  92: parallel_guard<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure_env#0}>
             at /Users/timch/rust/compiler/rustc_data_structures/src/sync/parallel.rs:39:15
  93: {closure#0}
             at /Users/timch/rust/compiler/rustc_interface/src/passes.rs:1152:17
  94: call_once<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure_env#0}>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/core/src/panic/unwind_safe.rs:272:9
  95: do_call<core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure_env#0}>, ()>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panicking.rs:589:40
  96: catch_unwind<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure_env#0}>>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panicking.rs:552:19
  97: catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure_env#0}>, ()>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panic.rs:359:14
  98: run<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure_env#0}>
             at /Users/timch/rust/compiler/rustc_data_structures/src/sync/parallel.rs:23:9
  99: {closure#1}
             at /Users/timch/rust/compiler/rustc_data_structures/src/sync/parallel.rs:87:27
 100: parallel_guard<(), rustc_interface::passes::analysis::{closure#0}::{closure_env#1}>
             at /Users/timch/rust/compiler/rustc_data_structures/src/sync/parallel.rs:39:15
 101: {closure#0}
             at /Users/timch/rust/compiler/rustc_interface/src/passes.rs:1148:9
 102: run<(), rustc_interface::passes::analysis::{closure_env#0}>
             at /Users/timch/rust/compiler/rustc_data_structures/src/profiling.rs:844:9
 103: time<(), rustc_interface::passes::analysis::{closure_env#0}>
             at /Users/timch/rust/compiler/rustc_session/src/utils.rs:16:50
 104: analysis
             at /Users/timch/rust/compiler/rustc_interface/src/passes.rs:1147:10
 105: {closure#0}
             at /Users/timch/rust/compiler/rustc_query_impl/src/plumbing.rs:294:9
      [... omitted 33 frames ...]
 106: query_ensure<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>>
             at /Users/timch/rust/compiler/rustc_middle/src/query/plumbing.rs:198:9
 107: analysis
             at /Users/timch/rust/compiler/rustc_middle/src/query/plumbing.rs:233:9
 108: {closure#2}
             at /Users/timch/rust/compiler/rustc_driver_impl/src/lib.rs:370:29
 109: {closure#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>
             at /Users/timch/rust/compiler/rustc_interface/src/passes.rs:1006:27
 110: {closure#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>
             at /Users/timch/rust/compiler/rustc_middle/src/ty/context.rs:1546:37
 111: {closure#0}<rustc_middle::ty::context::{impl#21}::enter::{closure_env#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
             at /Users/timch/rust/compiler/rustc_middle/src/ty/context/tls.rs:60:9
 112: try_with<core::cell::Cell<*const ()>, rustc_middle::ty::context::tls::enter_context::{closure_env#0}<rustc_middle::ty::context::{impl#21}::enter::{closure_env#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/thread/local.rs:315:12
 113: with<core::cell::Cell<*const ()>, rustc_middle::ty::context::tls::enter_context::{closure_env#0}<rustc_middle::ty::context::{impl#21}::enter::{closure_env#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/thread/local.rs:279:20
 114: enter_context<rustc_middle::ty::context::{impl#21}::enter::{closure_env#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
             at /Users/timch/rust/compiler/rustc_middle/src/ty/context/tls.rs:57:9
 115: enter<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>
             at /Users/timch/rust/compiler/rustc_middle/src/ty/context.rs:1546:9
 116: create_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>>
             at /Users/timch/rust/compiler/rustc_middle/src/ty/context.rs:1751:13
 117: {closure#2}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>
             at /Users/timch/rust/compiler/rustc_interface/src/passes.rs:973:9
 118: call_once<rustc_interface::passes::create_and_enter_global_ctxt::{closure_env#2}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, (&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy, alloc::alloc::Global>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2})>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/core/src/ops/function.rs:253:5
 119: call_once<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy, alloc::alloc::Global>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}), dyn core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy, alloc::alloc::Global>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}), Output=core::option::Option<rustc_interface::queries::Linker>>, alloc::alloc::Global>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/alloc/src/boxed.rs:1971:9
 120: create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>
             at /Users/timch/rust/compiler/rustc_interface/src/passes.rs:1014:5
 121: {closure#0}
             at /Users/timch/rust/compiler/rustc_driver_impl/src/lib.rs:343:22
 122: {closure#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>
             at /Users/timch/rust/compiler/rustc_interface/src/interface.rs:525:80
 123: call_once<(), rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/core/src/panic/unwind_safe.rs:272:9
 124: do_call<core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>, ()>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panicking.rs:589:40
 125: catch_unwind<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panicking.rs:552:19
 126: catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>, ()>
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panic.rs:359:14
 127: {closure#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>
             at /Users/timch/rust/compiler/rustc_interface/src/interface.rs:525:23
 128: {closure#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>
             at /Users/timch/rust/compiler/rustc_interface/src/util.rs:199:17
 129: {closure#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>
             at /Users/timch/rust/compiler/rustc_interface/src/util.rs:153:24
 130: set<rustc_span::SessionGlobals, rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure#0}::{closure_env#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>, ()>
             at /Users/timch/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/scoped-tls-1.0.1/src/lib.rs:137:9
 131: create_session_globals_then<(), rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure#0}::{closure_env#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>>
             at /Users/timch/rust/compiler/rustc_span/src/lib.rs:146:21
 132: {closure#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>
             at /Users/timch/rust/compiler/rustc_interface/src/util.rs:149:17
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: please attach the file at `/Users/timch/foo/rustc-ice-2025-08-15T06_05_34-7312.txt` to your bug report

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C incremental=[REDACTED]

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [lint_mod] linting top-level module
#1 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `foo` (lib)

Caused by:
  process didn't exit successfully: `/Users/timch/.rustup/toolchains/stage1/bin/rustc --crate-name foo --edition=2024 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=72 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=8c501619d3290ba0 -C extra-filename=-24fb7592114348d8 --out-dir /Users/timch/foo/target/debug/deps -C incremental=/Users/timch/foo/target/debug/incremental -L dependency=/Users/timch/foo/target/debug/deps` (exit status: 101)

@dianne
Copy link
Contributor Author

dianne commented Aug 15, 2025

Thanks for testing this! That's also a separate bug; it ICEs with debug asserts on before my commits. Here's what it looks like on stable/nightly with debug asserts off:

help: use `let _ = ...` to ignore the expression or result
  |
2 -     drop(format_args!("a"));
2 +     drop(let _ = );
  |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-nominated Nominated for backporting to the compiler in the beta channel. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. I-lang-nominated Nominated for discussion during a lang team meeting. I-lang-radar Items that are on lang's radar and will need eventual work or consideration. I-libs-api-nominated Nominated for discussion during a libs-api team meeting. P-lang-drag-0 Lang team prioritization drag level 0.https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang. proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. S-waiting-on-crater Status: Waiting on a crater run to be completed. stable-nominated Nominated for backporting to the compiler in the stable channel. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression when dropping temporary value in match in older editions pin!() has incorrect/unexpected drop order inside if-let.
10 participants