-
Notifications
You must be signed in to change notification settings - Fork 35
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
Build broken by type alias enforcing outlives relations #139
Comments
#![feature(generic_associated_types)]
#![feature(type_alias_impl_trait)]
trait Gats {
type Build<'a, 'b>: Fn() -> String;
fn build<'a, 'b>(a: &'a str, b: &'b str) -> Self::Build<'a, 'b>;
}
type AlphaBuild<'a, 'b> = impl Fn() -> String;
struct Alpha;
impl Gats for Alpha {
type Build<'a, 'b> = AlphaBuild<'a, 'b>;
fn build<'a, 'b>(a: &'a str, b: &'b str) -> Self::Build<'a, 'b> {
|| format!("{}{}", a, b)
}
} |
doesn't quite reproduce #![feature(generic_associated_types)]
#![feature(type_alias_impl_trait)]
use std::fmt::Display;
trait GatsBase {
type Build<'a, 'b>: Fn() -> String;
}
trait Gats: GatsBase {
fn build<'a, 'b>(&'a self, b: &'b str) -> Self::Build<'a, 'b>;
}
type AlphaBuild<'a, 'b, T> = impl 'a + 'b + Fn() -> String;
struct Alpha<T: Display>(T);
impl<T: Display> GatsBase for Alpha<T> {
type Build<'a, 'b> = AlphaBuild<'a, 'b, T>;
}
impl<T: Display> Gats for Alpha<T> {
fn build<'a, 'b>(&'a self, b: &'b str) -> Self::Build<'a, 'b> {
|| format!("{}{}", self.0, b)
}
} |
I know nothing about hydroflow but noticed that adding Was it accpeted previously? That would be surprising! |
Thanks! Yeah, that does fix this example, so I guess this wasn't a reproduction of the issue we're having in hf itself. Still working on it. |
reproduced on playground Fixed by adding |
Oh I didn't know the |
Although I guess writing |
rust-lang/rust#95519
The text was updated successfully, but these errors were encountered: