-
Notifications
You must be signed in to change notification settings - Fork 13.3k
cargo check
works fine, but cargo build
gives "overflow evaluating the requirement "
#139658
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
Labels
C-bug
Category: This is a bug.
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
Comments
Another variant: trait Trait<'a> {
type Output;
}
impl<'a, O, F: Fn(&'a str) -> O> Trait<'a> for F {
type Output = O;
}
struct Wrap<P>(P);
impl<'a, P: Trait<'a>> Trait<'a> for Wrap<P> {
type Output = P::Output;
}
fn wrap<'a, P: Trait<'a>>(x: P) -> impl Trait<'a> {
Wrap(x)
}
fn consume<'a, P: Trait<'a>>(_: P) -> P::Output {
unimplemented!()
}
pub fn recurse<'a>(_: &'a str) -> impl Sized + 'a {
consume(wrap(recurse))
} Output:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: This is a bug.
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
I tried this code:
I think that the code should compile fine. However:
cargo check
, it compiles fine.cargo build
, I get the following error:Minimized from real code written by fearless_process on the rust community discord.
Very similar to #139659, which instead ICEs.
Meta
rustc --version --verbose
:The issue also reproduces on
rustc 1.88.0-nightly (0fe8f3454 2025-04-10)
.The text was updated successfully, but these errors were encountered: