Skip to content

next-solver: "expected generic lifetime parameter, found '_" #145748

Closed

Description

@xDarksome

I tried to switch to next-solver, because of an ICE similar to this: #145482

This function fails to compile with:

error[E0792]: expected generic lifetime parameter, found `'_`
   --> /home/darksome/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/alloy-sol-macro-expander-1.3.0/src/expand/mod.rs:567:54
    |
530 | impl<'ast> ExpCtxt<'ast> {
    |      ---- this generic parameter must be used with a generic lifetime parameter
...
567 |         move |ty| self.custom_type(ty).is_value_type(self.custom_is_value_type())
    |        

It works on stable and nightly without -Znext-solver

Meta

rustc --version --verbose:

rustc 1.91.0-nightly (3672a55b7 2025-08-13)
binary: rustc
commit-hash: 3672a55b7cfd0a12e7097197b6242872473ffaa7
commit-date: 2025-08-13
host: x86_64-unknown-linux-gnu
release: 1.91.0-nightly
LLVM version: 21.1.0

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Aug 22, 2025
  2. added
    T-typesRelevant to the types team, which will review and decide on the PR/issue.
    WG-trait-system-refactorThe Rustc Trait System Refactor Initiative (-Znext-solver)
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Aug 22, 2025
  3. lqd commented on Aug 22, 2025

    @lqd
    Member
    pub fn f(_: &()) -> impl Fn() + '_ {
        || {
            let _ = f(&());
        }
    }

    godbolt

    (this error has changed since #145244 landed yesterday: on nightly-2025-08-21 you get the OP, while on nightly-2025-08-22 it's an error: non-defining use of `impl Fn()` in the defining scope)

  4. removed
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    on Aug 22, 2025
  5. added 2 commits that reference this issue on Dec 10, 2025
    93fd8e0
    76abd73
  6. added a commit that references this issue on Dec 10, 2025
    57cebd4
  7. added a commit that references this issue on Dec 10, 2025
    ecd9e09
  8. added a commit that references this issue on Dec 11, 2025
    269bdac
  9. added a commit that references this issue on Dec 21, 2025
    4ab8eb0
  10. added a commit that references this issue on Dec 29, 2025
    62c9dfa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-trait-systemArea: Trait systemC-bugCategory: This is a bug.T-typesRelevant to the types team, which will review and decide on the PR/issue.WG-trait-system-refactorThe Rustc Trait System Refactor Initiative (-Znext-solver)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions